diff --git a/ear/plugin.jelly b/ear/plugin.jelly index e3007645..c27144b9 100644 --- a/ear/plugin.jelly +++ b/ear/plugin.jelly @@ -234,6 +234,16 @@ + + + + ${maven.ear.appxml.securityRoles} + + + ${role.trim()} + + + diff --git a/ear/plugin.properties b/ear/plugin.properties index dc09d5fc..ceaf8451 100644 --- a/ear/plugin.properties +++ b/ear/plugin.properties @@ -34,3 +34,6 @@ maven.ear.resources=${maven.build.dir}/ear maven.ear.appxml.encoding=UTF-8 # Name of generated EAR file maven.ear.final.name=${maven.final.name}.ear + +# Security role (a comma separated list) +# maven.ear.appxml.securityRoles = role1, role2 diff --git a/ear/src/plugin-test/securityRoleTest/maven.xml b/ear/src/plugin-test/securityRoleTest/maven.xml new file mode 100644 index 00000000..c0d5a053 --- /dev/null +++ b/ear/src/plugin-test/securityRoleTest/maven.xml @@ -0,0 +1,80 @@ + + + + + + + + + SRC: ${maven.ear.src} + Build ear... + + + + + + + + + + + + + + Loading test file: ${tmpEarDir}/META-INF/application.xml + + + + Parsing file... + + + + + Compare the number of defined security-role... + + + + + + + + + + Found: ${securityRoleName} + + + + + + + + + + + + + diff --git a/ear/src/plugin-test/securityRoleTest/project.properties b/ear/src/plugin-test/securityRoleTest/project.properties new file mode 100644 index 00000000..18a7926b --- /dev/null +++ b/ear/src/plugin-test/securityRoleTest/project.properties @@ -0,0 +1,18 @@ +# ------------------------------------------------------------------- +# Copyright 2001-2006 The Apache Software Foundation. +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. +# ------------------------------------------------------------------- + +maven.ear.appxml.generate=true +maven.ear.appxml.securityRoles = role1, role2 diff --git a/ear/src/plugin-test/securityRoleTest/project.xml b/ear/src/plugin-test/securityRoleTest/project.xml new file mode 100644 index 00000000..682a4bb5 --- /dev/null +++ b/ear/src/plugin-test/securityRoleTest/project.xml @@ -0,0 +1,30 @@ + + + + 3 + Ear Plugin - AppXml Security Role Test + test-maven-ear-plugin-securityRoleTest + 2006 + Tests the security-role are well created + Tests the security-role are well created + + testPlugin + + diff --git a/ear/xdocs/properties.xml b/ear/xdocs/properties.xml index aa5cf2d8..40a97b0d 100644 --- a/ear/xdocs/properties.xml +++ b/ear/xdocs/properties.xml @@ -128,6 +128,16 @@ ${maven.build.dir} + + maven.ear.appxml.securityRoles + Yes + + A comma-separated list of role names. Will create xml element security-role with sub-element role-name. + + + Empty + +