Author: krosenvold Date: Tue Nov 11 16:02:49 2014 New Revision: 1638197 URL: http://svn.apache.org/r1638197 Log: [MASSEMBLY-583] Added testcase (fixed MASSEMBLY-726, r1637662)
Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/pom.xml maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/start.sh maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/stop.sh maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/empty.properties maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/pom.xml maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/assembly/ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/assembly/assembly.xml maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/pom.xml maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/verify.bsh Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/pom.xml?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/pom.xml (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/pom.xml Tue Nov 11 16:02:49 2014 @@ -0,0 +1,28 @@ +<!-- +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/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>mygroup</groupId> + <artifactId>project1</artifactId> + <version>0.0.1-SNAPSHOT</version> + +</project> Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/start.sh URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/start.sh?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/start.sh (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/start.sh Tue Nov 11 16:02:49 2014 @@ -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. Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/stop.sh URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/stop.sh?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/stop.sh (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/bin/stop.sh Tue Nov 11 16:02:49 2014 @@ -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. Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/empty.properties URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/empty.properties?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/empty.properties (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child1/src/main/resources/empty.properties Tue Nov 11 16:02:49 2014 @@ -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. Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/pom.xml?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/pom.xml (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/pom.xml Tue Nov 11 16:02:49 2014 @@ -0,0 +1,67 @@ +<!-- +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/xsd/maven-4.0.0.xsd"> + + <modelVersion>4.0.0</modelVersion> + <groupId>mygroup</groupId> + <artifactId>project2</artifactId> + <version>0.0.1-SNAPSHOT</version> + + <dependencies> + <dependency> + <groupId>mygroup</groupId> + <artifactId>project1</artifactId> + <version>0.0.1-SNAPSHOT</version> + <scope>runtime</scope> + </dependency> + <!-- comment-out this dependency in the second run to verify the behaviour --> + <dependency> + <groupId>log4j</groupId> + <artifactId>log4j</artifactId> + <version>1.2.16</version> + <scope>test</scope> + </dependency> + </dependencies> + + <build> + <plugins> + <plugin> + <artifactId>maven-assembly-plugin</artifactId> + <version>${testVersion}</version> + <configuration> + <descriptors> + <descriptor>src/main/assembly/assembly.xml</descriptor> + </descriptors> + </configuration> + <executions> + <execution> + <id>make-assembly</id> + <phase>package</phase> + <goals> + <goal>single</goal> + </goals> + </execution> + </executions> + </plugin> + </plugins> + </build> + +</project> Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/assembly/assembly.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/assembly/assembly.xml?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/assembly/assembly.xml (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/child2/src/main/assembly/assembly.xml Tue Nov 11 16:02:49 2014 @@ -0,0 +1,58 @@ +<!-- +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. +--> +<assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd"> + + <id>deployable</id> + + <formats> + <format>zip</format> + </formats> + + <dependencySets> + + + <dependencySet> + <outputDirectory>/</outputDirectory> + <scope>runtime</scope> + <unpack>true</unpack> + <unpackOptions> + <includes> + <include>*.properties</include> + </includes> + </unpackOptions> + <fileMode>0444</fileMode> + <directoryMode>0444</directoryMode> + </dependencySet> + + <dependencySet> + <outputDirectory>/</outputDirectory> + <scope>runtime</scope> + <unpack>true</unpack> + <unpackOptions> + <includes> + <include>bin/*</include> + </includes> + </unpackOptions> + <fileMode>0744</fileMode> + <directoryMode>0744</directoryMode> + </dependencySet> + </dependencySets> + +</assembly> Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/pom.xml URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/pom.xml?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/pom.xml (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/pom.xml Tue Nov 11 16:02:49 2014 @@ -0,0 +1,34 @@ +<!-- +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>mygroup</groupId> + <artifactId>parent</artifactId> + <version>0.0.1</version> + <packaging>pom</packaging> + + <modules> + <module>child1</module> + <module>child2</module> + </modules> + +</project> Added: maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/verify.bsh URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/verify.bsh?rev=1638197&view=auto ============================================================================== --- maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/verify.bsh (added) +++ maven/plugins/trunk/maven-assembly-plugin/src/it/projects/bugs/massembly-583/verify.bsh Tue Nov 11 16:02:49 2014 @@ -0,0 +1,57 @@ +/* + * 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.net.*; +import java.util.zip.*; + +boolean result = true; + +try +{ + File zipFile = new File( basedir, "child2/target/project2-0.0.1-SNAPSHOT-deployable.zip" ); + + if ( !zipFile.exists() || zipFile.isDirectory() ) + { + System.err.println( "zip-file is missing or a directory." ); + result = false; + } + + ZipFile zf = new ZipFile( zipFile ); + + if ( zf.getEntry( "project2-0.0.1-SNAPSHOT/empty.properties" ) == null ) + { + System.err.println( "empty.properties entry is missing." ); + result = false; + } + + if ( zf.getEntry( "project2-0.0.1-SNAPSHOT/bin/start.sh" ) == null ) + { + System.err.println( "start.sh entry is missing." ); + result = false; + } + +} +catch( IOException e ) +{ + e.printStackTrace(); + result = false; +} + +return result;