Index: src/test/java/org/apache/maven/plugin/jar/JarMojoIntegrationTest.java =================================================================== --- src/test/java/org/apache/maven/plugin/jar/JarMojoIntegrationTest.java (revision 0) +++ src/test/java/org/apache/maven/plugin/jar/JarMojoIntegrationTest.java (revision 0) @@ -0,0 +1,89 @@ +package org.apache.maven.plugin.jar; + +import java.io.File; +import java.util.Properties; + +/* + * Copyright 2001-2005 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. + */ + +/** + * Test for {@link JarMojo} + * + * @version $Id$ + */ +public class JarMojoIntegrationTest + extends AbstractJarPluginTestCase +{ + + protected String getGoal() + { + return "jar"; + } + /** + * Tests the normal behavior of jar-plugin. + * @throws Exception + */ + public void testMJar_30_01() + throws Exception + { + doTestProject( "mjar-30-01", null, new String[] { "default-configuration.properties", + "foo/project001/App.class", "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-30-01/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-30-01/pom.xml" } ); + } + /** + * Tests a includes. + * @throws Exception + */ + public void testMJar_30_02() + throws Exception + { + doTestProject( "mjar-30-02", null, new String[] { "service/TestInterface.class", "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-30-02/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-30-02/pom.xml" } ); + } + /** + * Tests excludes. + * @throws Exception + */ + public void testMJar_30_03() + throws Exception + { + doTestProject( "mjar-30-03", null, new String[] { "default-configuration.properties", "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-30-03/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-30-03/pom.xml" } ); + + } + + public void testMultipleJars() + throws Exception + { + String projectName = "project-004"; + File baseDir = executeMojo( projectName, new Properties() ); + + assertJarArchive( baseDir, projectName, null ); + assertArchiveContent( baseDir, projectName, null, new String[] { "service/TestInterface.class", + "service/impl/TestImplementation.class", "TestCompile1.class", "notIncluded.xml", "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-project-004/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-project-004/pom.xml" } ); + + assertJarArchive( baseDir, projectName, "service" ); + assertArchiveContent( baseDir, projectName, "service", new String[] { "service/TestInterface.class", + "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-project-004/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-project-004/pom.xml" } ); + } +} Index: src/test/java/org/apache/maven/plugin/jar/TestJarMojoIntegrationTest.java =================================================================== --- src/test/java/org/apache/maven/plugin/jar/TestJarMojoIntegrationTest.java (revision 0) +++ src/test/java/org/apache/maven/plugin/jar/TestJarMojoIntegrationTest.java (revision 0) @@ -0,0 +1,75 @@ +package org.apache.maven.plugin.jar; + +/* + * Copyright 2001-2005 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. + */ + +/** + * Test for {@link TestJarMojo} + * + * @version $Id$ + */ +public class TestJarMojoIntegrationTest + extends AbstractJarPluginTestCase +{ + + protected String getGoal() + { + return "test-jar"; + } + + /** + * Tests the normal behavior of test-jar-plugin. + * + * @throws Exception + */ + public void testMJar_80_01() + throws Exception + { + doTestProject( "mjar-80-01", "tests", new String[] { "test-default-configuration.properties", + "foo/project003/AppTest.class", "foo/project003/AppIntegrationTest.class", "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-80-01/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-80-01/pom.xml" } ); + } + + /** + * Tests includes. + * + * @throws Exception + */ + public void testMJar_80_02() + throws Exception + { + doTestProject( "mjar-80-02", "tests", new String[] { "foo/project003/AppIntegrationTest.class", + "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-80-02/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-80-02/pom.xml" } ); + } + + /** + * Tests excludes. + * + * @throws Exception + */ + public void testMJar_80_03() + throws Exception + { + doTestProject( "mjar-80-03", "tests", new String[] { "test-default-configuration.properties", + "foo/project003/AppTest.class", "foo/project003/AppIntegrationTest.class", "META-INF/MANIFEST.MF", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-80-03/pom.properties", + "META-INF/maven/org.apache.maven.plugins/maven-jar-plugin-test-mjar-80-03/pom.xml" } ); + + } +} Index: src/test/java/org/apache/maven/plugin/jar/AbstractJarPluginTestCase.java =================================================================== --- src/test/java/org/apache/maven/plugin/jar/AbstractJarPluginTestCase.java (revision 0) +++ src/test/java/org/apache/maven/plugin/jar/AbstractJarPluginTestCase.java (revision 0) @@ -0,0 +1,158 @@ +package org.apache.maven.plugin.jar; + +/* + * 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.File; +import java.io.IOException; +import java.util.Collections; +import java.util.Enumeration; +import java.util.HashSet; +import java.util.Properties; +import java.util.Set; +import java.util.jar.JarEntry; +import java.util.jar.JarFile; + +import org.apache.maven.cli.ConsoleDownloadMonitor; +import org.apache.maven.embedder.MavenEmbedder; +import org.apache.maven.embedder.MavenEmbedderConsoleLogger; +import org.apache.maven.embedder.PlexusLoggerAdapter; +import org.apache.maven.monitor.event.DefaultEventMonitor; +import org.apache.maven.monitor.event.EventMonitor; +import org.apache.maven.project.MavenProject; +import org.codehaus.plexus.PlexusTestCase; + +/** + * Base class for jar test cases. + * + * @version $Id$ + */ +public abstract class AbstractJarPluginTestCase + extends PlexusTestCase +{ + + protected final String FINAL_NAME_PREFIX = "maven-jar-plugin-test-"; + + protected final String FINAL_NAME_SUFFIX = "-99.0"; + + /** + * Execute the JAR plugin for the specified project. + * + * @param projectName the name of the project + * @param properties extra properties to be used by the embedder + * @return the base directory of the project + * @throws Exception if an error occured + */ + protected File executeMojo( final String projectName, final Properties properties ) + throws Exception + { + MavenEmbedder maven = new MavenEmbedder(); + ClassLoader classLoader = Thread.currentThread().getContextClassLoader(); + maven.setClassLoader( classLoader ); + maven.setLogger( new MavenEmbedderConsoleLogger() ); + maven.setOffline( true ); + maven.start(); + + File itbasedir = new File( getBasedir(), "target/test-classes/it/" + projectName ); + MavenProject pom = maven.readProjectWithDependencies( new File( itbasedir, "pom.xml" ) ); + + EventMonitor eventMonitor = + new DefaultEventMonitor( new PlexusLoggerAdapter( new MavenEmbedderConsoleLogger() ) ); + maven.execute( pom, Collections.singletonList( "package" ), eventMonitor, new ConsoleDownloadMonitor(), + properties, itbasedir ); + + maven.stop(); + + return itbasedir; + } + + /** + * Executes the specified projects and asserts the given artifacts. + * + * @param projectName the project to test + * @param expectedArtifacts the array of artifacts to be found in the JAR archive + * @throws Exception + */ + protected File doTestProject( final String projectName, final String classifier, final String[] expectedArtifacts ) + throws Exception + { + final File baseDir = executeMojo( projectName, new Properties() ); + assertJarArchive( baseDir, projectName, classifier ); + + assertArchiveContent( baseDir, projectName, classifier, expectedArtifacts ); + + return baseDir; + } + + protected void assertJarArchive( final File baseDir, final String projectName, final String classifier ) + { + assertTrue( "JAR archive does not exist", getJarArchive( baseDir, projectName, classifier ).exists() ); + } + + protected File getTargetDirectory( final File basedir ) + { + return new File( basedir, "target" ); + } + + protected File getJarArchive( final File baseDir, final String projectName, final String classifier ) + { + return new File( getTargetDirectory( baseDir ), buildFinalName( projectName, classifier ) + ".jar" ); + } + + protected File getJarDirectory( final File baseDir, final String projectName, final String classifier ) + { + return new File( getTargetDirectory( baseDir ), buildFinalName( projectName, classifier ) ); + } + + protected String buildFinalName( final String projectName, final String classifier ) + { + if ( classifier != null ) + { + return FINAL_NAME_PREFIX + projectName + FINAL_NAME_SUFFIX + "-" + classifier; + } + return FINAL_NAME_PREFIX + projectName + FINAL_NAME_SUFFIX; + } + + protected void assertArchiveContent( final File baseDir, final String projectName, final String classifier, + final String[] artifactNames ) + throws IOException + { + Set contents = new HashSet(); + + JarFile jar = new JarFile( getJarArchive( baseDir, projectName, classifier ) ); + Enumeration jarEntries = jar.entries(); + while ( jarEntries.hasMoreElements() ) + { + JarEntry entry = (JarEntry) jarEntries.nextElement(); + if ( !entry.isDirectory() ) + { + // Only compare files + contents.add( entry.getName() ); + } + } + + assertEquals( "Artifacts mismatch " + contents, artifactNames.length, contents.size() ); + for ( int i = 0; i < artifactNames.length; i++ ) + { + String artifactName = artifactNames[i]; + + assertTrue( "Artifact[" + artifactName + "] not found in jar archive", contents.contains( artifactName ) ); + } + } +} Index: src/test/resources/it/mjar-30-01/src/test/java/foo/project001/AppTest.java =================================================================== --- src/test/resources/it/mjar-30-01/src/test/java/foo/project001/AppTest.java (revision 0) +++ src/test/resources/it/mjar-30-01/src/test/java/foo/project001/AppTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project001; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-30-01/src/test/resources/test-default-configuration.properties =================================================================== --- src/test/resources/it/mjar-30-01/src/test/resources/test-default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-30-01/src/test/resources/test-default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-30-01/src/main/java/foo/project001/App.java =================================================================== --- src/test/resources/it/mjar-30-01/src/main/java/foo/project001/App.java (revision 0) +++ src/test/resources/it/mjar-30-01/src/main/java/foo/project001/App.java (revision 0) @@ -0,0 +1,32 @@ +package foo.project001; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Index: src/test/resources/it/mjar-30-01/src/main/resources/default-configuration.properties =================================================================== --- src/test/resources/it/mjar-30-01/src/main/resources/default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-30-01/src/main/resources/default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-30-01/pom.xml =================================================================== --- src/test/resources/it/mjar-30-01/pom.xml (revision 0) +++ src/test/resources/it/mjar-30-01/pom.xml (revision 0) @@ -0,0 +1,48 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-mjar-30-01 + 99.0 + Maven + jar + http://maven.apache.org + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + + Index: src/test/resources/it/project-004/src/main/java/service/TestInterface.java =================================================================== --- src/test/resources/it/project-004/src/main/java/service/TestInterface.java (revision 0) +++ src/test/resources/it/project-004/src/main/java/service/TestInterface.java (revision 0) @@ -0,0 +1,23 @@ +package service; +/* + * 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 interface TestInterface { + +} Index: src/test/resources/it/project-004/src/main/java/service/impl/TestImplementation.java =================================================================== --- src/test/resources/it/project-004/src/main/java/service/impl/TestImplementation.java (revision 0) +++ src/test/resources/it/project-004/src/main/java/service/impl/TestImplementation.java (revision 0) @@ -0,0 +1,23 @@ +package service.impl; +/* + * 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 TestImplementation { + +} Index: src/test/resources/it/project-004/src/main/java/TestCompile1.java =================================================================== --- src/test/resources/it/project-004/src/main/java/TestCompile1.java (revision 0) +++ src/test/resources/it/project-004/src/main/java/TestCompile1.java (revision 0) @@ -0,0 +1,29 @@ +/* + * 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 TestCompile1 +{ + + public TestCompile1() + { + + System.out.println("Woo Hoo!"); + } + +} \ No newline at end of file Index: src/test/resources/it/project-004/src/main/resources/notIncluded.xml =================================================================== --- src/test/resources/it/project-004/src/main/resources/notIncluded.xml (revision 0) +++ src/test/resources/it/project-004/src/main/resources/notIncluded.xml (revision 0) @@ -0,0 +1,22 @@ + + + \ No newline at end of file Index: src/test/resources/it/project-004/pom.xml =================================================================== --- src/test/resources/it/project-004/pom.xml (revision 0) +++ src/test/resources/it/project-004/pom.xml (revision 0) @@ -0,0 +1,54 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-project-004 + 99.0 + Maven + jar + http://maven.apache.org + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + package + + jar + + + service + + **/service/* + + + + + + + + \ No newline at end of file Index: src/test/resources/it/mjar-30-02/src/main/java/service/TestInterface.java =================================================================== --- src/test/resources/it/mjar-30-02/src/main/java/service/TestInterface.java (revision 0) +++ src/test/resources/it/mjar-30-02/src/main/java/service/TestInterface.java (revision 0) @@ -0,0 +1,31 @@ +/** + * + */ +package service; + +/* + * 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. + */ + +/** + * @author Johan Kindgren + * + */ +public interface TestInterface { + +} Index: src/test/resources/it/mjar-30-02/src/main/java/service/impl/TestImplementation.java =================================================================== --- src/test/resources/it/mjar-30-02/src/main/java/service/impl/TestImplementation.java (revision 0) +++ src/test/resources/it/mjar-30-02/src/main/java/service/impl/TestImplementation.java (revision 0) @@ -0,0 +1,28 @@ +package service.impl; + +/* + * 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. + */ + +/** + * @author Johan Kindgren + * + */ +public class TestImplementation { + +} Index: src/test/resources/it/mjar-30-02/src/main/java/TestCompile1.java =================================================================== --- src/test/resources/it/mjar-30-02/src/main/java/TestCompile1.java (revision 0) +++ src/test/resources/it/mjar-30-02/src/main/java/TestCompile1.java (revision 0) @@ -0,0 +1,29 @@ +/* + * 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 TestCompile1 +{ + + public TestCompile1() + { + + System.out.println("Woo Hoo!"); + } + +} \ No newline at end of file Index: src/test/resources/it/mjar-30-02/src/main/resources/notIncluded.xml =================================================================== --- src/test/resources/it/mjar-30-02/src/main/resources/notIncluded.xml (revision 0) +++ src/test/resources/it/mjar-30-02/src/main/resources/notIncluded.xml (revision 0) @@ -0,0 +1,22 @@ + + + \ No newline at end of file Index: src/test/resources/it/mjar-30-02/pom.xml =================================================================== --- src/test/resources/it/mjar-30-02/pom.xml (revision 0) +++ src/test/resources/it/mjar-30-02/pom.xml (revision 0) @@ -0,0 +1,44 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-mjar-30-02 + 99.0 + Maven + jar + http://maven.apache.org + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + **/service/* + + + + + + \ No newline at end of file Index: src/test/resources/it/mjar-30-03/src/test/java/foo/project003/AppTest.java =================================================================== --- src/test/resources/it/mjar-30-03/src/test/java/foo/project003/AppTest.java (revision 0) +++ src/test/resources/it/mjar-30-03/src/test/java/foo/project003/AppTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-30-03/src/test/resources/test-default-configuration.properties =================================================================== --- src/test/resources/it/mjar-30-03/src/test/resources/test-default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-30-03/src/test/resources/test-default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-30-03/src/test/resources/excluded-file.txt =================================================================== --- src/test/resources/it/mjar-30-03/src/test/resources/excluded-file.txt (revision 0) +++ src/test/resources/it/mjar-30-03/src/test/resources/excluded-file.txt (revision 0) @@ -0,0 +1 @@ +This file is excluded by the custom configuration, so shouldn't end up in the end product \ No newline at end of file Index: src/test/resources/it/mjar-30-03/src/main/java/foo/project003/App.java =================================================================== --- src/test/resources/it/mjar-30-03/src/main/java/foo/project003/App.java (revision 0) +++ src/test/resources/it/mjar-30-03/src/main/java/foo/project003/App.java (revision 0) @@ -0,0 +1,32 @@ +package foo.project003; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Index: src/test/resources/it/mjar-30-03/src/main/resources/default-configuration.properties =================================================================== --- src/test/resources/it/mjar-30-03/src/main/resources/default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-30-03/src/main/resources/default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-30-03/src/main/resources/excluded-file.txt =================================================================== --- src/test/resources/it/mjar-30-03/src/main/resources/excluded-file.txt (revision 0) +++ src/test/resources/it/mjar-30-03/src/main/resources/excluded-file.txt (revision 0) @@ -0,0 +1 @@ +This file is excluded by the custom configuration, so shouldn't end up in the end product \ No newline at end of file Index: src/test/resources/it/mjar-30-03/pom.xml =================================================================== --- src/test/resources/it/mjar-30-03/pom.xml (revision 0) +++ src/test/resources/it/mjar-30-03/pom.xml (revision 0) @@ -0,0 +1,53 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-mjar-30-03 + 99.0 + Maven + jar + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + **/*.class + **/*.txt + + + + + + Index: src/test/resources/it/mjar-80-01/src/test/java/foo/project003/AppTest.java =================================================================== --- src/test/resources/it/mjar-80-01/src/test/java/foo/project003/AppTest.java (revision 0) +++ src/test/resources/it/mjar-80-01/src/test/java/foo/project003/AppTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-80-01/src/test/java/foo/project003/AppIntegrationTest.java =================================================================== --- src/test/resources/it/mjar-80-01/src/test/java/foo/project003/AppIntegrationTest.java (revision 0) +++ src/test/resources/it/mjar-80-01/src/test/java/foo/project003/AppIntegrationTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppIntegrationTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppIntegrationTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppIntegrationTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-80-01/src/test/resources/test-default-configuration.properties =================================================================== --- src/test/resources/it/mjar-80-01/src/test/resources/test-default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-80-01/src/test/resources/test-default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-80-01/src/main/java/foo/project003/App.java =================================================================== --- src/test/resources/it/mjar-80-01/src/main/java/foo/project003/App.java (revision 0) +++ src/test/resources/it/mjar-80-01/src/main/java/foo/project003/App.java (revision 0) @@ -0,0 +1,32 @@ +package foo.project003; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Index: src/test/resources/it/mjar-80-01/src/main/resources/default-configuration.properties =================================================================== --- src/test/resources/it/mjar-80-01/src/main/resources/default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-80-01/src/main/resources/default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-80-01/src/main/resources/excluded-file.txt =================================================================== --- src/test/resources/it/mjar-80-01/src/main/resources/excluded-file.txt (revision 0) +++ src/test/resources/it/mjar-80-01/src/main/resources/excluded-file.txt (revision 0) @@ -0,0 +1 @@ +This file is excluded by the custom configuration, so shouldn't end up in the end product \ No newline at end of file Index: src/test/resources/it/mjar-80-01/pom.xml =================================================================== --- src/test/resources/it/mjar-80-01/pom.xml (revision 0) +++ src/test/resources/it/mjar-80-01/pom.xml (revision 0) @@ -0,0 +1,55 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-mjar-80-01 + 99.0 + Maven + jar + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + + test-jar + + package + + + + + + Index: src/test/resources/it/mjar-80-02/src/test/java/foo/project003/AppTest.java =================================================================== --- src/test/resources/it/mjar-80-02/src/test/java/foo/project003/AppTest.java (revision 0) +++ src/test/resources/it/mjar-80-02/src/test/java/foo/project003/AppTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-80-02/src/test/java/foo/project003/AppIntegrationTest.java =================================================================== --- src/test/resources/it/mjar-80-02/src/test/java/foo/project003/AppIntegrationTest.java (revision 0) +++ src/test/resources/it/mjar-80-02/src/test/java/foo/project003/AppIntegrationTest.java (revision 0) @@ -0,0 +1,47 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppIntegrationTest + extends TestCase +{ + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppIntegrationTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-80-02/src/test/resources/test-default-configuration.properties =================================================================== --- src/test/resources/it/mjar-80-02/src/test/resources/test-default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-80-02/src/test/resources/test-default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-80-02/src/main/java/foo/project003/App.java =================================================================== --- src/test/resources/it/mjar-80-02/src/main/java/foo/project003/App.java (revision 0) +++ src/test/resources/it/mjar-80-02/src/main/java/foo/project003/App.java (revision 0) @@ -0,0 +1,32 @@ +package foo.project003; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Index: src/test/resources/it/mjar-80-02/src/main/resources/default-configuration.properties =================================================================== --- src/test/resources/it/mjar-80-02/src/main/resources/default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-80-02/src/main/resources/default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-80-02/src/main/resources/excluded-file.txt =================================================================== --- src/test/resources/it/mjar-80-02/src/main/resources/excluded-file.txt (revision 0) +++ src/test/resources/it/mjar-80-02/src/main/resources/excluded-file.txt (revision 0) @@ -0,0 +1 @@ +This file is excluded by the custom configuration, so shouldn't end up in the end product \ No newline at end of file Index: src/test/resources/it/mjar-80-02/pom.xml =================================================================== --- src/test/resources/it/mjar-80-02/pom.xml (revision 0) +++ src/test/resources/it/mjar-80-02/pom.xml (revision 0) @@ -0,0 +1,61 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-mjar-80-02 + 99.0 + Maven + jar + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + + test-jar + + package + + + **/*IntegrationTest.class + + + + + + + + + Index: src/test/resources/it/mjar-80-03/src/test/java/foo/project003/AppTest.java =================================================================== --- src/test/resources/it/mjar-80-03/src/test/java/foo/project003/AppTest.java (revision 0) +++ src/test/resources/it/mjar-80-03/src/test/java/foo/project003/AppTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-80-03/src/test/java/foo/project003/AppIntegrationTest.java =================================================================== --- src/test/resources/it/mjar-80-03/src/test/java/foo/project003/AppIntegrationTest.java (revision 0) +++ src/test/resources/it/mjar-80-03/src/test/java/foo/project003/AppIntegrationTest.java (revision 0) @@ -0,0 +1,57 @@ +package foo.project003; + +/* + * 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 junit.framework.Test; +import junit.framework.TestCase; +import junit.framework.TestSuite; + +/** + * Unit test for simple App. + */ +public class AppIntegrationTest + extends TestCase +{ + /** + * Create the test case + * + * @param testName name of the test case + */ + public AppIntegrationTest( String testName ) + { + super( testName ); + } + + /** + * @return the suite of tests being tested + */ + public static Test suite() + { + return new TestSuite( AppIntegrationTest.class ); + } + + /** + * Rigourous Test :-) + */ + public void testApp() + { + assertTrue( true ); + } +} Index: src/test/resources/it/mjar-80-03/src/test/resources/test-default-configuration.properties =================================================================== --- src/test/resources/it/mjar-80-03/src/test/resources/test-default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-80-03/src/test/resources/test-default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-80-03/src/test/resources/excluded-file.txt =================================================================== --- src/test/resources/it/mjar-80-03/src/test/resources/excluded-file.txt (revision 0) +++ src/test/resources/it/mjar-80-03/src/test/resources/excluded-file.txt (revision 0) @@ -0,0 +1 @@ +This file is excluded by the custom configuration, so shouldn't end up in the end product \ No newline at end of file Index: src/test/resources/it/mjar-80-03/src/main/java/foo/project003/App.java =================================================================== --- src/test/resources/it/mjar-80-03/src/main/java/foo/project003/App.java (revision 0) +++ src/test/resources/it/mjar-80-03/src/main/java/foo/project003/App.java (revision 0) @@ -0,0 +1,32 @@ +package foo.project003; + +/* + * 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. + */ + +/** + * Hello world! + * + */ +public class App +{ + public static void main( String[] args ) + { + System.out.println( "Hello World!" ); + } +} Index: src/test/resources/it/mjar-80-03/src/main/resources/default-configuration.properties =================================================================== --- src/test/resources/it/mjar-80-03/src/main/resources/default-configuration.properties (revision 0) +++ src/test/resources/it/mjar-80-03/src/main/resources/default-configuration.properties (revision 0) @@ -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. Index: src/test/resources/it/mjar-80-03/src/main/resources/excluded-file.txt =================================================================== --- src/test/resources/it/mjar-80-03/src/main/resources/excluded-file.txt (revision 0) +++ src/test/resources/it/mjar-80-03/src/main/resources/excluded-file.txt (revision 0) @@ -0,0 +1 @@ +This file is excluded by the custom configuration, so shouldn't end up in the end product \ No newline at end of file Index: src/test/resources/it/mjar-80-03/pom.xml =================================================================== --- src/test/resources/it/mjar-80-03/pom.xml (revision 0) +++ src/test/resources/it/mjar-80-03/pom.xml (revision 0) @@ -0,0 +1,61 @@ + + + + + 4.0.0 + org.apache.maven.plugins + maven-jar-plugin-test-mjar-80-03 + 99.0 + Maven + jar + + + junit + junit + 3.8.1 + test + + + + + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + + + test-jar + + package + + + **/*.txt + + + + + + + + + Index: src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java =================================================================== --- src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java (revision 573953) +++ src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java (working copy) @@ -28,7 +28,7 @@ /** * Base class for creating a jar from project classes. - * + * * @author Emmanuel Venisse * @version $Id$ */ @@ -36,13 +36,27 @@ extends AbstractMojo { - private static final String[] DEFAULT_EXCLUDES = new String[]{"**/package.html"}; + private static final String[] DEFAULT_EXCLUDES = new String[] { "**/package.html" }; - private static final String[] DEFAULT_INCLUDES = new String[]{"**/**"}; + private static final String[] DEFAULT_INCLUDES = new String[] { "**/**" }; /** + * List of files to include, fileset pattern. + * + * @parameter + */ + private String[] includes; + + /** + * List of files to exclude, fileset pattern. + * + * @parameter + */ + private String[] excludes; + + /** * Directory containing the generated JAR. - * + * * @parameter expression="${project.build.directory}" * @required */ @@ -50,7 +64,7 @@ /** * Name of the generated JAR. - * + * * @parameter alias="jarName" expression="${project.build.finalName}" * @required */ @@ -58,7 +72,7 @@ /** * The Jar archiver. - * + * * @parameter expression="${component.org.codehaus.plexus.archiver.Archiver#jar}" * @required */ @@ -66,7 +80,7 @@ /** * The maven project. - * + * * @parameter expression="${project}" * @required * @readonly @@ -75,9 +89,11 @@ /** * The maven archive configuration to use. - * - * See the Javadocs for MavenArchiveConfiguration. - * + * + * See the + * Javadocs for MavenArchiveConfiguration. + * * @parameter */ private MavenArchiveConfiguration archive = new MavenArchiveConfiguration(); @@ -89,6 +105,7 @@ /** * Whether creating the archive should be forced. + * * @parameter expression="${jar.forceCreation}" default-value="false" */ private boolean forceCreation; @@ -107,7 +124,7 @@ * Overload this to produce a test-jar, for example. */ protected abstract String getClassifier(); - + /** * Overload this to produce a test-jar, for example. */ @@ -129,7 +146,7 @@ /** * Generates the JAR. - * + * * @todo Add license files in META-INF directory. */ public File createArchive() @@ -154,7 +171,7 @@ } else { - archiver.getArchiver().addDirectory( contentDirectory, DEFAULT_INCLUDES, DEFAULT_EXCLUDES ); + archiver.getArchiver().addDirectory( contentDirectory, getIncludes(), getExcludes() ); } archiver.createArchive( project, archive ); @@ -170,14 +187,14 @@ /** * Generates the JAR. - * + * * @todo Add license files in META-INF directory. */ public void execute() throws MojoExecutionException { File jarFile = createArchive(); - + String classifier = getClassifier(); if ( classifier != null ) { @@ -188,4 +205,22 @@ getProject().getArtifact().setFile( jarFile ); } } + + private String[] getIncludes() + { + if ( includes != null && includes.length > 0 ) + { + return includes; + } + return DEFAULT_INCLUDES; + } + + private String[] getExcludes() + { + if ( excludes != null && excludes.length > 0 ) + { + return excludes; + } + return DEFAULT_EXCLUDES; + } } Index: src/site/apt/usage.apt =================================================================== --- src/site/apt/usage.apt (revision 573953) +++ src/site/apt/usage.apt (working copy) @@ -88,4 +88,76 @@ mvn ... -Dmaven.jar.skip.sign=true +-----------------+ +* How to include/exclude in jar file + + Specify a list of fileset patterns to be included och excluded by adding + includes/include or excludes/exclude in your <<>>. + ++-----------------+ + + ... + jar + ... + + + ... + + org.apache.maven.plugins + maven-jar-plugin + + + **/service/* + + + + ... + + + ... + ++-----------------+ + +* How to create a second jar artifact from project + + Specify a list of fileset patterns to be included och excluded by adding + includes/include or excludes/exclude and add a classifier in your + <<>>. + + Note that the jar-plugin must be defined in a new execution, otherwise it + will replace the default use of the jar-plugin instead of adding a second + artifact. The classifier is also required to create more than one artifact. + ++-----------------+ + + ... + war + ... + + + ... + + org.apache.maven.plugins + maven-jar-plugin + + + package + + jar + + + client + + **/service/* + + + + + + ... + + + ... + ++-----------------+ + For full documentation, click {{{plugin-info.html}here}}. Index: pom.xml =================================================================== --- pom.xml (revision 573953) +++ pom.xml (working copy) @@ -1,4 +1,6 @@ - + maven-plugins org.apache.maven.plugins @@ -38,7 +40,7 @@ org.apache.maven maven-project - 2.0 + 2.0.7 org.apache.maven @@ -57,10 +59,97 @@ test - org.codehaus.plexus - plexus-utils - 1.4.1 - + org.apache.maven + maven-embedder + 2.0.4 + test + + + + + + + org.apache.maven.plugins + maven-install-plugin + 2.2 + + + it-test + pre-integration-test + + install-file + + + + ${basedir}/target/maven-jar-plugin-2.2-SNAPSHOT.jar + + org.apache.maven.plugins + maven-jar-plugin + 2.2-it-SNAPSHOT + + maven-plugin + ${basedir}/pom.xml + + + + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + **/*IntegrationTest.java + + + + + + + + integration-test + + true + + + + + org.apache.maven.plugins + maven-surefire-plugin + + + integration-test + integration-test + + test + + + + none + + + **/*IntegrationTest.java + + + + + + + + + + + + + org.apache.maven.plugins + maven-javadoc-plugin + + + org.apache.maven.plugins + maven-jxr-plugin + + + -