You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by mi...@apache.org on 2018/05/11 23:15:41 UTC

[maven-project-info-reports-plugin] branch master updated: [MPIR-362] Dependency Management report doesn't exclude system scoped dependencies

This is an automated email from the ASF dual-hosted git repository.

michaelo pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/maven-project-info-reports-plugin.git


The following commit(s) were added to refs/heads/master by this push:
     new 8b5dc3a  [MPIR-362] Dependency Management report doesn't exclude system scoped dependencies
8b5dc3a is described below

commit 8b5dc3a2058499b4dd883f8035b1a76c9d9451a3
Author: Michael Osipov <mi...@apache.org>
AuthorDate: Mon Apr 30 23:50:18 2018 +0200

    [MPIR-362] Dependency Management report doesn't exclude system scoped dependencies
    
    The upstream information about the scope never arrives at the DependencyManagementRenderer.
    Pass this information and the report is rendered correctly.
    
    IT submitted by: Roberto Benedetti <ro...@dedalus.eu>
---
 src/it/MPIR-362/pom.xml                            | 76 ++++++++++++++++++++++
 src/it/MPIR-362/src/site/site.xml                  | 31 +++++++++
 src/it/MPIR-362/verify.groovy                      | 20 ++++++
 .../renderer/DependencyManagementRenderer.java     |  4 +-
 4 files changed, 129 insertions(+), 2 deletions(-)

diff --git a/src/it/MPIR-362/pom.xml b/src/it/MPIR-362/pom.xml
new file mode 100644
index 0000000..e20fc42
--- /dev/null
+++ b/src/it/MPIR-362/pom.xml
@@ -0,0 +1,76 @@
+<?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/xsd/maven-4.0.0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+
+  <groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
+  <artifactId>MPIR-362</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+  <url>http://maven.apache.org/plugins/it/${project.artifactId}</url>
+
+  <properties>
+    <maven.compiler.source>1.7</maven.compiler.source>
+    <maven.compiler.target>1.7</maven.compiler.target>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>com.sun</groupId>
+        <artifactId>javaws</artifactId>
+        <version>${java.version}</version>
+        <scope>system</scope>
+        <systemPath>${java.home}/lib/javaws.jar</systemPath>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-site-plugin</artifactId>
+        <version>@sitePluginVersion@</version>
+      </plugin>
+    </plugins>
+  </build>
+
+  <reporting>
+    <plugins>
+      <plugin>
+        <artifactId>maven-project-info-reports-plugin</artifactId>
+        <version>@pom.version@</version>
+        <reportSets>
+          <reportSet>
+            <reports>
+              <report>dependency-management</report>
+            </reports>
+          </reportSet>
+        </reportSets>
+      </plugin>
+    </plugins>
+  </reporting>
+</project>
diff --git a/src/it/MPIR-362/src/site/site.xml b/src/it/MPIR-362/src/site/site.xml
new file mode 100644
index 0000000..962e451
--- /dev/null
+++ b/src/it/MPIR-362/src/site/site.xml
@@ -0,0 +1,31 @@
+<?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/DECORATION/1.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/DECORATION/1.0.0 http://maven.apache.org/xsd/decoration-1.0.0.xsd">
+  <publishDate position="right" />
+  <body>
+    <breadcrumbs>
+      <item name="MPIR" href="http://maven.apache.org/plugins/maven-project-info-reports-plugin/index.html" />
+    </breadcrumbs>
+    <menu ref="parent" inherit="top" />
+    <menu ref="reports" inherit="bottom" />
+  </body>
+</project>
diff --git a/src/it/MPIR-362/verify.groovy b/src/it/MPIR-362/verify.groovy
new file mode 100644
index 0000000..57686ff
--- /dev/null
+++ b/src/it/MPIR-362/verify.groovy
@@ -0,0 +1,20 @@
+/*
+ * 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.
+ */
+File log = new File( basedir, 'build.log' )
+assert !( log.text =~ /\[WARNING\] Unable to create Maven project for com\.sun:javaws:pom:.* from repository\./ )
diff --git a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
index eb6f83e..c11f6d8 100644
--- a/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
+++ b/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependencyManagementRenderer.java
@@ -212,8 +212,8 @@ public class DependencyManagementRenderer
     private String[] getDependencyRow( Dependency dependency, boolean hasClassifier )
     {
         Artifact artifact =
-            repositorySystem.createProjectArtifact( dependency.getGroupId(), dependency.getArtifactId(),
-                                                   dependency.getVersion() );
+            repositorySystem.createArtifact( dependency.getGroupId(), dependency.getArtifactId(),
+                                             dependency.getVersion(), dependency.getScope(), dependency.getType() );
 
         StringBuilder licensesBuffer = new StringBuilder();
         String url = null;

-- 
To stop receiving notification emails like this one, please contact
michaelo@apache.org.