You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by hb...@apache.org on 2014/12/15 00:08:39 UTC
svn commit: r1645539 - in
/maven/plugins/trunk/maven-project-info-reports-plugin/src:
it/multi-module/ it/multi-module/dep/ it/multi-module/dep/src/
it/multi-module/dep/src/main/ it/multi-module/dep/src/main/java/
it/multi-module/dep/src/main/java/org/...
Author: hboutemy
Date: Sun Dec 14 23:08:38 2014
New Revision: 1645539
URL: http://svn.apache.org/r1645539
Log:
[MPIR-322] reuse packaged artifacts when available
Added:
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml (with props)
maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy (with props)
Modified:
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java
maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml Sun Dec 14 23:08:38 2014
@@ -0,0 +1,33 @@
+<?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>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
+ <artifactId>multi-module</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>dep</artifactId>
+</project>
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java Sun Dec 14 23:08:38 2014
@@ -0,0 +1,25 @@
+package org.apache.maven.its.dep;
+
+/*
+ * 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.
+ */
+
+public class Dep
+{
+ public static final String CONSTANT = "demo";
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/dep/src/main/java/org/apache/maven/its/dep/Dep.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties Sun Dec 14 23:08:38 2014
@@ -0,0 +1,19 @@
+# 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.goals.1=clean package
+invoker.goals.2=site
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/invoker.properties
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml Sun Dec 14 23:08:38 2014
@@ -0,0 +1,41 @@
+<?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>
+
+ <parent>
+ <groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
+ <artifactId>multi-module</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </parent>
+
+ <artifactId>main</artifactId>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
+ <artifactId>dep</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ </dependency>
+ </dependencies>
+</project>
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java Sun Dec 14 23:08:38 2014
@@ -0,0 +1,27 @@
+package org.apache.maven.its.main;
+
+/*
+ * 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 org.apache.maven.its.dep.Dep;
+
+public class Main
+{
+ public static final String CONSTANT = Dep.CONSTANT;
+}
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/main/src/main/java/org/apache/maven/its/main/Main.java
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml Sun Dec 14 23:08:38 2014
@@ -0,0 +1,109 @@
+<?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>
+
+ <parent>
+ <groupId>org.apache</groupId>
+ <artifactId>apache</artifactId>
+ <version>16</version>
+ </parent>
+
+ <groupId>org.apache.maven.plugins.project-info-reports.its</groupId>
+ <artifactId>multi-module</artifactId>
+ <version>1.0-SNAPSHOT</version>
+ <packaging>pom</packaging>
+
+ <name>MPIR IT test for multi-module reports</name>
+ <description>
+ Check that reports with dependencies between modules inside a reactor are ok.
+ </description>
+ <url>http://www.apache.org/</url>
+ <inceptionYear>2005</inceptionYear>
+ <organization>
+ <name>The Apache Software Foundation</name>
+ <url>http://www.apache.org/</url>
+ </organization>
+ <licenses>
+ <license>
+ <name>Apache License, Version 2.0</name>
+ <url>http://www.apache.org/licenses/LICENSE-2.0.txt</url>
+ <distribution>repo</distribution>
+ </license>
+ </licenses>
+
+ <scm>
+ <connection>scm:svn:http://svn.apache.org/repos/asf/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom</connection>
+ <developerConnection>scm:svn:https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom</developerConnection>
+ <url>http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/full-pom</url>
+ </scm>
+ <distributionManagement>
+ <site>
+ <id>apache.website</id>
+ <url>scp://people.apache.org/www/maven.apache.org</url>
+ </site>
+ </distributionManagement>
+
+ <properties>
+ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+ </properties>
+
+ <modules>
+ <module>dep</module>
+ <module>main</module>
+ </modules>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-site-plugin</artifactId>
+ <version>@sitePluginVersion@</version>
+ <configuration>
+ <locales>en</locales>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
+
+ <reporting>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-project-info-reports-plugin</artifactId>
+ <version>@pom.version@</version>
+ <reportSets>
+ <reportSet>
+ <reports>
+ <report>index</report>
+ <report>summary</report>
+ <report>dependency-management</report>
+ <report>dependencies</report>
+ <report>dependency-convergence</report>
+ </reports>
+ </reportSet>
+ </reportSets>
+ </plugin>
+ </plugins>
+ </reporting>
+</project>
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/pom.xml
------------------------------------------------------------------------------
svn:mime-type = text/plain
Added: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy?rev=1645539&view=auto
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy (added)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy Sun Dec 14 23:08:38 2014
@@ -0,0 +1,25 @@
+/*
+ * 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 mainDependencies = new File( basedir, 'main/target/site/dependencies.html' )
+
+// Dependency File Details section should display dep-1.0-SNAPSHOT.jar packaged from previous build (package phase),
+// not dep/target/classes from current build (site phase)
+assert !mainDependencies.text.contains( '<td>dep/target/classes</td>' )
+assert mainDependencies.text.contains( '<td>dep-1.0-SNAPSHOT.jar</td>' )
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy
------------------------------------------------------------------------------
svn:eol-style = native
Propchange: maven/plugins/trunk/maven-project-info-reports-plugin/src/it/multi-module/verify.groovy
------------------------------------------------------------------------------
svn:keywords = Author Date Id Revision
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java?rev=1645539&r1=1645538&r2=1645539&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/Dependencies.java Sun Dec 14 23:08:38 2014
@@ -19,6 +19,7 @@ package org.apache.maven.report.projecti
* under the License.
*/
+import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
import java.util.HashMap;
@@ -33,6 +34,7 @@ import org.apache.maven.shared.jar.JarAn
import org.apache.maven.shared.jar.JarData;
import org.apache.maven.shared.jar.classes.JarClasses;
import org.apache.maven.shared.jar.classes.JarClassesAnalysis;
+import org.codehaus.plexus.util.StringUtils;
/**
* @version $Id$
@@ -240,7 +242,9 @@ public class Dependencies
return jarData;
}
- if ( artifact.getFile().isDirectory() )
+ File file = getFile( artifact );
+
+ if ( file.isDirectory() )
{
jarData = new JarData( artifact.getFile(), null, new ArrayList<JarEntry>() );
@@ -248,7 +252,7 @@ public class Dependencies
}
else
{
- JarAnalyzer jarAnalyzer = new JarAnalyzer( artifact.getFile() );
+ JarAnalyzer jarAnalyzer = new JarAnalyzer( file );
try
{
@@ -297,4 +301,35 @@ public class Dependencies
addAllChildrenDependencies( subdependencyNode );
}
}
+
+ /**
+ * get the artifact's file, with detection of target/classes directory with already packaged jar available.
+ *
+ * @param artifact
+ * @return
+ */
+ public File getFile( Artifact artifact )
+ {
+ File file = artifact.getFile();
+
+ if ( file.isDirectory() )
+ {
+ // MPIR-322: if target/classes directory, try target/artifactId-version[-classifier].jar
+ String filename = artifact.getArtifactId() + '-' + artifact.getVersion();
+ if ( StringUtils.isNotEmpty( artifact.getClassifier() ) )
+ {
+ filename += '-' + artifact.getClassifier();
+ }
+ filename += '.' + artifact.getType();
+
+ File jar = new File( file, "../" + filename );
+
+ if ( jar.exists() )
+ {
+ return jar;
+ }
+ }
+
+ return file;
+ }
}
Modified: maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java?rev=1645539&r1=1645538&r2=1645539&view=diff
==============================================================================
--- maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java (original)
+++ maven/plugins/trunk/maven-project-info-reports-plugin/src/main/java/org/apache/maven/report/projectinfo/dependencies/renderer/DependenciesRenderer.java Sun Dec 14 23:08:38 2014
@@ -559,7 +559,7 @@ public class DependenciesRenderer
continue;
}
- File artifactFile = artifact.getFile();
+ File artifactFile = dependencies.getFile( artifact );
totaldeps.incrementTotal( artifact.getScope() );
totaldepsize.addTotal( artifactFile.length(), artifact.getScope() );