Skip to content
This repository was archived by the owner on Jan 29, 2020. It is now read-only.

Commit 0a984f1

Browse files
committed
[maven-release-plugin] copy for tag maven-jmod-plugin-3.0.0-alpha-1
git-svn-id: https://svn.apache.org/repos/asf/maven/plugins/tags/maven-jmod-plugin-3.0.0-alpha-1@1808624 13f79535-47bb-0310-9956-ffa450edef68
2 parents fb8baba + 1de07ff commit 0a984f1

File tree

15 files changed

+544
-46
lines changed

15 files changed

+544
-46
lines changed
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
invoker.java.version = 1.9+
18+
invoker.goals.1 = clean package
19+
invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:describe -Djmodfile=target/jmods/maven-jmod-plugin-describe-base-config.jmod

src/it/describe-plain/pom.xml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
21+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
23+
>
24+
<modelVersion>4.0.0</modelVersion>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-jmod-plugin-describe-base-config</artifactId>
27+
<version>99.0</version>
28+
<name>Maven</name>
29+
<packaging>jmod</packaging>
30+
<url>http://maven.apache.org</url>
31+
<description>Test jmod describe to get the output</description>
32+
<properties>
33+
<maven.compiler.source>1.9</maven.compiler.source>
34+
<maven.compiler.target>1.9</maven.compiler.target>
35+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
</properties>
37+
<build>
38+
<pluginManagement>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-compiler-plugin</artifactId>
43+
<version>3.7.0</version>
44+
<configuration>
45+
<target>1.9</target>
46+
<source>1.9</source>
47+
</configuration>
48+
</plugin>
49+
</plugins>
50+
</pluginManagement>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-jmod-plugin</artifactId>
55+
<version>@project.version@</version>
56+
<extensions>true</extensions>
57+
</plugin>
58+
</plugins>
59+
</build>
60+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
Test configuration file which should be located in config/config.test in
21+
resulting jmod file.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
module org.apache.maven.plugins.jmod.it.first {
21+
requires java.base;
22+
exports myproject;
23+
}
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
package myproject;
2+
3+
/*
4+
* Licensed to the Apache Software Foundation (ASF) under one
5+
* or more contributor license agreements. See the NOTICE file
6+
* distributed with this work for additional information
7+
* regarding copyright ownership. The ASF licenses this file
8+
* to you under the Apache License, Version 2.0 (the
9+
* "License"); you may not use this file except in compliance
10+
* with the License. You may obtain a copy of the License at
11+
*
12+
* http://www.apache.org/licenses/LICENSE-2.0
13+
*
14+
* Unless required by applicable law or agreed to in writing,
15+
* software distributed under the License is distributed on an
16+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
17+
* KIND, either express or implied. See the License for the
18+
* specific language governing permissions and limitations
19+
* under the License.
20+
*/
21+
22+
/**
23+
* The classic Hello World App.
24+
*/
25+
public class HelloWorld {
26+
27+
/**
28+
* Main method.
29+
*
30+
* @param args Not used
31+
*/
32+
public static void main( String[] args )
33+
{
34+
System.out.println( "Hello World from JDK 9" );
35+
}
36+
}

src/it/describe-plain/verify.groovy

