Skip to content

Commit a44cc8a

Browse files
belingueresmichael-o
authored andcommitted
[MPIR-455] dependencies goal: add support for multi-release JARs
This closes #70
1 parent be2e4ed commit a44cc8a

File tree

13 files changed

+420
-11
lines changed

13 files changed

+420
-11
lines changed

pom.xml

+36-1
Original file line numberDiff line numberDiff line change
@@ -185,10 +185,14 @@ under the License.
185185
<version>3.4.2</version>
186186
<scope>test</scope>
187187
</dependency>
188+
<!--
189+
TODO: Correct the JAR root content entries count workaround used
190+
to generate dependencies section when MSHARED-1411 is fixed.
191+
-->
188192
<dependency>
189193
<groupId>org.apache.maven.shared</groupId>
190194
<artifactId>maven-shared-jar</artifactId>
191-
<version>3.0.0</version>
195+
<version>3.1.0</version>
192196
</dependency>
193197
<dependency>
194198
<groupId>org.apache.maven.resolver</groupId>
@@ -516,6 +520,37 @@ under the License.
516520
</goals>
517521
</configuration>
518522
</plugin>
523+
<plugin>
524+
<groupId>org.codehaus.mojo</groupId>
525+
<artifactId>mrm-maven-plugin</artifactId>
526+
<version>1.6.0</version>
527+
<configuration>
528+
<propertyName>repository.proxy.url</propertyName>
529+
<repositories>
530+
<mockRepo>
531+
<source>src/it/mrm/repository</source>
532+
<!--
533+
force to replicate the mock repo with the *actual* jar files to
534+
perform the analysis (MPIR-455)
535+
-->
536+
<cloneTo>${project.build.directory}/local-repo</cloneTo>
537+
</mockRepo>
538+
<!-- serve content installed by maven-invoker-plugin -->
539+
<localRepo>
540+
<source>${project.build.directory}/local-repo</source>
541+
</localRepo>
542+
<proxyRepo />
543+
</repositories>
544+
</configuration>
545+
<executions>
546+
<execution>
547+
<goals>
548+
<goal>start</goal>
549+
<goal>stop</goal>
550+
</goals>
551+
</execution>
552+
</executions>
553+
</plugin>
519554
</plugins>
520555
</build>
521556
</profile>

src/it/MPIR-455/invoker.properties

+20
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
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+
18+
# Remove with next major version
19+
invoker.mavenOpts = -Duser.language=en
20+
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:dependencies

src/it/MPIR-455/pom.xml

+87
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,87 @@
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"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
27+
<artifactId>MPIR-455</artifactId>
28+
<version>1.0-SNAPSHOT</version>
29+
<packaging>pom</packaging>
30+
<url>http://maven.apache.org/plugins/it/${project.artifactId}</url>
31+
32+
<properties>
33+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
34+
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
35+
</properties>
36+
37+
<dependencies>
38+
<!-- an example of a dependency with a problematic POM -->
39+
<dependency>
40+
<groupId>org.apache.maven.its.mpir-455</groupId>
41+
<artifactId>multi-release-test</artifactId>
42+
<version>0.0.1</version>
43+
<scope>test</scope>
44+
</dependency>
45+
<dependency>
46+
<groupId>org.codehaus.plexus</groupId>
47+
<artifactId>plexus-utils</artifactId>
48+
<version>4.0.0</version>
49+
</dependency>
50+
<dependency>
51+
<groupId>org.apache.maven.its.mpir-455</groupId>
52+
<artifactId>module-info-only-test</artifactId>
53+
<version>0.0.1</version>
54+
<scope>runtime</scope>
55+
</dependency>
56+
</dependencies>
57+
58+
<build>
59+
<pluginManagement>
60+
<plugins>
61+
<plugin>
62+
<groupId>org.apache.maven.plugins</groupId>
63+
<artifactId>maven-site-plugin</artifactId>
64+
<version>@sitePluginVersion@</version>
65+
</plugin>
66+
</plugins>
67+
</pluginManagement>
68+
</build>
69+
70+
<reporting>
71+
<plugins>
72+
<plugin>
73+
<groupId>org.apache.maven.plugins</groupId>
74+
<artifactId>maven-project-info-reports-plugin</artifactId>
75+
<version>@project.version@</version>
76+
<reportSets>
77+
<reportSet>
78+
<reports>
79+
<report>dependencies</report>
80+
</reports>
81+
</reportSet>
82+
</reportSets>
83+
</plugin>
84+
</plugins>
85+
</reporting>
86+
87+
</project>

src/it/MPIR-455/verify.groovy

