diff -Nru maven-ejb-plugin-2.3/debian/changelog maven-ejb-plugin-2.5.1/debian/changelog --- maven-ejb-plugin-2.3/debian/changelog 2015-12-09 13:07:18.000000000 +0000 +++ maven-ejb-plugin-2.5.1/debian/changelog 2017-07-27 06:58:25.000000000 +0000 @@ -1,3 +1,14 @@ +maven-ejb-plugin (2.5.1-1) unstable; urgency=medium + + * Team upload. + * New upstream release + * Depend on libmaven3-core-java instead of libmaven2-core-java + * Standards-Version updated to 4.0.0 + * Switch to debhelper level 10 + * Use secure Vcs-* URLs + + -- Emmanuel Bourg Thu, 27 Jul 2017 08:58:25 +0200 + maven-ejb-plugin (2.3-1) unstable; urgency=medium * Team upload. diff -Nru maven-ejb-plugin-2.3/debian/compat maven-ejb-plugin-2.5.1/debian/compat --- maven-ejb-plugin-2.3/debian/compat 2015-12-09 13:00:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/debian/compat 2017-07-27 06:36:25.000000000 +0000 @@ -1 +1 @@ -9 +10 diff -Nru maven-ejb-plugin-2.3/debian/control maven-ejb-plugin-2.5.1/debian/control --- maven-ejb-plugin-2.3/debian/control 2015-12-09 13:00:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/debian/control 2017-07-27 06:58:13.000000000 +0000 @@ -3,16 +3,19 @@ Priority: optional Maintainer: Debian Java Maintainers Uploaders: Ludovic Claude -Build-Depends: debhelper (>= 9), default-jdk, maven-debian-helper -Build-Depends-Indep: libmaven-archiver-java, - libmaven-invoker-plugin-java (>= 1.3), - libmaven-plugin-testing-java, - libmaven-plugin-tools-java, - libmaven2-core-java, - libplexus-utils-java -Standards-Version: 3.9.6 -Vcs-Git: git://anonscm.debian.org/pkg-java/maven-ejb-plugin.git -Vcs-Browser: http://anonscm.debian.org/cgit/pkg-java/maven-ejb-plugin.git +Build-Depends: + debhelper (>= 10), + default-jdk, + libmaven-archiver-java, + libmaven-invoker-plugin-java (>= 1.3), + libmaven-plugin-testing-java, + libmaven-plugin-tools-java, + libmaven3-core-java, + libplexus-utils-java, + maven-debian-helper +Standards-Version: 4.0.0 +Vcs-Git: https://anonscm.debian.org/git/pkg-java/maven-ejb-plugin.git +Vcs-Browser: https://anonscm.debian.org/cgit/pkg-java/maven-ejb-plugin.git Homepage: http://maven.apache.org/plugins/maven-ejb-plugin/ Package: libmaven-ejb-plugin-java diff -Nru maven-ejb-plugin-2.3/debian/maven.rules maven-ejb-plugin-2.5.1/debian/maven.rules --- maven-ejb-plugin-2.3/debian/maven.rules 2015-12-09 13:00:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/debian/maven.rules 2017-07-27 06:58:13.000000000 +0000 @@ -2,3 +2,6 @@ s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-plugin-testing-harness * s/.*/debian/ * s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-plugin-testing-tools * s/.*/debian/ * s/org.apache.maven.shared/org.apache.maven.plugin-testing/ maven-test-tools * s/.*/debian/ * +org.apache.maven maven-plugin-api * s/.*/3.x/ * * +org.apache.maven maven-artifact * s/.*/3.x/ * * +org.apache.maven s/maven-project/maven-core/ * s/.*/3.x/ * * diff -Nru maven-ejb-plugin-2.3/debian/rules maven-ejb-plugin-2.5.1/debian/rules --- maven-ejb-plugin-2.3/debian/rules 2015-12-09 13:00:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/debian/rules 2017-07-27 06:36:25.000000000 +0000 @@ -1,9 +1,7 @@ #!/usr/bin/make -f -export JAVA_HOME = /usr/lib/jvm/default-java - %: - dh $@ --buildsystem=maven + dh $@ get-orig-source: uscan --download-current-version --force-download --no-symlink diff -Nru maven-ejb-plugin-2.3/pom.xml maven-ejb-plugin-2.5.1/pom.xml --- maven-ejb-plugin-2.3/pom.xml 2010-09-15 17:39:59.000000000 +0000 +++ maven-ejb-plugin-2.5.1/pom.xml 2015-06-16 19:47:21.000000000 +0000 @@ -25,32 +25,41 @@ org.apache.maven.plugins maven-plugins - 18 + 27 + ../maven-plugins/pom.xml maven-ejb-plugin - 2.3 + 2.5.1 maven-plugin - Maven EJB Plugin + Apache Maven EJB Plugin Generates a J2EE Enterprise JavaBean (EJB) file as well as the associated client JAR. - 2.0.6 + ${mavenVersion} - scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-ejb-plugin-2.3 - scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ejb-plugin-2.3 - http://svn.apache.org/viewvc/maven/plugins/tags/maven-ejb-plugin-2.3 + scm:svn:http://svn.apache.org/repos/asf/maven/plugins/tags/maven-ejb-plugin-2.5.1 + scm:svn:https://svn.apache.org/repos/asf/maven/plugins/tags/maven-ejb-plugin-2.5.1 + http://svn.apache.org/viewvc/maven/plugins/tags/maven-ejb-plugin-2.5.1 JIRA - http://jira.codehaus.org/browse/MEJB + https://issues.apache.org/jira/browse/MEJB + + + apache.website + scm:svn:https://svn.apache.org/repos/infra/websites/production/maven/components/${maven.site.path} + + - 2.0.6 + 2.6 + 1.3 + 2.2.1 @@ -72,39 +81,43 @@ org.apache.maven maven-archiver - 2.4.1 - - - org.codehaus.plexus - plexus-component-api - - + ${mavenArchiverVersion} + + + org.apache.maven.plugin-tools + maven-plugin-annotations + provided org.apache.maven.shared maven-filtering - 1.0-beta-2 + ${mavenFilteringVersion} org.codehaus.plexus plexus-utils - 2.0.5 + 3.0.20 org.codehaus.plexus plexus-archiver - 1.0 - - - org.codehaus.plexus - plexus-component-api - - + 2.10.2 - org.apache.maven.shared + org.codehaus.plexus + plexus-interpolation + 1.21 + + + commons-io + commons-io + 2.2 + + + + org.apache.maven.plugin-testing maven-plugin-testing-harness - 1.1 + 1.3 test @@ -113,38 +126,30 @@ run-its - - - org.apache.maven.plugins - maven-invoker-plugin - 1.5 - - true - src/it - ${project.build.directory}/it - - */pom.xml - - setup - verify - ${project.build.directory}/local-repo - src/it/settings.xml - - clean - package - - - - - integration-test + + + + org.apache.maven.plugins + maven-invoker-plugin + + true + src/it + ${project.build.directory}/it + + */pom.xml + + setup + verify + ${project.build.directory}/local-repo + src/it/settings.xml - install - run + clean + package - - - - + + + + diff -Nru maven-ejb-plugin-2.3/src/it/default/src/main/java/org/apache/maven/it0017/Person.java maven-ejb-plugin-2.5.1/src/it/default/src/main/java/org/apache/maven/it0017/Person.java --- maven-ejb-plugin-2.3/src/it/default/src/main/java/org/apache/maven/it0017/Person.java 2008-09-15 16:28:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/default/src/main/java/org/apache/maven/it0017/Person.java 2013-09-14 18:40:50.000000000 +0000 @@ -1,5 +1,24 @@ package org.apache.maven.it0017; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + public class Person { private String name; diff -Nru maven-ejb-plugin-2.3/src/it/default/src/main/resources/META-INF/ejb-jar.xml maven-ejb-plugin-2.5.1/src/it/default/src/main/resources/META-INF/ejb-jar.xml --- maven-ejb-plugin-2.3/src/it/default/src/main/resources/META-INF/ejb-jar.xml 2008-09-15 16:28:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/default/src/main/resources/META-INF/ejb-jar.xml 2013-09-14 18:40:50.000000000 +0000 @@ -1,4 +1,22 @@ + diff -Nru maven-ejb-plugin-2.3/src/it/default/verify.bsh maven-ejb-plugin-2.5.1/src/it/default/verify.bsh --- maven-ejb-plugin-2.3/src/it/default/verify.bsh 2008-09-15 16:28:40.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/default/verify.bsh 2013-09-14 18:40:50.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + import java.io.*; import java.util.*; import java.util.jar.*; diff -Nru maven-ejb-plugin-2.3/src/it/exclude-ejb-jar-xml/src/main/resources/META-INF/ejb-jar.xml maven-ejb-plugin-2.5.1/src/it/exclude-ejb-jar-xml/src/main/resources/META-INF/ejb-jar.xml --- maven-ejb-plugin-2.3/src/it/exclude-ejb-jar-xml/src/main/resources/META-INF/ejb-jar.xml 2010-03-17 18:37:43.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/exclude-ejb-jar-xml/src/main/resources/META-INF/ejb-jar.xml 2013-09-14 18:40:50.000000000 +0000 @@ -1,3 +1,21 @@ + diff -Nru maven-ejb-plugin-2.3/src/it/exclude-ejb-jar-xml/verify.bsh maven-ejb-plugin-2.5.1/src/it/exclude-ejb-jar-xml/verify.bsh --- maven-ejb-plugin-2.3/src/it/exclude-ejb-jar-xml/verify.bsh 2010-03-17 18:37:43.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/exclude-ejb-jar-xml/verify.bsh 2013-09-14 18:40:50.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + import java.io.*; import java.util.*; import java.util.zip.*; diff -Nru maven-ejb-plugin-2.3/src/it/manifest-classpath/pom.xml maven-ejb-plugin-2.5.1/src/it/manifest-classpath/pom.xml --- maven-ejb-plugin-2.3/src/it/manifest-classpath/pom.xml 2010-03-17 17:48:26.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/manifest-classpath/pom.xml 1970-01-01 00:00:00.000000000 +0000 @@ -1,64 +0,0 @@ - - - - - - 4.0.0 - - org.apache.maven.its.ejb.mc - test - 1.0 - ejb - - Integration Test - - Test the generation of the Class-Path attribute for the MANIFEST.MF (MEJB-46). - - - - UTF-8 - - - - - junit - junit - 3.8.2 - - - - - - - org.apache.maven.plugins - maven-ejb-plugin - @project.version@ - - 3.0 - - - true - - - - - - - diff -Nru maven-ejb-plugin-2.3/src/it/manifest-classpath/verify.bsh maven-ejb-plugin-2.5.1/src/it/manifest-classpath/verify.bsh --- maven-ejb-plugin-2.3/src/it/manifest-classpath/verify.bsh 2010-03-17 17:48:26.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/manifest-classpath/verify.bsh 1970-01-01 00:00:00.000000000 +0000 @@ -1,22 +0,0 @@ -import java.io.*; -import java.util.*; -import java.util.jar.*; -import java.util.regex.*; - -File jarFile = new File( basedir, "target/test-1.0.jar" ); -System.out.println( "Checking for existence of " + jarFile ); -if ( !jarFile.isFile() ) -{ - throw new FileNotFoundException( "Missing " + jarFile ); -} - -JarFile jar = new JarFile( jarFile ); - -Manifest mf = jar.getManifest(); -String classpath = mf.getMainAttributes().getValue( Attributes.Name.CLASS_PATH ); -if ( classpath == null || classpath.indexOf( "junit-3.8.2.jar" ) < 0 ) -{ - throw new IllegalStateException( "Bad Class-Path " + classpath ); -} - -jar.close(); diff -Nru maven-ejb-plugin-2.3/src/it/manifest-content/pom.xml maven-ejb-plugin-2.5.1/src/it/manifest-content/pom.xml --- maven-ejb-plugin-2.3/src/it/manifest-content/pom.xml 1970-01-01 00:00:00.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/manifest-content/pom.xml 2010-03-17 17:48:26.000000000 +0000 @@ -0,0 +1,64 @@ + + + + + + 4.0.0 + + org.apache.maven.its.ejb.mc + test + 1.0 + ejb + + Integration Test + + Test the generation of the Class-Path attribute for the MANIFEST.MF (MEJB-46). + + + + UTF-8 + + + + + junit + junit + 3.8.2 + + + + + + + org.apache.maven.plugins + maven-ejb-plugin + @project.version@ + + 3.0 + + + true + + + + + + + diff -Nru maven-ejb-plugin-2.3/src/it/manifest-content/src/main/resources/it.properties maven-ejb-plugin-2.5.1/src/it/manifest-content/src/main/resources/it.properties --- maven-ejb-plugin-2.3/src/it/manifest-content/src/main/resources/it.properties 1970-01-01 00:00:00.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/manifest-content/src/main/resources/it.properties 2013-09-14 18:40:50.000000000 +0000 @@ -0,0 +1,16 @@ +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. diff -Nru maven-ejb-plugin-2.3/src/it/manifest-content/verify.bsh maven-ejb-plugin-2.5.1/src/it/manifest-content/verify.bsh --- maven-ejb-plugin-2.3/src/it/manifest-content/verify.bsh 1970-01-01 00:00:00.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/manifest-content/verify.bsh 2013-09-14 18:40:50.000000000 +0000 @@ -0,0 +1,47 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + +import java.io.*; +import java.util.*; +import java.util.jar.*; +import java.util.regex.*; + +File jarFile = new File( basedir, "target/test-1.0.jar" ); +System.out.println( "Checking for existence of " + jarFile ); +if ( !jarFile.isFile() ) +{ + throw new FileNotFoundException( "Missing " + jarFile ); +} + +JarFile jar = new JarFile( jarFile ); + +Attributes manifest = jar.getManifest().getMainAttributes(); + +if ( !manifest.getValue( new Attributes.Name( "Created-By" ) ).startsWith( "Apache Maven" ) ) +{ + throw new IllegalStateException( "Created-By not equals Apache Maven" ); +} + +String classpath = manifest.getValue( Attributes.Name.CLASS_PATH ); +if ( classpath == null || classpath.indexOf( "junit-3.8.2.jar" ) < 0 ) +{ + throw new IllegalStateException( "Bad Class-Path " + classpath ); +} + +jar.close(); diff -Nru maven-ejb-plugin-2.3/src/it/mejb-34-filtered/src/main/java/org/apache/maven/mejb34/Person.java maven-ejb-plugin-2.5.1/src/it/mejb-34-filtered/src/main/java/org/apache/maven/mejb34/Person.java --- maven-ejb-plugin-2.3/src/it/mejb-34-filtered/src/main/java/org/apache/maven/mejb34/Person.java 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/mejb-34-filtered/src/main/java/org/apache/maven/mejb34/Person.java 2013-09-14 18:40:50.000000000 +0000 @@ -1,5 +1,24 @@ package org.apache.maven.mejb34; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + public class Person { private String name; diff -Nru maven-ejb-plugin-2.3/src/it/mejb-34-filtered/src/main/resources/META-INF/ejb-jar.xml maven-ejb-plugin-2.5.1/src/it/mejb-34-filtered/src/main/resources/META-INF/ejb-jar.xml --- maven-ejb-plugin-2.3/src/it/mejb-34-filtered/src/main/resources/META-INF/ejb-jar.xml 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/mejb-34-filtered/src/main/resources/META-INF/ejb-jar.xml 2013-09-14 18:40:50.000000000 +0000 @@ -1,4 +1,22 @@ + diff -Nru maven-ejb-plugin-2.3/src/it/mejb-34-filtered/verify.bsh maven-ejb-plugin-2.5.1/src/it/mejb-34-filtered/verify.bsh --- maven-ejb-plugin-2.3/src/it/mejb-34-filtered/verify.bsh 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/mejb-34-filtered/verify.bsh 2013-09-14 18:40:50.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + import java.io.*; import java.util.*; import java.util.jar.*; diff -Nru maven-ejb-plugin-2.3/src/it/mejb-34-not-filtered/src/main/java/org/apache/maven/mejb34/Person.java maven-ejb-plugin-2.5.1/src/it/mejb-34-not-filtered/src/main/java/org/apache/maven/mejb34/Person.java --- maven-ejb-plugin-2.3/src/it/mejb-34-not-filtered/src/main/java/org/apache/maven/mejb34/Person.java 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/mejb-34-not-filtered/src/main/java/org/apache/maven/mejb34/Person.java 2013-09-14 18:40:50.000000000 +0000 @@ -1,5 +1,24 @@ package org.apache.maven.mejb34; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + public class Person { private String name; diff -Nru maven-ejb-plugin-2.3/src/it/mejb-34-not-filtered/src/main/resources/META-INF/ejb-jar.xml maven-ejb-plugin-2.5.1/src/it/mejb-34-not-filtered/src/main/resources/META-INF/ejb-jar.xml --- maven-ejb-plugin-2.3/src/it/mejb-34-not-filtered/src/main/resources/META-INF/ejb-jar.xml 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/mejb-34-not-filtered/src/main/resources/META-INF/ejb-jar.xml 2013-09-14 18:40:50.000000000 +0000 @@ -1,4 +1,22 @@ + diff -Nru maven-ejb-plugin-2.3/src/it/mejb-34-not-filtered/verify.bsh maven-ejb-plugin-2.5.1/src/it/mejb-34-not-filtered/verify.bsh --- maven-ejb-plugin-2.3/src/it/mejb-34-not-filtered/verify.bsh 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/mejb-34-not-filtered/verify.bsh 2013-09-14 18:40:50.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + import java.io.*; import java.util.*; import java.util.jar.*; diff -Nru maven-ejb-plugin-2.3/src/it/reactor/sub/pom.xml maven-ejb-plugin-2.5.1/src/it/reactor/sub/pom.xml --- maven-ejb-plugin-2.3/src/it/reactor/sub/pom.xml 2009-06-07 20:22:07.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/reactor/sub/pom.xml 2014-12-27 23:35:16.000000000 +0000 @@ -44,7 +44,7 @@ @project.version@ - target/classes + target/classes diff -Nru maven-ejb-plugin-2.3/src/it/reactor/sub/src/main/java/org/apache/maven/Person.java maven-ejb-plugin-2.5.1/src/it/reactor/sub/src/main/java/org/apache/maven/Person.java --- maven-ejb-plugin-2.3/src/it/reactor/sub/src/main/java/org/apache/maven/Person.java 2009-06-07 20:22:07.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/reactor/sub/src/main/java/org/apache/maven/Person.java 2013-09-14 18:40:50.000000000 +0000 @@ -1,5 +1,24 @@ package org.apache.maven; +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + public class Person { private String name; diff -Nru maven-ejb-plugin-2.3/src/it/reactor/sub/src/main/resources/META-INF/ejb-jar.xml maven-ejb-plugin-2.5.1/src/it/reactor/sub/src/main/resources/META-INF/ejb-jar.xml --- maven-ejb-plugin-2.3/src/it/reactor/sub/src/main/resources/META-INF/ejb-jar.xml 2009-06-07 20:22:07.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/reactor/sub/src/main/resources/META-INF/ejb-jar.xml 2013-09-14 18:40:50.000000000 +0000 @@ -1,4 +1,22 @@ + diff -Nru maven-ejb-plugin-2.3/src/it/reactor/verify.bsh maven-ejb-plugin-2.5.1/src/it/reactor/verify.bsh --- maven-ejb-plugin-2.3/src/it/reactor/verify.bsh 2009-06-07 20:22:07.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/it/reactor/verify.bsh 2013-09-14 18:40:50.000000000 +0000 @@ -1,3 +1,22 @@ +/* + * Licensed to the Apache Software Foundation (ASF) under one + * or more contributor license agreements. See the NOTICE file + * distributed with this work for additional information + * regarding copyright ownership. The ASF licenses this file + * to you 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. + */ + import java.io.*; import java.util.*; import java.util.jar.*; diff -Nru maven-ejb-plugin-2.3/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java maven-ejb-plugin-2.5.1/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java --- maven-ejb-plugin-2.3/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java 2010-09-15 10:45:28.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/main/java/org/apache/maven/plugin/ejb/EjbMojo.java 2014-12-27 23:35:16.000000000 +0000 @@ -19,236 +19,231 @@ * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.List; + +import org.apache.commons.io.IOUtils; +import org.apache.commons.io.input.XmlStreamReader; import org.apache.maven.archiver.MavenArchiveConfiguration; import org.apache.maven.archiver.MavenArchiver; import org.apache.maven.artifact.DependencyResolutionRequiredException; import org.apache.maven.execution.MavenSession; import org.apache.maven.plugin.AbstractMojo; import org.apache.maven.plugin.MojoExecutionException; +import org.apache.maven.plugins.annotations.Component; +import org.apache.maven.plugins.annotations.LifecyclePhase; +import org.apache.maven.plugins.annotations.Mojo; +import org.apache.maven.plugins.annotations.Parameter; +import org.apache.maven.plugins.annotations.ResolutionScope; import org.apache.maven.project.MavenProject; import org.apache.maven.project.MavenProjectHelper; import org.apache.maven.shared.filtering.MavenFileFilter; import org.apache.maven.shared.filtering.MavenFilteringException; import org.apache.maven.shared.filtering.MavenResourcesExecution; +import org.apache.maven.shared.utils.io.FileUtils.FilterWrapper; +import org.codehaus.plexus.archiver.Archiver; import org.codehaus.plexus.archiver.ArchiverException; import org.codehaus.plexus.archiver.jar.JarArchiver; import org.codehaus.plexus.archiver.jar.ManifestException; import org.codehaus.plexus.util.FileUtils; -import org.codehaus.plexus.util.xml.XmlStreamReader; - -import java.io.File; -import java.io.IOException; -import java.util.List; /** * Build an EJB (and optional client) from the current project. * * @author Emmanuel Venisse - * @version $Id: EjbMojo.java 997273 2010-09-15 10:45:28Z dennisl $ - * @goal ejb - * @requiresDependencyResolution runtime - * @threadSafe - * @phase package + * @version $Id: EjbMojo.java 1648129 2014-12-27 23:35:16Z khmarbaise $ */ +// CHECKSTYLE_OFF: LineLength +@Mojo( name = "ejb", requiresDependencyResolution = ResolutionScope.RUNTIME, threadSafe = true, defaultPhase = LifecyclePhase.PACKAGE ) +// CHECKSTYLE_ON: LineLength public class EjbMojo extends AbstractMojo { - private static final String EJB_JAR_XML = "META-INF/ejb-jar.xml"; - // TODO: will null work instead? - private static final String[] DEFAULT_INCLUDES = new String[]{"**/**"}; - - private static final String[] DEFAULT_EXCLUDES = new String[]{EJB_JAR_XML, "**/package.html"}; + private static final String[] DEFAULT_INCLUDES = new String[] { "**/**" }; - private static final String[] DEFAULT_CLIENT_EXCLUDES = - new String[]{"**/*Bean.class", "**/*CMP.class", "**/*Session.class", "**/package.html"}; - - private static final String[] EMPTY_STRING_ARRAY = new String[0]; + private static final String[] DEFAULT_CLIENT_EXCLUDES = new String[] { "**/*Bean.class", "**/*CMP.class", + "**/*Session.class", "**/package.html" }; /** - * The directory for the generated EJB. - * - * @parameter default-value="${project.build.directory}" - * @required - * @readonly + * The directory location for the generated EJB. */ - private File basedir; + @Parameter( defaultValue = "${project.build.directory}", required = true, readonly = true ) + private File outputDirectory; /** - * Directory that resources are copied to during the build. - * - * @parameter default-value="${project.build.outputDirectory}" expression="${outputDirectory}" + * Directory that contains the resources which are packaged into + * the created archive {@code target/classes}. */ - private File outputDirectory; + @Parameter( defaultValue = "${project.build.outputDirectory}", required = true ) + private File sourceDirectory; /** * The name of the EJB file to generate. - * - * @parameter default-value="${project.build.finalName}" expression="${jarName}" */ + @Parameter( property = "jarName", defaultValue = "${project.build.finalName}" ) private String jarName; /** - * Classifier to add to the artifact generated. If given, the artifact will - * be an attachment instead. - * - * @parameter expression="${ejb.classifier}" + * Classifier to add to the artifact generated. If given, the artifact will be an attachment instead. */ + @Parameter( property = "ejb.classifier" ) private String classifier; /** + * You can define the location of ejb-jar.xml file. + */ + @Parameter( property = "ejb.ejbJar", defaultValue = "META-INF/ejb-jar.xml" ) + // The initialization is needed to get the unit tests running which seemed to lack lookup for the defaultValue. + private String ejbJar = "META-INF/ejb-jar.xml"; + + /** * Whether the EJB client jar should be generated or not. - * - * @parameter default-value="false" expression="${ejb.generateClient}" */ + @Parameter( property = "ejb.generateClient", defaultValue = "false" ) private boolean generateClient; /** * The files and directories to exclude from the client jar. Usage: - * + *

