You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by kh...@apache.org on 2017/09/16 16:39:17 UTC
svn commit: r1808568 - in /maven/plugins/trunk/maven-jmod-plugin/src/it:
base-config-cmds/ base-config-headerfiles/ base-config-legalnotices/
base-config-libs/ base-config/ base-it/ describe-base-config/
describe-base-config/src/ describe-base-config/s...
Author: khmarbaise
Date: Sat Sep 16 16:39:16 2017
New Revision: 1808568
URL: http://svn.apache.org/viewvc?rev=1808568&view=rev
Log:
o Added IT for describe and list goal.
o Reformatted groovy code.
Added:
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/invoker.properties
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/pom.xml
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/configs/
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/configs/config.test
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/module-info.java
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/myproject/
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/myproject/HelloWorld.java
maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/invoker.properties
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/pom.xml
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/configs/
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/configs/config.test
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/module-info.java
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/myproject/
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/myproject/HelloWorld.java
maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/verify.groovy
Modified:
maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-cmds/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-headerfiles/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-legalnotices/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-libs/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/base-config/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/base-it/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-cmds/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-headerfiles/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-legalnotices/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-libs/verify.groovy
maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config/verify.groovy
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-cmds/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-cmds/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-cmds/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-cmds/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,61 +25,51 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-base-config-cmds.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "bin/first.sh",
- "conf/config.test",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "bin/first.sh",
+ "conf/config.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-headerfiles/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-headerfiles/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-headerfiles/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-headerfiles/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,62 +25,52 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-base-config-headerfiles.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "include/first.h",
- "bin/first.sh",
- "conf/config.test",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "include/first.h",
+ "bin/first.sh",
+ "conf/config.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-legalnotices/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-legalnotices/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-legalnotices/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-legalnotices/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,60 +25,50 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-base-config-legalnotices.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "legal/first.md",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "legal/first.md",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-libs/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-libs/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-libs/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/base-config-libs/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,60 +25,50 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-base-config-libs.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "lib/first.so",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "lib/first.so",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/base-config/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/base-config/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/base-config/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/base-config/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,60 +25,50 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-base-config.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "conf/config.test",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "conf/config.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/base-it/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/base-it/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/base-it/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/base-it/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,59 +25,49 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-base-it.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/invoker.properties?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/invoker.properties (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/invoker.properties Sat Sep 16 16:39:16 2017
@@ -0,0 +1,18 @@
+# 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.
+invoker.java.version = 1.9+
+invoker.goals = clean package
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/pom.xml?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/pom.xml (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/pom.xml Sat Sep 16 16:39:16 2017
@@ -0,0 +1,69 @@
+<?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-jmod-plugin-describe-base-config</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jmod</packaging>
+ <url>http://maven.apache.org</url>
+ <description>Test jmod describe to get the output</description>
+ <properties>
+ <maven.compiler.source>1.9</maven.compiler.source>
+ <maven.compiler.target>1.9</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <target>1.9</target>
+ <source>1.9</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jmod-plugin</artifactId>
+ <version>@project.version@</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>describe-jmod</id>
+ <goals>
+ <goal>describe</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/configs/config.test
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/configs/config.test?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/configs/config.test (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/configs/config.test Sat Sep 16 16:39:16 2017
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/module-info.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/module-info.java?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/module-info.java (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/module-info.java Sat Sep 16 16:39:16 2017
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+module org.apache.maven.plugins.jmod.it.first {
+ requires java.base;
+ exports myproject;
+}
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/myproject/HelloWorld.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/myproject/HelloWorld.java?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/myproject/HelloWorld.java (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/src/main/java/myproject/HelloWorld.java Sat Sep 16 16:39:16 2017
@@ -0,0 +1,36 @@
+package myproject;
+
+/*
+ * 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.
+ */
+
+/**
+ * The classic Hello World App.
+ */
+public class HelloWorld {
+
+ /**
+ * Main method.
+ *
+ * @param args Not used
+ */
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World from JDK 9" );
+ }
+}
\ No newline at end of file
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/verify.groovy?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/verify.groovy (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/describe-base-config/verify.groovy Sat Sep 16 16:39:16 2017
@@ -0,0 +1,89 @@
+
+/*
+ * 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 directory is missing or not a directory." );
+ return false;
+ }
+
+ File artifact = new File( target, "jmods/maven-jmod-plugin-describe-base-config.jmod" );
+ if ( !artifact.exists() || artifact.isDirectory() ) {
+ System.err.println( "the resulting jmod file is missing or a directory." );
+ return false;
+ }
+
+ String[] artifactNames = [
+ "conf/config.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
+ ]
+
+ Set contents = new HashSet();
+
+ JarFile jar = new JarFile( artifact );
+ Enumeration jarEntries = jar.entries();
+ while ( jarEntries.hasMoreElements() ) {
+ JarEntry entry = (JarEntry) jarEntries.nextElement();
+ if ( !entry.isDirectory() ) {
+ // Only compare files
+ contents.add( entry.getName() );
+ }
+ }
+
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
+ }
+
+ for ( int i = 0; i < artifactNames.length; i++ ) {
+ String artifactName = artifactNames[i];
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
+ }
+ }
+
+ def buildLog = new File (basedir, "build.log")
+
+ if (!buildLog.text.contains("[INFO] org.apache.maven.plugins.jmod.it.first@99.0")) {
+ return false;
+ }
+ if (!buildLog.text.contains("[INFO] exports myproject")) {
+ return false;
+ }
+ if (!buildLog.text.contains("[INFO] requires java.base")) {
+ return false;
+ }
+}
+catch( Throwable e ) {
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/invoker.properties?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/invoker.properties (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/invoker.properties Sat Sep 16 16:39:16 2017
@@ -0,0 +1,18 @@
+# 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.
+invoker.java.version = 1.9+
+invoker.goals = clean package
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/pom.xml?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/pom.xml (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/pom.xml Sat Sep 16 16:39:16 2017
@@ -0,0 +1,69 @@
+<?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-jmod-plugin-list-base-config</artifactId>
+ <version>99.0</version>
+ <name>Maven</name>
+ <packaging>jmod</packaging>
+ <url>http://maven.apache.org</url>
+ <description>Test jmod list to get the output</description>
+ <properties>
+ <maven.compiler.source>1.9</maven.compiler.source>
+ <maven.compiler.target>1.9</maven.compiler.target>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+ <build>
+ <pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-compiler-plugin</artifactId>
+ <version>3.7.0</version>
+ <configuration>
+ <target>1.9</target>
+ <source>1.9</source>
+ </configuration>
+ </plugin>
+ </plugins>
+ </pluginManagement>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-jmod-plugin</artifactId>
+ <version>@project.version@</version>
+ <extensions>true</extensions>
+ <executions>
+ <execution>
+ <id>describe-jmod</id>
+ <goals>
+ <goal>list</goal>
+ </goals>
+ <phase>package</phase>
+ </execution>
+ </executions>
+ </plugin>
+ </plugins>
+ </build>
+</project>
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/configs/config.test
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/configs/config.test?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/configs/config.test (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/configs/config.test Sat Sep 16 16:39:16 2017
@@ -0,0 +1,21 @@
+/*
+ * 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.
+ */
+
+Test configuration file which should be located in config/config.test in
+resulting jmod file.
\ No newline at end of file
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/module-info.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/module-info.java?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/module-info.java (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/module-info.java Sat Sep 16 16:39:16 2017
@@ -0,0 +1,23 @@
+/*
+ * 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.
+ */
+
+module org.apache.maven.plugins.jmod.it.first {
+ requires java.base;
+ exports myproject;
+}
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/myproject/HelloWorld.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/myproject/HelloWorld.java?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/myproject/HelloWorld.java (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/src/main/java/myproject/HelloWorld.java Sat Sep 16 16:39:16 2017
@@ -0,0 +1,36 @@
+package myproject;
+
+/*
+ * 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.
+ */
+
+/**
+ * The classic Hello World App.
+ */
+public class HelloWorld {
+
+ /**
+ * Main method.
+ *
+ * @param args Not used
+ */
+ public static void main( String[] args )
+ {
+ System.out.println( "Hello World from JDK 9" );
+ }
+}
\ No newline at end of file
Added: maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/verify.groovy?rev=1808568&view=auto
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/verify.groovy (added)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/list-base-config/verify.groovy Sat Sep 16 16:39:16 2017
@@ -0,0 +1,89 @@
+
+/*
+ * 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 directory is missing or not a directory." );
+ return false;
+ }
+
+ File artifact = new File( target, "jmods/maven-jmod-plugin-list-base-config.jmod" );
+ if ( !artifact.exists() || artifact.isDirectory() ) {
+ System.err.println( "the resulting jmod file is missing or a directory." );
+ return false;
+ }
+
+ String[] artifactNames = [
+ "conf/config.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
+ ]
+
+ Set contents = new HashSet();
+
+ JarFile jar = new JarFile( artifact );
+ Enumeration jarEntries = jar.entries();
+ while ( jarEntries.hasMoreElements() ) {
+ JarEntry entry = (JarEntry) jarEntries.nextElement();
+ if ( !entry.isDirectory() ) {
+ // Only compare files
+ contents.add( entry.getName() );
+ }
+ }
+
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
+ }
+
+ for ( int i = 0; i < artifactNames.length; i++ ) {
+ String artifactName = artifactNames[i];
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
+ }
+ }
+
+ def buildLog = new File (basedir, "build.log")
+
+ if (!buildLog.text.contains("[INFO] classes/module-info.class")) {
+ return false;
+ }
+ if (!buildLog.text.contains("[INFO] classes/myproject/HelloWorld.class")) {
+ return false;
+ }
+ if (!buildLog.text.contains("[INFO] conf/config.test")) {
+ return false;
+ }
+}
+catch( Throwable e ) {
+ e.printStackTrace();
+ result = false;
+}
+
+return result;
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-cmds/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-cmds/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-cmds/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-cmds/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,61 +25,51 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-non-default-config-cmds.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "bin/non-default-first.sh",
- "bin/non-default-sub-first.sh",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "bin/non-default-first.sh",
+ "bin/non-default-sub-first.sh",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-headerfiles/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-headerfiles/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-headerfiles/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-headerfiles/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,62 +25,52 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-non-default-config-headerfiles.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "include/non-first.h",
- "bin/first.sh",
- "conf/config.test",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "include/non-first.h",
+ "bin/first.sh",
+ "conf/config.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-legalnotices/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-legalnotices/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-legalnotices/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-legalnotices/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,60 +25,50 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-non-default-config-legalnotices.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "legal/non-first.md",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "legal/non-first.md",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-libs/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-libs/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-libs/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config-libs/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,60 +25,50 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-non-default-config-libs.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "lib/non-first.so",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "lib/non-first.so",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}
Modified: maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config/verify.groovy?rev=1808568&r1=1808567&r2=1808568&view=diff
==============================================================================
--- maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config/verify.groovy (original)
+++ maven/plugins/trunk/maven-jmod-plugin/src/it/non-default-config/verify.groovy Sat Sep 16 16:39:16 2017
@@ -25,61 +25,51 @@ import org.codehaus.plexus.util.*;
boolean result = true;
-try
-{
+try {
File target = new File( basedir, "target" );
- if ( !target.exists() || !target.isDirectory() )
- {
+ if ( !target.exists() || !target.isDirectory() ) {
System.err.println( "target file is missing or not a directory." );
return false;
}
File artifact = new File( target, "jmods/maven-jmod-plugin-non-default-config.jmod" );
- if ( !artifact.exists() || artifact.isDirectory() )
- {
+ if ( !artifact.exists() || artifact.isDirectory() ) {
System.err.println( "target file is missing or a directory." );
return false;
}
String[] artifactNames = [
- "conf/config.test",
- "conf/config-sub.test",
- "classes/module-info.class",
- "classes/myproject/HelloWorld.class",
+ "conf/config.test",
+ "conf/config-sub.test",
+ "classes/module-info.class",
+ "classes/myproject/HelloWorld.class",
]
Set contents = new HashSet();
JarFile jar = new JarFile( artifact );
Enumeration jarEntries = jar.entries();
- while ( jarEntries.hasMoreElements() )
- {
+ while ( jarEntries.hasMoreElements() ) {
JarEntry entry = (JarEntry) jarEntries.nextElement();
- if ( !entry.isDirectory() )
- {
+ if ( !entry.isDirectory() ) {
// Only compare files
contents.add( entry.getName() );
}
}
- if ( artifactNames.length != contents.size() )
- {
- System.err.println( "jar content size is different from the expected content size" );
- return false;
+ if ( artifactNames.length != contents.size() ) {
+ System.err.println( "jar content size is different from the expected content size" );
+ return false;
}
- for ( int i = 0; i < artifactNames.length; i++ )
- {
+ for ( int i = 0; i < artifactNames.length; i++ ) {
String artifactName = artifactNames[i];
- if ( !contents.contains( artifactName ) )
- {
- System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
- return false;
+ if ( !contents.contains( artifactName ) ) {
+ System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
+ return false;
}
}
-
}
-catch( Throwable e )
-{
+catch( Throwable e ) {
e.printStackTrace();
result = false;
}