Hi Olivier, This commit seems to have broken the IT-buils. I'm not sure if this commit was an attempt to fix the problem, or just adding an IT to highlight the problem...
On 2013-02-08 16:06, [email protected] wrote: > Author: olamy > Date: Fri Feb 8 15:06:56 2013 > New Revision: 1444045 > > URL: http://svn.apache.org/r1444045 > Log: > [MJAR-162] skipIfEmpty not work for test-jar goal and empty directories > > Added: > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/ > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml (with > props) > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/ > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/ > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/ > > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java > (with props) > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh (with > props) > Modified: > > maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java > > Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml > URL: > http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml?rev=1444045&view=auto > ============================================================================== > --- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml (added) > +++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml Fri Feb 8 > 15:06:56 2013 > @@ -0,0 +1,58 @@ > +<?xml version="1.0" encoding="UTF-8"?> > +<!-- > + 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. > +--> > + > +<project xmlns="http://maven.apache.org/POM/4.0.0" > + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" > + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 > http://maven.apache.org/maven-v4_0_0.xsd"> > + <modelVersion>4.0.0</modelVersion> > + <groupId>org.apache.maven.plugins</groupId> > + <artifactId>maven-jar-plugin-test-mjar-162</artifactId> > + <version>1.0</version> > + <name>Maven</name> > + <packaging>jar</packaging> > + <description>Avoid creating jars</description> > + <dependencies> > + <dependency> > + <groupId>junit</groupId> > + <artifactId>junit</artifactId> > + <version>3.8.1</version> > + <scope>test</scope> > + </dependency> > + </dependencies> > + <build> > + <plugins> > + <plugin> > + <groupId>org.apache.maven.plugins</groupId> > + <artifactId>maven-jar-plugin</artifactId> > + <version>@pom.version@</version> > + <executions> > + <execution> > + <configuration> > + <skipIfEmpty>true</skipIfEmpty> > + </configuration> > + <goals> > + <goal>test-jar</goal> > + </goals> > + </execution> > + </executions> > + </plugin> > + </plugins> > + </build> > +</project> > > Propchange: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/pom.xml > ------------------------------------------------------------------------------ > svn:keywords = Author Date Id Revision > > Added: > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java > URL: > http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java?rev=1444045&view=auto > ============================================================================== > --- > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java > (added) > +++ > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java > Fri Feb 8 15:06:56 2013 > @@ -0,0 +1,31 @@ > + > +/* > + * 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 Foo > +{ > + public static void main( String[] args ) > + { > + System.out.println( "Hello World!" ); > + } > +} > > Propchange: > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: > maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/src/main/java/Foo.java > ------------------------------------------------------------------------------ > svn:keywords = Author Date Id Revision > > Added: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh > URL: > http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh?rev=1444045&view=auto > ============================================================================== > --- maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh (added) > +++ maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh Fri Feb > 8 15:06:56 2013 > @@ -0,0 +1,51 @@ > + > +/* > + * 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 org.codehaus.plexus.util.*; > + > +boolean result = true; > + > +try > +{ > + File target = new File( basedir, "target" ); > + if ( !target.exists() || !target.isDirectory() ) > + { > + System.err.println( "target file is missing or not a directory." ); > + return false; > + } > + > + File artifact = new File( target, > "maven-jar-plugin-test-mjar-162-1.0-tests.jar" ); > + if ( artifact.exists() ) > + { > + System.err.println( "test artifact should not exist." ); > + return false; > + } > + return true; > +} > +catch( Throwable e ) > +{ > + e.printStackTrace(); > + return false; > +} > + > +return false; > > Propchange: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh > ------------------------------------------------------------------------------ > svn:eol-style = native > > Propchange: maven/plugins/trunk/maven-jar-plugin/src/it/MJAR-162/verify.bsh > ------------------------------------------------------------------------------ > svn:keywords = Author Date Id Revision > > Modified: > maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java > URL: > http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java?rev=1444045&r1=1444044&r2=1444045&view=diff > ============================================================================== > --- > maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java > (original) > +++ > maven/plugins/trunk/maven-jar-plugin/src/main/java/org/apache/maven/plugin/jar/AbstractJarMojo.java > Fri Feb 8 15:06:56 2013 > @@ -242,7 +242,7 @@ public abstract class AbstractJarMojo > public void execute() > throws MojoExecutionException > { > - if ( skipIfEmpty && !getClassesDirectory().exists() ) > + if ( skipIfEmpty && (!getClassesDirectory().exists() || > getClassesDirectory().list().length < 1 ) ) > { > getLog().info( "Skipping packaging of the test-jar" ); > } > > -- Dennis Lundberg --------------------------------------------------------------------- To unsubscribe, e-mail: [email protected] For additional commands, e-mail: [email protected]