+ * *

      * <clientExcludes>
      *   <clientExclude>**/*Ejb.class</clientExclude>
      *   <clientExclude>**/*Bean.class</clientExclude>
      * </clientExcludes>
      * 
- *
Attribute is used only if client jar is generated. - *
Default exclusions: **/*Bean.class, **/*CMP.class, **/*Session.class, **/package.html - * - * @parameter + * + *
+ * Attribute is used only if client jar is generated.
+ * Default exclusions: **/*Bean.class, **/*CMP.class, **/*Session.class, **/package.html */ - private List clientExcludes; + @Parameter + private List clientExcludes; /** * The files and directories to include in the client jar. Usage: - * + *

+ * *

      * <clientIncludes>
      *   <clientInclude>**/*</clientInclude>
      * </clientIncludes>
      * 
- *
Attribute is used only if client jar is generated. - *
Default value: **/** - * - * @parameter + * + *
+ * Attribute is used only if client jar is generated.
+ * Default value: **/** */ - private List clientIncludes; + @Parameter + private List clientIncludes; /** * The files and directories to exclude from the main EJB jar. Usage: - * + *

+ * *

      * <excludes>
      *   <exclude>**/*Ejb.class</exclude>
      *   <exclude>**/*Bean.class</exclude>
      * </excludes>
      * 
- *
Default exclusions: META-INF/ejb-jar.xml, **/package.html - * @parameter + * + *
+ * Default exclusions: META-INF/ejb-jar.xml, **/package.html */ - private List excludes; + @Parameter + private List excludes; /** * The Maven project. - * - * @parameter default-value="${project}" - * @required - * @readonly */ + @Parameter( defaultValue = "${project}", readonly = true, required = true ) private MavenProject project; /** * The Jar archiver. - * - * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar" */ + @Component( role = Archiver.class, hint = "jar" ) private JarArchiver jarArchiver; /** - * What EJB version should the EJB Plugin generate? Valid values are "2.x" or "3.x" - * (where x is a digit). When ejbVersion is "3.x", the - * ejb-jar.xml file is optional. + * What EJB version should the EJB Plugin generate? Valid values are "2.x" or "3.x" (where x is a digit). When + * ejbVersion is "3.x", the ejb-jar.xml file is optional. *

* Usage: + * *

      * <ejbVersion>3.0</ejbVersion>
      * 
* - * @parameter default-value="2.1" expression="${ejb.ejbVersion}" * @since 2.1 */ + @Parameter( property = "ejb.ejbVersion", defaultValue = "2.1" ) private String ejbVersion; /** * The client Jar archiver. - * - * @component role="org.codehaus.plexus.archiver.Archiver" roleHint="jar" */ + @Component( role = Archiver.class, hint = "jar" ) private JarArchiver clientJarArchiver; /** * The Maven project's helper. - * - * @component */ + @Component private MavenProjectHelper projectHelper; /** - * The archive configuration to use. - * See Maven Archiver Reference. - * This version of the EJB Plugin uses Maven Archiver 2.4. - * - * @parameter + * The archive configuration to use. See Maven + * Archiver Reference. */ + @Parameter private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); /** - * To escape interpolated value with windows path. - * c:\foo\bar will be replaced with c:\\foo\\bar. + * To escape interpolated value with windows path. c:\foo\bar will be replaced with c:\\foo\\bar. * - * @parameter default-value="false" expression="${ejb.escapeBackslashesInFilePath}" * @since 2.3 */ + @Parameter( property = "ejb.escapeBackslashesInFilePath", defaultValue = "false" ) private boolean escapeBackslashesInFilePath; /** - * An expression preceded with this String won't be interpolated. - * \${foo} will be replaced with ${foo}. + * An expression preceded with this String won't be interpolated. \${foo} will be replaced with ${foo}. * - * @parameter expression="${ejb.escapeString}" * @since 2.3 */ + @Parameter( property = "ejb.escapeString" ) protected String escapeString; /** * To filter the deployment descriptor. * - * @parameter default-value="false" expression="${ejb.filterDeploymentDescriptor}" * @since 2.3 */ + @Parameter( property = "ejb.filterDeploymentDescriptor", defaultValue = "false" ) private boolean filterDeploymentDescriptor; /** * Filters (properties files) to include during the interpolation of the deployment descriptor. * - * @parameter * @since 2.3 */ - private List filters; + @Parameter + private List filters; /** - * @component role="org.apache.maven.shared.filtering.MavenFileFilter" role-hint="default" - * @required * @since 2.3 */ + @Component( role = MavenFileFilter.class, hint = "default" ) private MavenFileFilter mavenFileFilter; /** - * @parameter expression="${session}" - * @readonly - * @required * @since 2.3 */ + @Parameter( defaultValue = "${session}", readonly = true, required = true ) private MavenSession session; /** @@ -259,12 +254,20 @@ public void execute() throws MojoExecutionException { + + if ( !sourceDirectory.exists() ) + { + getLog().warn( "The created EJB jar will be empty cause the " + sourceDirectory.getPath() + + " did not exist." ); + sourceDirectory.mkdirs(); + } + if ( getLog().isInfoEnabled() ) { getLog().info( "Building EJB " + jarName + " with EJB version " + ejbVersion ); } - File jarFile = getEJBJarFile( basedir, jarName, classifier ); + File jarFile = getEJBJarFile( outputDirectory, jarName, classifier ); MavenArchiver archiver = new MavenArchiver(); @@ -272,59 +275,36 @@ archiver.setOutputFile( jarFile ); - File deploymentDescriptor = new File( outputDirectory, EJB_JAR_XML ); + File deploymentDescriptor = new File( sourceDirectory, ejbJar ); /* test EJB version compliance */ - if ( !ejbVersion.matches( "\\A[2-3]\\.[0-9]\\z" ) ) - { - throw new MojoExecutionException( - "ejbVersion is not valid: " + ejbVersion + ". Must be 2.x or 3.x (where x is a digit)" ); - } - - if ( ejbVersion.matches( "\\A2\\.[0-9]\\z" ) && !deploymentDescriptor.exists() ) - { - throw new MojoExecutionException( - "Error assembling EJB: " + EJB_JAR_XML + " is required for ejbVersion 2.x" ); - } + checkEJBVersionCompliance( deploymentDescriptor ); try { - String[] mainJarExcludes = DEFAULT_EXCLUDES; + // TODO: This should be handled different. + String[] mainJarExcludes = new String[] { ejbJar, "**/package.html" }; if ( excludes != null && !excludes.isEmpty() ) { - excludes.add( EJB_JAR_XML ); - mainJarExcludes = (String[]) excludes.toArray( EMPTY_STRING_ARRAY ); + excludes.add( ejbJar ); + mainJarExcludes = (String[]) excludes.toArray( new String[excludes.size()] ); } - archiver.getArchiver().addDirectory( outputDirectory, DEFAULT_INCLUDES, mainJarExcludes ); + archiver.getArchiver().addDirectory( sourceDirectory, DEFAULT_INCLUDES, mainJarExcludes ); if ( deploymentDescriptor.exists() ) { // EJB-34 Filter ejb-jar.xml if ( filterDeploymentDescriptor ) { - getLog().debug( "Filtering deployment descriptor." ); - MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(); - mavenResourcesExecution.setEscapeString( escapeString ); - List filterWrappers = mavenFileFilter.getDefaultFilterWrappers( project, filters, - escapeBackslashesInFilePath, - this.session, - mavenResourcesExecution ); - - // Create a temporary file that we can copy-and-filter - File unfilteredDeploymentDescriptor = new File( outputDirectory, EJB_JAR_XML + ".unfiltered" ); - FileUtils.copyFile( deploymentDescriptor, unfilteredDeploymentDescriptor ); - mavenFileFilter.copyFile( unfilteredDeploymentDescriptor, deploymentDescriptor, true, - filterWrappers, getEncoding( unfilteredDeploymentDescriptor ) ); - // Remove the temporary file - FileUtils.forceDelete( unfilteredDeploymentDescriptor ); + filterDeploymentDescriptor( deploymentDescriptor ); } - archiver.getArchiver().addFile( deploymentDescriptor, EJB_JAR_XML ); + archiver.getArchiver().addFile( deploymentDescriptor, ejbJar ); } // create archive - archiver.createArchive( project, archive ); + archiver.createArchive( session, project, archive ); } catch ( ArchiverException e ) { @@ -344,10 +324,12 @@ } catch ( MavenFilteringException e ) { - throw new MojoExecutionException( "There was a problem filtering the deployment descriptor: " + e.getMessage(), e ); + throw new MojoExecutionException( "There was a problem filtering the deployment descriptor: " + + e.getMessage(), e ); } // Handle the classifier if necessary + // TODO: For 3.0 this should be changed having a separate classifier for main artifact and ejb-client. if ( classifier != null ) { projectHelper.attachArtifact( project, "ejb", classifier, jarFile ); @@ -359,81 +341,123 @@ if ( generateClient ) { - String clientJarName = jarName; - if ( classifier != null ) - { - clientJarName += "-" + classifier; - } + generateEjbClient(); + } + } - getLog().info( "Building EJB client " + clientJarName + "-client" ); + private void generateEjbClient() + throws MojoExecutionException + { + String clientJarName = jarName; + if ( classifier != null ) + { + clientJarName += "-" + classifier; + } - String[] excludes = DEFAULT_CLIENT_EXCLUDES; - String[] includes = DEFAULT_INCLUDES; + String resultingClientJarNameWithClassifier = clientJarName + "-client"; + getLog().info( "Building EJB client " + resultingClientJarNameWithClassifier ); - if ( clientIncludes != null && !clientIncludes.isEmpty() ) - { - includes = (String[]) clientIncludes.toArray( EMPTY_STRING_ARRAY ); - } + String[] excludes = DEFAULT_CLIENT_EXCLUDES; + String[] includes = DEFAULT_INCLUDES; - if ( clientExcludes != null && !clientExcludes.isEmpty() ) - { - excludes = (String[]) clientExcludes.toArray( EMPTY_STRING_ARRAY ); - } + if ( clientIncludes != null && !clientIncludes.isEmpty() ) + { + includes = (String[]) clientIncludes.toArray( new String[clientIncludes.size()] ); + } - File clientJarFile = new File( basedir, clientJarName + "-client.jar" ); + if ( clientExcludes != null && !clientExcludes.isEmpty() ) + { + excludes = (String[]) clientExcludes.toArray( new String[clientExcludes.size()] ); + } - MavenArchiver clientArchiver = new MavenArchiver(); + File clientJarFile = new File( outputDirectory, resultingClientJarNameWithClassifier + ".jar" ); - clientArchiver.setArchiver( clientJarArchiver ); + MavenArchiver clientArchiver = new MavenArchiver(); - clientArchiver.setOutputFile( clientJarFile ); + clientArchiver.setArchiver( clientJarArchiver ); - try - { - clientArchiver.getArchiver().addDirectory( outputDirectory, includes, excludes ); + clientArchiver.setOutputFile( clientJarFile ); - // create archive - clientArchiver.createArchive( project, archive ); + try + { + clientArchiver.getArchiver().addDirectory( sourceDirectory, includes, excludes ); - } - catch ( ArchiverException e ) - { - throw new MojoExecutionException( - "There was a problem creating the EJB client archive: " + e.getMessage(), e ); - } - catch ( ManifestException e ) - { - throw new MojoExecutionException( - "There was a problem creating the EJB client archive: " + e.getMessage(), e ); - } - catch ( IOException e ) - { - throw new MojoExecutionException( - "There was a problem creating the EJB client archive: " + e.getMessage(), e ); - } - catch ( DependencyResolutionRequiredException e ) - { - throw new MojoExecutionException( - "There was a problem creating the EJB client archive: " + e.getMessage(), e ); - } + // create archive + clientArchiver.createArchive( session, project, archive ); - // TODO: shouldn't need classifer - if ( classifier != null ) - { - projectHelper.attachArtifact( project, "ejb-client", classifier + "-client", clientJarFile ); - } - else - { - projectHelper.attachArtifact( project, "ejb-client", "client", clientJarFile ); - } + } + catch ( ArchiverException e ) + { + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + + e.getMessage(), e ); + } + catch ( ManifestException e ) + { + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + + e.getMessage(), e ); + } + catch ( IOException e ) + { + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + + e.getMessage(), e ); + } + catch ( DependencyResolutionRequiredException e ) + { + throw new MojoExecutionException( "There was a problem creating the EJB client archive: " + + e.getMessage(), e ); + } + + // TODO: shouldn't need classifer + // TODO: For 3.0 this should be changed having a separate classifier for main artifact and ejb-client. + if ( classifier != null ) + { + projectHelper.attachArtifact( project, "ejb-client", classifier + "-client", clientJarFile ); + } + else + { + projectHelper.attachArtifact( project, "ejb-client", "client", clientJarFile ); } } + private void checkEJBVersionCompliance( File deploymentDescriptor ) + throws MojoExecutionException + { + if ( !ejbVersion.matches( "\\A[2-3]\\.[0-9]\\z" ) ) + { + throw new MojoExecutionException( "ejbVersion is not valid: " + ejbVersion + + ". Must be 2.x or 3.x (where x is a digit)" ); + } + + if ( ejbVersion.matches( "\\A2\\.[0-9]\\z" ) && !deploymentDescriptor.exists() ) + { + throw new MojoExecutionException( "Error assembling EJB: " + ejbJar + " is required for ejbVersion 2.x" ); + } + } + + private void filterDeploymentDescriptor( File deploymentDescriptor ) + throws MavenFilteringException, IOException + { + getLog().debug( "Filtering deployment descriptor." ); + MavenResourcesExecution mavenResourcesExecution = new MavenResourcesExecution(); + mavenResourcesExecution.setEscapeString( escapeString ); + List filterWrappers = + mavenFileFilter.getDefaultFilterWrappers( project, filters, escapeBackslashesInFilePath, + this.session, mavenResourcesExecution ); + + // Create a temporary file that we can copy-and-filter + File unfilteredDeploymentDescriptor = new File( sourceDirectory, ejbJar + ".unfiltered" ); + FileUtils.copyFile( deploymentDescriptor, unfilteredDeploymentDescriptor ); + mavenFileFilter.copyFile( unfilteredDeploymentDescriptor, deploymentDescriptor, true, + filterWrappers, getEncoding( unfilteredDeploymentDescriptor ) ); + // Remove the temporary file + FileUtils.forceDelete( unfilteredDeploymentDescriptor ); + } + /** * Returns the EJB Jar file to generate, based on an optional classifier. * - * @param basedir the output directory - * @param finalName the name of the ear file + * @param basedir the output directory + * @param finalName the name of the ear file * @param classifier an optional classifier * @return the EJB file to generate */ @@ -461,8 +485,16 @@ private String getEncoding( File xmlFile ) throws IOException { - XmlStreamReader xmlReader = new XmlStreamReader( xmlFile ); - return xmlReader.getEncoding(); + XmlStreamReader xmlReader = null; + try + { + xmlReader = new XmlStreamReader( xmlFile ); + return xmlReader.getEncoding(); + } + finally + { + IOUtils.closeQuietly( xmlReader ); + } } } diff -Nru maven-ejb-plugin-2.3/src/site/apt/examples/ejb-client-dependency.apt.vm maven-ejb-plugin-2.5.1/src/site/apt/examples/ejb-client-dependency.apt.vm --- maven-ejb-plugin-2.3/src/site/apt/examples/ejb-client-dependency.apt.vm 2009-08-06 12:54:25.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/apt/examples/ejb-client-dependency.apt.vm 2011-10-17 19:12:40.000000000 +0000 @@ -73,4 +73,4 @@ +------------+ - Read more about {{{generating-ejb-client.html}Generating the EJB client}}. + Read more about {{{./generating-ejb-client.html}Generating the EJB client}}. diff -Nru maven-ejb-plugin-2.3/src/site/apt/examples/filter-deployment-descriptor.apt.vm maven-ejb-plugin-2.5.1/src/site/apt/examples/filter-deployment-descriptor.apt.vm --- maven-ejb-plugin-2.3/src/site/apt/examples/filter-deployment-descriptor.apt.vm 2010-09-15 10:45:28.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/apt/examples/filter-deployment-descriptor.apt.vm 2011-10-17 19:03:44.000000000 +0000 @@ -3,7 +3,7 @@ ------ Dennis Lundberg ------ - 2010-05-26 + 2011-10-17 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -55,3 +55,6 @@ ... +-------+ + + You can read more about filtering in the + {{{http://maven.apache.org/guides/getting-started/index.html#How_do_I_filter_resource_files}Getting Started Guide}}. diff -Nru maven-ejb-plugin-2.3/src/site/apt/index.apt maven-ejb-plugin-2.5.1/src/site/apt/index.apt --- maven-ejb-plugin-2.3/src/site/apt/index.apt 2010-09-15 10:39:27.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/apt/index.apt 1970-01-01 00:00:00.000000000 +0000 @@ -1,77 +0,0 @@ - ------ - Introduction - ------ - Stephane Nicoll - - Pete Marvin King - ------ - 2010-09-15 - ------ - - ~~ Licensed to the Apache Software Foundation (ASF) under one - ~~ or more contributor license agreements. See the NOTICE file - ~~ distributed with this work for additional information - ~~ regarding copyright ownership. The ASF licenses this file - ~~ to you 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. - - ~~ NOTE: For help with the syntax of this file, see: - ~~ http://maven.apache.org/doxia/references/apt-format.html - - -Maven EJB Plugin - - This plugin generates J2EE Enterprise Javabean (EJB) file as well as the associated client jar. - -* Goals Overview - - {{{./ejb-mojo.html}ejb:ejb}} - used by Maven for projects with <<>> package type. - -* Usage - - General instructions on how to use the EJB Plugin can be found on the {{{./usage.html}usage page}}. Some more - specific use cases are described in the examples given below. Last but not least, users occasionally contribute - additional examples, tips or errata to the - {{{http://docs.codehaus.org/display/MAVENUSER/EJB+Plugin}plugin's wiki page}}. - - In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel - free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could - already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching - the {{{./mail-lists.html}mail archive}}. - - If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our - {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your - concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, - entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. - Of course, patches are welcome, too. Contributors can check out the project from our - {{{./source-repository.html}source repository}} and will find supplementary information in the - {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. - -* Examples - - To provide you with better understanding on some usages of the Maven EJB Plugin, - you can take a look into the following examples: - - * {{{./examples/filter-deployment-descriptor.html}Filter the deployment descriptor}} - - * {{{./examples/generating-ejb-client.html}Generating an EJB client}} - - * {{{./examples/ejb-client-dependency.html}Using the ejb-client as a dependency}} - - [] - -* Related Links - - * {{{http://maven.apache.org/shared/maven-archiver/index.html}How to configure the archive, including its manifest}} - - [] diff -Nru maven-ejb-plugin-2.3/src/site/apt/index.apt.vm maven-ejb-plugin-2.5.1/src/site/apt/index.apt.vm --- maven-ejb-plugin-2.3/src/site/apt/index.apt.vm 1970-01-01 00:00:00.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/apt/index.apt.vm 2013-07-22 00:04:07.000000000 +0000 @@ -0,0 +1,77 @@ + ------ + Introduction + ------ + Stephane Nicoll + + Pete Marvin King + ------ + 2013-07-22 + ------ + + ~~ Licensed to the Apache Software Foundation (ASF) under one + ~~ or more contributor license agreements. See the NOTICE file + ~~ distributed with this work for additional information + ~~ regarding copyright ownership. The ASF licenses this file + ~~ to you 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. + + ~~ NOTE: For help with the syntax of this file, see: + ~~ http://maven.apache.org/doxia/references/apt-format.html + + +${project.name} + + This plugin generates J2EE Enterprise Javabean (EJB) file as well as the associated client jar. + +* Goals Overview + + {{{./ejb-mojo.html}ejb:ejb}} - used by Maven for projects with <<>> package type. + +* Usage + + General instructions on how to use the EJB Plugin can be found on the {{{./usage.html}usage page}}. Some more + specific use cases are described in the examples given below. Last but not least, users occasionally contribute + additional examples, tips or errata to the + {{{http://docs.codehaus.org/display/MAVENUSER/EJB+Plugin}plugin's wiki page}}. + + In case you still have questions regarding the plugin's usage, please have a look at the {{{./faq.html}FAQ}} and feel + free to contact the {{{./mail-lists.html}user mailing list}}. The posts to the mailing list are archived and could + already contain the answer to your question as part of an older thread. Hence, it is also worth browsing/searching + the {{{./mail-lists.html}mail archive}}. + + If you feel like the plugin is missing a feature or has a defect, you can fill a feature request or bug report in our + {{{./issue-tracking.html}issue tracker}}. When creating a new issue, please provide a comprehensive description of your + concern. Especially for fixing bugs it is crucial that the developers can reproduce your problem. For this reason, + entire debug logs, POMs or most preferably little demo projects attached to the issue are very much appreciated. + Of course, patches are welcome, too. Contributors can check out the project from our + {{{./source-repository.html}source repository}} and will find supplementary information in the + {{{http://maven.apache.org/guides/development/guide-helping.html}guide to helping with Maven}}. + +* Examples + + To provide you with better understanding on some usages of the Maven EJB Plugin, + you can take a look into the following examples: + + * {{{./examples/filter-deployment-descriptor.html}Filter the deployment descriptor}} + + * {{{./examples/generating-ejb-client.html}Generating an EJB client}} + + * {{{./examples/ejb-client-dependency.html}Using the ejb-client as a dependency}} + + [] + +* Related Links + + * {{{http://maven.apache.org/shared/maven-archiver/index.html}How to configure the archive, including its manifest}} + + [] diff -Nru maven-ejb-plugin-2.3/src/site/apt/usage.apt.vm maven-ejb-plugin-2.5.1/src/site/apt/usage.apt.vm --- maven-ejb-plugin-2.3/src/site/apt/usage.apt.vm 2009-08-06 12:54:25.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/apt/usage.apt.vm 2012-02-01 21:45:13.000000000 +0000 @@ -5,7 +5,7 @@ Pete Marvin King ------ - 2008-07-07 + 2012-02-01 ------ ~~ Licensed to the Apache Software Foundation (ASF) under one @@ -31,15 +31,15 @@ Usage - The EJB Plugin is used to package an EJB module. There are two ways to use the EJB Plugin: + The EJB Plugin is used to package an EJB module. There are two ways to use the EJB Plugin: - * If the packaging type defined in the <<>> is <<>>, the <<>> lifecycle phase can be used + * If the packaging type defined in the <<>> is <<>>, the <<>> lifecycle phase can be used +--------------+ mvn package +--------------+ - * or using the <<>> goal + * or using the <<>> goal +--------------+ mvn ejb:ejb @@ -47,14 +47,20 @@ [] - The plugin doesn't do any EJB specific processing during the generation of the jar except for validating the existence - of an EJB deployment descriptor if the EJB version is 2.0+, but it provides the following customization: + To handle archiving this version of Maven EJB Plugin uses + {{{http://maven.apache.org/shared/maven-archiver/index.html}Maven Archiver}} ${mavenArchiverVersion}. + + To handle filtering this version of Maven EJB Plugin uses + {{{http://maven.apache.org/shared/maven-filtering/index.html}Maven Filtering}} ${mavenFilteringVersion}. + + The plugin doesn't do any EJB specific processing during the generation of the JAR except for validating the existence + of an EJB deployment descriptor if the EJB version is 2.0+, but it provides the following customization: * The EJB version to use - * {{{examples/generating-ejb-client.html}Generating and customizing an ejb-client}} + * {{{./examples/generating-ejb-client.html}Generating and customizing an ejb-client}} - <> The dependencies will not be package with the EJB jar. + <> The dependencies will not be package with the EJB JAR. * Specifying the EJB version to use diff -Nru maven-ejb-plugin-2.3/src/site/fml/faq.fml.vm maven-ejb-plugin-2.5.1/src/site/fml/faq.fml.vm --- maven-ejb-plugin-2.3/src/site/fml/faq.fml.vm 2010-03-17 19:18:05.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/fml/faq.fml.vm 2011-10-17 19:13:37.000000000 +0000 @@ -31,7 +31,7 @@

You just have to configure it: - + ... @@ -52,7 +52,7 @@ ... - +]]> Please see the Maven Archiver Reference for more information about controlling the exact format of the generated class path entries. diff -Nru maven-ejb-plugin-2.3/src/site/resources/download.cgi maven-ejb-plugin-2.5.1/src/site/resources/download.cgi --- maven-ejb-plugin-2.3/src/site/resources/download.cgi 1970-01-01 00:00:00.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/resources/download.cgi 2014-05-18 14:25:39.000000000 +0000 @@ -0,0 +1,22 @@ +#!/bin/sh +# +# Licensed to the Apache Software Foundation (ASF) under one +# or more contributor license agreements. See the NOTICE file +# distributed with this work for additional information +# regarding copyright ownership. The ASF licenses this file +# to you 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. +# +# Just call the standard mirrors.cgi script. It will use download.html +# as the input template. +exec /www/www.apache.org/dyn/mirrors/mirrors.cgi $* \ No newline at end of file diff -Nru maven-ejb-plugin-2.3/src/site/site.xml maven-ejb-plugin-2.5.1/src/site/site.xml --- maven-ejb-plugin-2.3/src/site/site.xml 2010-05-26 09:25:38.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/site.xml 2015-06-16 19:44:11.000000000 +0000 @@ -20,12 +20,40 @@ --> + + http://maven.apache.org/images/apache-maven-project.png + http://www.apache.org/ + + + + http://maven.apache.org/images/maven-logo-black-on-white.png + http://maven.apache.org/ + + + org.apache.maven.skins + maven-fluido-skin + 1.4 + + + + + true + + + + + + +