+119
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
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+
String html = new File( basedir, 'target/site/dependencies.html' ).text.normalize()
20+
21+
def summaryLine = '''\
22+
<tr class="b">
23+
<td align="left">module-info-only-test-0.0.1.jar</td>
24+
<td align="right">3.3 kB</td>
25+
<td align="right">10</td>
26+
<td align="right">-</td>
27+
<td align="right">-</td>
28+
<td align="center">-</td>
29+
<td align="center">-</td></tr>
30+
<tr class="a">
31+
<td align="left">&#160;&#160;&#160;&#x2022; Root</td>
32+
<td align="right">-</td>
33+
<td align="right">9</td>
34+
<td align="right">0</td>
35+
<td align="right">0</td>
36+
<td align="center">-</td>
37+
<td align="center">-</td></tr>
38+
<tr class="b">
39+
<td align="left">&#160;&#160;&#160;&#x2022; Versioned</td>
40+
<td align="right">-</td>
41+
<td align="right">1</td>
42+
<td align="right">1</td>
43+
<td align="right">1</td>
44+
<td align="center">11</td>
45+
<td align="center">No</td></tr>
46+
<tr class="a">
47+
<td align="left">multi-release-test-0.0.1.jar</td>
48+
<td align="right">10.2 kB</td>
49+
<td align="right">37</td>
50+
<td align="right">-</td>
51+
<td align="right">-</td>
52+
<td align="center">-</td>
53+
<td align="center">-</td></tr>
54+
<tr class="b">
55+
<td align="left">&#160;&#160;&#160;&#x2022; Root</td>
56+
<td align="right">-</td>
57+
<td align="right">19</td>
58+
<td align="right">1</td>
59+
<td align="right">1</td>
60+
<td align="center">1.8</td>
61+
<td align="center">Yes</td></tr>
62+
<tr class="a">
63+
<td align="left">&#160;&#160;&#160;&#x2022; Versioned</td>
64+
<td align="right">-</td>
65+
<td align="right">9</td>
66+
<td align="right">1</td>
67+
<td align="right">1</td>
68+
<td align="center">9</td>
69+
<td align="center">Yes</td></tr>
70+
<tr class="b">
71+
<td align="left">&#160;&#160;&#160;&#x2022; Versioned</td>
72+
<td align="right">-</td>
73+
<td align="right">9</td>
74+
<td align="right">1</td>
75+
<td align="right">1</td>
76+
<td align="center">11</td>
77+
<td align="center">Yes</td></tr>
78+
<tr class="a">
79+
<td align="left">plexus-utils-4.0.0.jar</td>
80+
<td align="right">192.4 kB</td>
81+
<td align="right">128</td>
82+
<td align="right">-</td>
83+
<td align="right">-</td>
84+
<td align="center">-</td>
85+
<td align="center">-</td></tr>
86+
<tr class="b">
87+
<td align="left">&#160;&#160;&#160;&#x2022; Root</td>
88+
<td align="right">-</td>
89+
<td align="right">113</td>
90+
<td align="right">86</td>
91+
<td align="right">7</td>
92+
<td align="center">1.8</td>
93+
<td align="center">Yes</td></tr>
94+
<tr class="a">
95+
<td align="left">&#160;&#160;&#160;&#x2022; Versioned</td>
96+
<td align="right">-</td>
97+
<td align="right">5</td>
98+
<td align="right">1</td>
99+
<td align="right">1</td>
100+
<td align="center">9</td>
101+
<td align="center">Yes</td></tr>
102+
<tr class="b">
103+
<td align="left">&#160;&#160;&#160;&#x2022; Versioned</td>
104+
<td align="right">-</td>
105+
<td align="right">5</td>
106+
<td align="right">1</td>
107+
<td align="right">1</td>
108+
<td align="center">10</td>
109+
<td align="center">Yes</td></tr>
110+
<tr class="a">
111+
<td align="left">&#160;&#160;&#160;&#x2022; Versioned</td>
112+
<td align="right">-</td>
113+
<td align="right">5</td>
114+
<td align="right">1</td>
115+
<td align="right">1</td>
116+
<td align="center">11</td>
117+
<td align="center">Yes</td></tr>'''
118+
119+
assert html.contains( summaryLine.normalize() )
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.its.mpir-455</groupId>
27+
<artifactId>module-info-only-test</artifactId>
28+
<version>0.0.1</version>
29+
30+
<name>module-info-only-test</name>
31+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
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"
22+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
23+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
24+
<modelVersion>4.0.0</modelVersion>
25+
26+
<groupId>org.apache.maven.its.mpir-455</groupId>
27+
<artifactId>multi-release-test</artifactId>
28+
<version>0.0.1</version>
29+
<packaging>jar</packaging>
30+
31+
<name>multi-release-test</name>
32+
33+
</project>

src/it/settings.xml

+14
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,20 @@ under the License.
2828
<activeByDefault>true</activeByDefault>
2929
</activation>
3030
<repositories>
31+
<repository>
32+
<id>snapshots</id>
33+
<url>@repository.proxy.url@</url>
34+
<releases>
35+
<enabled>true</enabled>
36+
<checksumPolicy>ignore</checksumPolicy>
37+
<updatePolicy>never</updatePolicy>
38+
</releases>
39+
<snapshots>
40+
<enabled>true</enabled>
41+
<checksumPolicy>ignore</checksumPolicy>
42+
<updatePolicy>always</updatePolicy>
43+
</snapshots>
44+
</repository>
3145
<repository>
3246
<id>local.central</id>
3347
<url>@localRepositoryUrl@</url>

0 commit comments

Comments
 (0)