Lines changed: 89 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,89 @@
1+
2+
/*
3+
* Licensed to the Apache Software Foundation (ASF) under one
4+
* or more contributor license agreements. See the NOTICE file
5+
* distributed with this work for additional information
6+
* regarding copyright ownership. The ASF licenses this file
7+
* to you under the Apache License, Version 2.0 (the
8+
* "License"); you may not use this file except in compliance
9+
* with the License. You may obtain a copy of the License at
10+
*
11+
* http://www.apache.org/licenses/LICENSE-2.0
12+
*
13+
* Unless required by applicable law or agreed to in writing,
14+
* software distributed under the License is distributed on an
15+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
* KIND, either express or implied. See the License for the
17+
* specific language governing permissions and limitations
18+
* under the License.
19+
*/
20+
21+
import java.io.*;
22+
import java.util.*;
23+
import java.util.jar.*;
24+
import org.codehaus.plexus.util.*;
25+
26+
boolean result = true;
27+
28+
try {
29+
File target = new File( basedir, "target" );
30+
if ( !target.exists() || !target.isDirectory() ) {
31+
System.err.println( "target directory is missing or not a directory." );
32+
return false;
33+
}
34+
35+
File artifact = new File( target, "jmods/maven-jmod-plugin-describe-base-config.jmod" );
36+
if ( !artifact.exists() || artifact.isDirectory() ) {
37+
System.err.println( "the resulting jmod file is missing or a directory." );
38+
return false;
39+
}
40+
41+
String[] artifactNames = [
42+
"conf/config.test",
43+
"classes/module-info.class",
44+
"classes/myproject/HelloWorld.class",
45+
]
46+
47+
Set contents = new HashSet();
48+
49+
JarFile jar = new JarFile( artifact );
50+
Enumeration jarEntries = jar.entries();
51+
while ( jarEntries.hasMoreElements() ) {
52+
JarEntry entry = (JarEntry) jarEntries.nextElement();
53+
if ( !entry.isDirectory() ) {
54+
// Only compare files
55+
contents.add( entry.getName() );
56+
}
57+
}
58+
59+
if ( artifactNames.length != contents.size() ) {
60+
System.err.println( "jar content size is different from the expected content size" );
61+
return false;
62+
}
63+
64+
for ( int i = 0; i < artifactNames.length; i++ ) {
65+
String artifactName = artifactNames[i];
66+
if ( !contents.contains( artifactName ) ) {
67+
System.err.println( "Artifact[" + artifactName + "] not found in jar archive" );
68+
return false;
69+
}
70+
}
71+
72+
def buildLog = new File (basedir, "build.log")
73+
74+
if (!buildLog.text.contains("[INFO] org.apache.maven.plugins.jmod.it.first@99.0")) {
75+
return false;
76+
}
77+
if (!buildLog.text.contains("[INFO] exports myproject")) {
78+
return false;
79+
}
80+
if (!buildLog.text.contains("[INFO] requires java.base")) {
81+
return false;
82+
}
83+
}
84+
catch( Throwable e ) {
85+
e.printStackTrace();
86+
result = false;
87+
}
88+
89+
return result;

src/it/list-plain/invoker.properties

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Licensed to the Apache Software Foundation (ASF) under one
2+
# or more contributor license agreements. See the NOTICE file
3+
# distributed with this work for additional information
4+
# regarding copyright ownership. The ASF licenses this file
5+
# to you under the Apache License, Version 2.0 (the
6+
# "License"); you may not use this file except in compliance
7+
# with the License. You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing,
12+
# software distributed under the License is distributed on an
13+
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
14+
# KIND, either express or implied. See the License for the
15+
# specific language governing permissions and limitations
16+
# under the License.
17+
invoker.java.version = 1.9+
18+
invoker.goals = clean package
19+
invoker.goals.2 = ${project.groupId}:${project.artifactId}:${project.version}:list -Djmodfile=target/jmods/maven-jmod-plugin-list-base-config.jmod

src/it/list-plain/pom.xml

Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
21+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
22+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"
23+
>
24+
<modelVersion>4.0.0</modelVersion>
25+
<groupId>org.apache.maven.plugins</groupId>
26+
<artifactId>maven-jmod-plugin-list-base-config</artifactId>
27+
<version>99.0</version>
28+
<name>Maven</name>
29+
<packaging>jmod</packaging>
30+
<url>http://maven.apache.org</url>
31+
<description>Test jmod list to get the output</description>
32+
<properties>
33+
<maven.compiler.source>1.9</maven.compiler.source>
34+
<maven.compiler.target>1.9</maven.compiler.target>
35+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
36+
</properties>
37+
<build>
38+
<pluginManagement>
39+
<plugins>
40+
<plugin>
41+
<groupId>org.apache.maven.plugins</groupId>
42+
<artifactId>maven-compiler-plugin</artifactId>
43+
<version>3.7.0</version>
44+
<configuration>
45+
<target>1.9</target>
46+
<source>1.9</source>
47+
</configuration>
48+
</plugin>
49+
</plugins>
50+
</pluginManagement>
51+
<plugins>
52+
<plugin>
53+
<groupId>org.apache.maven.plugins</groupId>
54+
<artifactId>maven-jmod-plugin</artifactId>
55+
<version>@project.version@</version>
56+
<extensions>true</extensions>
57+
<executions>
58+
<execution>
59+
<id>describe-jmod</id>
60+
<goals>
61+
<goal>list</goal>
62+
</goals>
63+
<phase>package</phase>
64+
</execution>
65+
</executions>
66+
</plugin>
67+
</plugins>
68+
</build>
69+
</project>
Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
Test configuration file which should be located in config/config.test in
21+
resulting jmod file.
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
module org.apache.maven.plugins.jmod.it.first {
21+
requires java.base;
22+
exports myproject;
23+
}

0 commit comments

Comments
 (0)