+ + + diff -Nru maven-ejb-plugin-2.3/src/site/xdoc/download.xml.vm maven-ejb-plugin-2.5.1/src/site/xdoc/download.xml.vm --- maven-ejb-plugin-2.3/src/site/xdoc/download.xml.vm 1970-01-01 00:00:00.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/site/xdoc/download.xml.vm 2014-05-14 18:42:29.000000000 +0000 @@ -0,0 +1,126 @@ + + + + + + + Download ${project.name} Source + + +
+ +

${project.name} ${project.version} is distributed in source format. Use a source archive if you intend to build + ${project.name} yourself. Otherwise, simply use the ready-made binary artifacts from central repository.

+ +

You will be prompted for a mirror - if the file is not found on yours, please be patient, as it may take 24 + hours to reach all mirrors.

+ +

In order to guard against corrupted downloads/installations, it is highly recommended to + verify the signature + of the release bundles against the public KEYS used by the Apache Maven + developers.

+ +

${project.name} is distributed under the Apache License, version 2.0.

+ +

We strongly encourage our users to configure a Maven repository mirror closer to their location, please read How to Use Mirrors for Repositories.

+ + + + +

+ [if-any logo] + + logo + + [end] + The currently selected mirror is + [preferred]. + If you encounter a problem with this mirror, + please select another mirror. + If all mirrors are failing, there are + backup + mirrors + (at the end of the mirrors list) that should be available. +

