Skip to content

Commit cd954cc

Browse files
committed
[MPMD-335] - Aggregate mode doesn't use additional repositories
1 parent 92434d0 commit cd954cc

File tree

7 files changed

+201
-0
lines changed

7 files changed

+201
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
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+
invoker.goals = verify
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
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+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
<parent>
25+
<groupId>org.apache.maven.plugins.pmd.it</groupId>
26+
<artifactId>mpmd335-parent</artifactId>
27+
<version>1.0.0-SNAPSHOT</version>
28+
</parent>
29+
<artifactId>mpmd335-module1</artifactId>
30+
31+
<dependencies>
32+
<dependency>
33+
<groupId>org.apache.maven.plugins.pmd.it</groupId>
34+
<artifactId>mpmd335-dependency1</artifactId>
35+
<version>1.0.0-SNAPSHOT</version>
36+
<type>pom</type>
37+
</dependency>
38+
</dependencies>
39+
</project>
40+
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
package org.example;
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+
public class Foo
24+
{
25+
26+
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
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+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
<groupId>org.apache.maven.plugins.pmd.it</groupId>
25+
<artifactId>mpmd335-parent</artifactId>
26+
<version>1.0.0-SNAPSHOT</version>
27+
<packaging>pom</packaging>
28+
29+
<properties>
30+
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
31+
</properties>
32+
33+
<modules>
34+
<module>mpmd335-module1</module>
35+
</modules>
36+
37+
<build>
38+
<plugins>
39+
<plugin>
40+
<groupId>org.apache.maven.plugins</groupId>
41+
<artifactId>maven-pmd-plugin</artifactId>
42+
<version>@project.version@</version>
43+
<configuration>
44+
<aggregate>true</aggregate>
45+
</configuration>
46+
<executions>
47+
<execution>
48+
<goals>
49+
<goal>check</goal>
50+
</goals>
51+
</execution>
52+
</executions>
53+
</plugin>
54+
</plugins>
55+
</build>
56+
57+
<repositories>
58+
<repository>
59+
<id>corp1</id>
60+
<url>file://${user.dir}/private-repo</url>
61+
</repository>
62+
</repositories>
63+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
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+
<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">
23+
<modelVersion>4.0.0</modelVersion>
24+
<groupId>org.apache.maven.plugins.pmd.it</groupId>
25+
<artifactId>mpmd335-dependency1</artifactId>
26+
<version>1.0.0-SNAPSHOT</version>
27+
<packaging>pom</packaging>
28+
</project>
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
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+
File buildLog = new File( basedir, 'build.log' )
21+
assert buildLog.exists()
22+
assert !buildLog.text.contains( 'pmd failed: org.apache.maven.reporting.MavenReportException' )
23+
assert !buildLog.text.contains( 'org.eclipse.aether.resolution.DependencyResolutionException' )
24+
assert !buildLog.text.contains( 'Could not find artifact org.apache.maven.plugins.pmd.it:mpmd335-dependency1:pom:1.0.0-SNAPSHOT' )

src/main/java/org/apache/maven/plugins/pmd/PmdReport.java

+2
Original file line numberDiff line numberDiff line change
@@ -552,6 +552,8 @@ private String determineAuxClasspath() throws MavenReportException
552552
{
553553
ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest(
554554
session.getProjectBuildingRequest() );
555+
// use any additional configured repo as well
556+
buildingRequest.getRemoteRepositories().addAll( localProject.getRemoteArtifactRepositories() );
555557

556558
Iterable<ArtifactResult> resolvedDependencies = dependencyResolver.resolveDependencies(
557559
buildingRequest, localProject.getDependencies(), null, filter );

0 commit comments

Comments
 (0)