+ +
+ Other mirrors: + + +
+ +

+ You may also consult the + complete list of + mirrors. +

+ + + + + +

This is the current stable version of ${project.name}.

+ + + + + + + + + + + + + + + + + + +
LinkChecksumSignature
${project.name} ${project.version} (Source zip)maven/plugins/${project.artifactId}-${project.version}-source-release.zipmaven/plugins/${project.artifactId}-${project.version}-source-release.zip.md5maven/plugins/${project.artifactId}-${project.version}-source-release.zip.asc
+
+ + + +

Older non-recommended releases can be found on our archive site.

+ +
+
+ +
+ diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/EjbMojoTest.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/EjbMojoTest.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/EjbMojoTest.java 2009-06-07 20:22:07.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/EjbMojoTest.java 2014-12-27 23:35:16.000000000 +0000 @@ -19,6 +19,12 @@ * under the License. */ +import java.io.File; +import java.io.IOException; +import java.util.LinkedList; +import java.util.List; +import java.util.jar.JarFile; + import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.ejb.stub.MavenProjectResourcesStub; import org.apache.maven.plugin.ejb.utils.JarContentChecker; @@ -26,12 +32,6 @@ import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.FileUtils; -import java.io.File; -import java.io.IOException; -import java.util.LinkedList; -import java.util.jar.JarFile; - - /** * EJB plugin Test Case */ @@ -183,10 +183,10 @@ mojo.execute(); assertJarCreation( project, true, false ); - assertJarContent( project, new String[]{"META-INF/MANIFEST.MF", "META-INF/ejb-jar.xml", + assertJarContent( project, new String[] { "META-INF/MANIFEST.MF", "META-INF/ejb-jar.xml", "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb/AppBean.class", - "org/sample/ejb/AppCMP.class", "org/sample/ejb/AppSession.class"}, null ); + "org/sample/ejb/AppCMP.class", "org/sample/ejb/AppSession.class" }, null ); } /** @@ -220,11 +220,12 @@ mojo.execute(); assertJarCreation( project, true, true ); - assertClientJarContent( project, new String[]{"META-INF/MANIFEST.MF", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb/AppStub.class"}, - new String[]{"META-INF/ejb-jar.xml", "org/sample/ejb/AppBean.class", - "org/sample/ejb/AppCMP.class", "org/sample/ejb/AppSession.class"} ); + assertClientJarContent( project, new String[] { "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", + "org/sample/ejb/AppStub.class" }, + new String[] { "META-INF/ejb-jar.xml", "org/sample/ejb/AppBean.class", + "org/sample/ejb/AppCMP.class", "org/sample/ejb/AppSession.class" } ); } /** @@ -235,11 +236,11 @@ public void testClientJarInclusions() throws Exception { - final LinkedList inclusions = new LinkedList(); + final List inclusions = new LinkedList(); inclusions.add( "**/*Include.class" ); final MavenProjectResourcesStub project = createTestProject( "client-includes" ); - final EjbMojo mojo = lookupMojoWithSettings( project, inclusions, new LinkedList(), null ); + final EjbMojo mojo = lookupMojoWithSettings( project, inclusions, new LinkedList(), null ); // put this on the target output dir project.addFile( "META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE ); @@ -258,10 +259,12 @@ mojo.execute(); assertJarCreation( project, true, true ); - assertClientJarContent( project, new String[]{"META-INF/MANIFEST.MF", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb/AppInclude.class"}, - new String[]{"META-INF/ejb-jar.xml", "org/sample/ejb/AppExclude.class"} ); + assertClientJarContent( project, + new String[] { "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", + "org/sample/ejb/AppInclude.class" }, new String[] { "META-INF/ejb-jar.xml", + "org/sample/ejb/AppExclude.class" } ); } /** @@ -273,11 +276,11 @@ throws Exception { - final LinkedList exclusions = new LinkedList(); + final List exclusions = new LinkedList(); exclusions.add( "**/*Exclude.class" ); final MavenProjectResourcesStub project = createTestProject( "client-excludes" ); - final EjbMojo mojo = lookupMojoWithSettings( project, new LinkedList(), exclusions, null ); + final EjbMojo mojo = lookupMojoWithSettings( project, new LinkedList(), exclusions, null ); // put this on the target output dir project.addFile( "META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE ); @@ -296,14 +299,15 @@ mojo.execute(); assertJarCreation( project, true, true ); - assertClientJarContent( project, new String[]{"META-INF/MANIFEST.MF", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb/AppInclude.class"}, - new String[]{"META-INF/ejb-jar.xml", "org/sample/ejb/AppExclude.class"} ); + assertClientJarContent( project, + new String[] { "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", + "org/sample/ejb/AppInclude.class" }, new String[] { "META-INF/ejb-jar.xml", + "org/sample/ejb/AppExclude.class" } ); } - /** * Main jar exclusions test. * @@ -312,11 +316,12 @@ public void testMainJarExclusions() throws Exception { - final LinkedList exclusions = new LinkedList(); + final List exclusions = new LinkedList(); exclusions.add( "**/*Exclude.class" ); final MavenProjectResourcesStub project = createTestProject( "main-excludes" ); - final EjbMojo mojo = lookupMojoWithSettings( project, new LinkedList(), new LinkedList(), exclusions ); + final EjbMojo mojo = + lookupMojoWithSettings( project, new LinkedList(), new LinkedList(), exclusions ); // put this on the target output dir project.addFile( "META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE ); @@ -335,14 +340,15 @@ mojo.execute(); assertJarCreation( project, true, true ); - assertJarContent( project, new String[]{"META-INF/MANIFEST.MF", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb/AppInclude.class"}, - new String[]{"META-INF/ejb-jar.xml", "org/sample/ejb/AppExclude.class"} ); + assertJarContent( project, + new String[] { "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", + "org/sample/ejb/AppInclude.class" }, new String[] { "META-INF/ejb-jar.xml", + "org/sample/ejb/AppExclude.class" } ); } - /** * Client jar inclusion test with a sub-package. * @@ -351,11 +357,12 @@ public void testClientJarInclusionsWithSubPackage() throws Exception { - final LinkedList inclusions = new LinkedList(); + final List inclusions = new LinkedList(); inclusions.add( "org/sample/ejb/*.class" ); final MavenProjectResourcesStub project = createTestProject( "client-includes-subpackage" ); - final EjbMojo mojo = lookupMojoWithSettings( project, inclusions, new LinkedList(), null ); + + final EjbMojo mojo = lookupMojoWithSettings( project, inclusions, new LinkedList(), null ); // put this on the target output dir project.addFile( "META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE ); @@ -374,14 +381,14 @@ mojo.execute(); assertJarCreation( project, true, true ); - assertClientJarContent( project, new String[]{"META-INF/MANIFEST.MF", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb/App.class"}, - new String[]{"META-INF/ejb-jar.xml", "org/sample/ejb/impl/AppImpl.class", - "org/sample/ejb/impl"} ); + assertClientJarContent( project, new String[] { "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", + "org/sample/ejb/App.class" }, + new String[] { "META-INF/ejb-jar.xml", "org/sample/ejb/impl/AppImpl.class", + "org/sample/ejb/impl" } ); } - /** * Client jar exclusions test that leaves an empty package. * @@ -391,11 +398,11 @@ throws Exception { - final LinkedList exclusions = new LinkedList(); + final LinkedList exclusions = new LinkedList(); exclusions.add( "org/sample/ejb/**" ); final MavenProjectResourcesStub project = createTestProject( "client-excludes-emptypackage" ); - final EjbMojo mojo = lookupMojoWithSettings( project, new LinkedList(), exclusions, null ); + final EjbMojo mojo = lookupMojoWithSettings( project, new LinkedList(), exclusions, null ); // put this on the target output dir project.addFile( "META-INF/ejb-jar.xml", MavenProjectResourcesStub.OUTPUT_FILE ); @@ -416,18 +423,18 @@ assertJarCreation( project, true, true ); // We check that the created jar does not contain the org/sample/ejb package empty - assertClientJarContent( project, new String[]{"META-INF/MANIFEST.MF", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", - "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", "org/sample/ejb2/AppTwo.class"}, - new String[]{"META-INF/ejb-jar.xml", "org/sample/ejb/AppOne.class", - "org/sample/ejb"} ); + assertClientJarContent( project, + new String[] { "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.xml", + "META-INF/maven/org.apache.maven.test/maven-test-plugin/pom.properties", + "org/sample/ejb2/AppTwo.class" }, + new String[] { "META-INF/ejb-jar.xml", "org/sample/ejb/AppOne.class", "org/sample/ejb" } ); } /** - * Tests if the mojo throws an exception when the EJB version is < 3.0 - * and no deployment descriptor is present. The case with deployment descriptor - * present is covered by previous tests. + * Tests if the mojo throws an exception when the EJB version is < 3.0 and no deployment descriptor is present. The + * case with deployment descriptor present is covered by previous tests. * * @throws Exception if any exception occurs */ @@ -458,8 +465,7 @@ } /** - * Tests if the jar is created under EJB version 3.0 with - * deployment descriptor present. + * Tests if the jar is created under EJB version 3.0 with deployment descriptor present. * * @throws Exception if any exception occurs */ @@ -489,8 +495,7 @@ } /** - * Tests if the jar is created under EJB version 3.0 without - * deployment descriptor present. + * Tests if the jar is created under EJB version 3.0 without deployment descriptor present. * * @throws Exception if any exception occurs */ @@ -514,7 +519,6 @@ assertJarCreation( project, true, false ); } - protected EjbMojo lookupMojo() throws Exception { @@ -546,14 +550,14 @@ } - protected EjbMojo lookupMojoWithSettings( final MavenProject project, LinkedList clientIncludes, - LinkedList clientExcludes, LinkedList excludes ) + protected EjbMojo lookupMojoWithSettings( final MavenProject project, List clientIncludes, + List clientExcludes, List excludes ) throws Exception { final EjbMojo mojo = lookupMojo(); setVariableValueToObject( mojo, "project", project ); - setVariableValueToObject( mojo, "basedir", new File( project.getBuild().getDirectory() ) ); - setVariableValueToObject( mojo, "outputDirectory", new File( project.getBuild().getOutputDirectory() ) ); + setVariableValueToObject( mojo, "outputDirectory", new File( project.getBuild().getDirectory() ) ); + setVariableValueToObject( mojo, "sourceDirectory", new File( project.getBuild().getOutputDirectory() ) ); setVariableValueToObject( mojo, "jarName", DEFAULT_JAR_NAME ); setVariableValueToObject( mojo, "clientExcludes", clientExcludes ); setVariableValueToObject( mojo, "clientIncludes", clientIncludes ); @@ -565,10 +569,9 @@ protected EjbMojo lookupMojoWithDefaultSettings( final MavenProject project ) throws Exception { - return lookupMojoWithSettings( project, new LinkedList(), new LinkedList(), null ); + return lookupMojoWithSettings( project, new LinkedList(), new LinkedList(), null ); } - protected void assertJarCreation( final MavenProject project, boolean ejbJarCreated, boolean ejbClientJarCreated, String classifier ) { @@ -583,7 +586,8 @@ else { checkedJarFile = project.getBuild().getDirectory() + "/" + DEFAULT_JAR_NAME + "-" + classifier + ".jar"; - checkedClientJarFile = project.getBuild().getDirectory() + "/" + DEFAULT_JAR_NAME + "-" + classifier + "-client.jar"; + checkedClientJarFile = + project.getBuild().getDirectory() + "/" + DEFAULT_JAR_NAME + "-" + classifier + "-client.jar"; } assertEquals( "Invalid value for ejb-jar creation", ejbJarCreated, FileUtils.fileExists( checkedJarFile ) ); @@ -608,9 +612,8 @@ final JarContentChecker inclusionChecker = new JarContentChecker(); // set expected jar contents - for ( int i = 0; i < expectedFiles.length; i++ ) + for ( String expectedFile : expectedFiles ) { - String expectedFile = expectedFiles[i]; inclusionChecker.addFile( new File( expectedFile ) ); } assertTrue( inclusionChecker.isOK( new JarFile( checkedJarFile ) ) ); @@ -618,15 +621,13 @@ if ( unexpectedFiles != null ) { final JarContentChecker exclusionChecker = new JarContentChecker(); - for ( int i = 0; i < unexpectedFiles.length; i++ ) + for ( String unexpectedFile : unexpectedFiles ) { - String unexpectedFile = unexpectedFiles[i]; exclusionChecker.addFile( new File( unexpectedFile ) ); } assertFalse( exclusionChecker.isOK( new JarFile( checkedJarFile ) ) ); } - } protected void assertJarContent( final MavenProject project, final String[] expectedFiles, diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/ArtifactStub.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/ArtifactStub.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/ArtifactStub.java 2008-12-21 22:56:51.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/ArtifactStub.java 2014-08-08 15:33:39.000000000 +0000 @@ -34,7 +34,6 @@ import org.apache.maven.artifact.versioning.OverConstrainedVersionException; import org.apache.maven.artifact.versioning.VersionRange; - /** * Stub */ @@ -80,7 +79,6 @@ VersionRange versionRange; - public ArtifactStub() { type = "testtype"; @@ -277,7 +275,6 @@ resolvedVersion = version; } - public void setArtifactHandler( ArtifactHandler handler ) { @@ -325,8 +322,15 @@ return true; } - public int compareTo( Object object ) + public int compareTo( Artifact o ) { + // TODO Auto-generated method stub return 0; } + + public ArtifactMetadata getMetadata( Class arg0 ) + { + // TODO Auto-generated method stub + return null; + } } diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBasicStub.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBasicStub.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBasicStub.java 2009-06-07 20:54:14.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBasicStub.java 2014-11-24 15:20:24.000000000 +0000 @@ -71,7 +71,7 @@ artifact.populate( this ); - // this is ugly but needed to ensure that the copy constructor + // this is ugly but needed to ensure that the copy constructor // works correctly initializeParentFields(); } @@ -105,7 +105,7 @@ public File getBasedir() { - // create an isolated environment + // create an isolated environment // see setupTestEnvironment for details return new File( testRootDir ); } @@ -117,12 +117,17 @@ public String getGroupId() { - return "org.apache.maven.plugin.test"; + String groupId = getModel().getGroupId(); + if ( ( groupId == null ) && ( getModel().getParent() != null ) ) + { + groupId = getModel().getParent().getGroupId(); + } + return groupId; } public String getArtifactId() { - return "maven-resource-plugin-test#" + identifier; + return getModel().getArtifactId(); } public String getPackaging() @@ -148,7 +153,7 @@ // to prevent the MavenProject copy constructor from blowing up private void initializeParentFields() { - // the pom should be located in the isolated dummy root + // the pom should be located in the isolated dummy root super.setFile( new File( getBasedir(), "pom.xml" ) ); super.setDependencyArtifacts( new HashSet() ); super.setArtifacts( new HashSet() ); diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBuildStub.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBuildStub.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBuildStub.java 2009-06-07 20:54:14.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectBuildStub.java 2014-08-08 15:33:39.000000000 +0000 @@ -88,7 +88,7 @@ targetClassesList = new ArrayList(); dataMap = new HashMap(); setupBuild(); - + model.setBuild( build ); } @@ -150,10 +150,7 @@ } /** - * returns true if the path is relative - * and false if absolute - * also returns false if it is relative to - * the parent + * returns true if the path is relative and false if absolute also returns false if it is relative to the parent * * @param path * @return @@ -173,7 +170,7 @@ private void setupBuild() { // check getBasedir method for the exact path - // we need to recreate the dir structure in + // we need to recreate the dir structure in // an isolated environment srcDirectory = testRootDir + "/src"; buildDirectory = testRootDir + "/target"; @@ -207,7 +204,7 @@ createFiles( resourcesDirectory, testResourcesDirectory ); setupRootFiles(); - // setup target dir + // setup target dir if ( !FileUtils.fileExists( outputDirectory ) ) { FileUtils.mkdir( outputDirectory ); @@ -225,9 +222,9 @@ { File currentDirectory; - for ( int nIndex = 0; nIndex < directoryList.size(); nIndex++ ) + for ( Object aDirectoryList : directoryList ) { - currentDirectory = new File( parent, "/" + (String) directoryList.get( nIndex ) ); + currentDirectory = new File( parent, "/" + aDirectoryList ); if ( !currentDirectory.exists() ) { @@ -235,7 +232,7 @@ } // duplicate dir structure in test resources - currentDirectory = new File( testparent, "/" + (String) directoryList.get( nIndex ) ); + currentDirectory = new File( testparent, "/" + aDirectoryList ); if ( !currentDirectory.exists() ) { @@ -250,16 +247,16 @@ switch ( type ) { - case SOURCE_FILE : + case SOURCE_FILE: retVal = sourceFileList; break; - case OUTPUT_FILE : + case OUTPUT_FILE: retVal = targetClassesList; break; - case RESOURCES_FILE : + case RESOURCES_FILE: retVal = resourcesFileList; break; - case ROOT_FILE : + case ROOT_FILE: retVal = rootFileList; break; } @@ -278,9 +275,9 @@ return; } - for ( int nIndex = 0; nIndex < list.size(); nIndex++ ) + for ( Object aList : list ) { - currentFile = new File( parent, (String) list.get( nIndex ) ); + currentFile = new File( parent, (String) aList ); // create the necessary parent directories // before we create the files @@ -298,7 +295,7 @@ } catch ( IOException io ) { - //TODO: handle exception + // TODO: handle exception } } } diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectResourcesStub.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectResourcesStub.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectResourcesStub.java 2008-12-21 22:56:51.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/MavenProjectResourcesStub.java 2014-08-08 15:33:39.000000000 +0000 @@ -21,7 +21,6 @@ import org.apache.maven.model.Resource; - /** * Stub */ @@ -89,7 +88,7 @@ { Resource resource = new Resource(); - // see MavenProjectBasicStub for details + // see MavenProjectBasicStub for details // of getBasedir // setup default resources @@ -103,10 +102,10 @@ { Resource resource = new Resource(); - // see MavenProjectBasicStub for details - // of getBasedir + // see MavenProjectBasicStub for details + // of getBasedir - // setup default test resources + // setup default test resources resource.setDirectory( getBasedir().getPath() + "/src/test/resources" ); resource.setFiltering( false ); resource.setTargetPath( null ); diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/ModelStub.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/ModelStub.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/stub/ModelStub.java 2008-12-21 22:56:51.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/stub/ModelStub.java 2014-08-08 15:33:39.000000000 +0000 @@ -64,7 +64,7 @@ public Parent getParent() { - //return new Parent(); + // return new Parent(); return null; } diff -Nru maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/utils/JarContentChecker.java maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/utils/JarContentChecker.java --- maven-ejb-plugin-2.3/src/test/java/org/apache/maven/plugin/ejb/utils/JarContentChecker.java 2009-02-09 14:55:02.000000000 +0000 +++ maven-ejb-plugin-2.5.1/src/test/java/org/apache/maven/plugin/ejb/utils/JarContentChecker.java 2014-11-22 19:13:02.000000000 +0000 @@ -20,35 +20,31 @@ */ import java.io.File; -import java.io.IOException; -import java.io.InputStream; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; +import java.util.Map; +import java.util.jar.JarEntry; import java.util.jar.JarFile; -import java.util.zip.ZipEntry; /** * Jar Content Checker */ public class JarContentChecker { - private final static String FOUND = "1"; + private final static Boolean FOUND = Boolean.TRUE; - private final static String NOT_FOUND = "0"; + private final static Boolean NOT_FOUND = Boolean.FALSE; - private HashMap fileMap; + private Map fileMap; - private HashMap directoryMap; - - private HashMap dataMap; + private Map directoryMap; public JarContentChecker() { - fileMap = new HashMap(); - directoryMap = new HashMap(); - dataMap = new HashMap(); + fileMap = new HashMap(); + directoryMap = new HashMap(); } public void addDirectory( File dir ) @@ -61,13 +57,6 @@ fileMap.put( file, NOT_FOUND ); } - public void addFile( String file, String data ) - { - fileMap.put( file, NOT_FOUND ); - dataMap.put( file, data ); - } - - /** * checks whether the jar file contains the files for this checker, * files with the same file name but with different data will not @@ -78,16 +67,16 @@ */ public boolean isOK( JarFile jarFile ) { - boolean bRetVal = false; - Enumeration zipentries = jarFile.entries(); - ZipEntry entry; + boolean bRetVal; + Enumeration zipentries = jarFile.entries(); + JarEntry entry; File entryFile; resetList(); while ( zipentries.hasMoreElements() ) { - entry = (ZipEntry) zipentries.nextElement(); + entry = zipentries.nextElement(); entryFile = new File( entry.getName() ); if ( entry.isDirectory() ) @@ -102,17 +91,7 @@ } else if ( fileMap.containsKey( entryFile ) ) { - try - { - if ( checkContent( entryFile, jarFile.getInputStream( entry ) ) ) - { - fileMap.put( entryFile, FOUND ); - } - } - catch ( IOException ex ) - { - // TODO: handle exception - } + fileMap.put( entryFile, FOUND ); } } @@ -121,24 +100,11 @@ return bRetVal; } - - private boolean checkContent( File file, InputStream istream ) - { - boolean bRetVal = true; - - if ( dataMap.containsKey( file ) ) - { - // TODO: do content checking here - } - - return bRetVal; - } - private boolean checkFinalResult() { boolean bRetVal = true; - Iterator keys = fileMap.keySet().iterator(); + Iterator keys = fileMap.keySet().iterator(); while ( keys.hasNext() && bRetVal ) { @@ -163,7 +129,7 @@ private void resetList() { - Iterator keys = fileMap.keySet().iterator(); + Iterator keys = fileMap.keySet().iterator(); while ( keys.hasNext() ) {