You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by jv...@apache.org on 2014/05/17 16:33:41 UTC

svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Author: jvanzyl
Date: Sat May 17 14:33:40 2014
New Revision: 1595491

URL: http://svn.apache.org/r1595491
Log:
MSHARED-336: Added an overloaded method to DependencyGraphBuilder that accepts the reactor projects and resolves dependencies from within the reactor.
- Added multi-module-test to validate that the new method works against both direct and transitive deps.
- Added multi-module-plugin to be used to validate multi-module-test
- Added ProjectReferenceKeyGenerator as there is currently no public method to generate the key for MavenProject#projectReferences, MavenSession#projectMap or the Map of reactor projects that we will use.
- Separated the reflective invocation out into the Invoker class.
- Made maven-project dependency scope=provided as at runtime we want the version in the maven install, not 2.2.0
Submitted by: William Ferguson <wi...@xandar.com.au>


Added:
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/pom.xml
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/plexus/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/plexus/components.xml
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/DummyMojo.java
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/expected-tree.txt
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/invoker.properties
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/pom.xml
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/dependency/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/dependency/SimpleClass.java
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/pom.xml
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/DependentClass.java
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/pom.xml
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/ContainingClass.java
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/pom.xml
    maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/verify.bsh
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/ProjectReferenceKeyGenerator.java
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Invoker.java
Modified:
    maven/shared/trunk/maven-dependency-tree/pom.xml
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/DependencyGraphBuilder.java
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven2DependencyGraphBuilder.java
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyGraphBuilder.java
    maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java

Modified: maven/shared/trunk/maven-dependency-tree/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/pom.xml?rev=1595491&r1=1595490&r2=1595491&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/pom.xml (original)
+++ maven/shared/trunk/maven-dependency-tree/pom.xml Sat May 17 14:33:40 2014
@@ -64,6 +64,7 @@
       <groupId>org.apache.maven</groupId>
       <artifactId>maven-project</artifactId>
       <version>${mavenVersion}</version>
+      <scope>provided</scope>
     </dependency>
     <dependency>
       <groupId>org.apache.maven</groupId>
@@ -145,10 +146,15 @@
           <postBuildHookScript>verify</postBuildHookScript>
           <localRepositoryPath>${project.build.directory}/local-repo</localRepositoryPath>
           <settingsFile>src/it/settings.xml</settingsFile>
+          <goals>
+            <goal>install</goal> <!-- So that the multi-module-plugin is installed into the integration-test repo -->
+          </goals>
           <pomIncludes>
-            <pomInclude>*/pom.xml</pomInclude>
+            <!--pomInclude>*/pom.xml</pomInclude-->
             <pomInclude>maven-version/pom.xml</pomInclude>
             <pomInclude>mshared-167/pom.xml</pomInclude>
+            <pomInclude>multi-module-plugin/pom.xml</pomInclude>
+            <pomInclude>multi-module-test/pom.xml</pomInclude>
           </pomIncludes>
         </configuration>
         <executions>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/pom.xml?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/pom.xml (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/pom.xml Sat May 17 14:33:40 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>
+
+  <groupId>org.apache.maven.its.dependency-tree</groupId>
+  <artifactId>multi-module-test-plugin</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>maven-plugin</packaging>
+
+  <name>Multi-Module Test-Plugin</name>
+  <description>
+    Creates a maven-plugin that can be used to verify that maven-dep-tree resolves deps that only exist within the reactor.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+    <maven.version>3.0.4</maven.version>
+  </properties>
+
+  <dependencyManagement>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <version>${maven.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-artifact</artifactId>
+      <version>${maven.version}</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-plugin-api</artifactId>
+      <version>${maven.version}</version>
+      <scope>provided</scope>
+    </dependency>
+<!--
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-project</artifactId>
+      <version>${maven.version}</version>
+    </dependency>
+-->
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <version>1.0-alpha-9-stable-1</version>
+      <scope>provided</scope>
+    </dependency>
+    <dependency>
+      <groupId>org.apache.maven.shared</groupId>
+      <artifactId>maven-dependency-tree</artifactId>
+      <version>2.2-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <pluginManagement>
+      <plugins>
+        <plugin>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-component-metadata</artifactId>
+          <version>1.5.5</version>
+        </plugin>
+      </plugins>
+    </pluginManagement>
+
+    <plugins>
+      <plugin>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-metadata</artifactId>
+        <executions>
+          <execution>
+            <goals>
+              <goal>generate-metadata</goal>
+              <goal>generate-test-metadata</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/plexus/components.xml?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/plexus/components.xml (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/resources/META-INF/plexus/components.xml Sat May 17 14:33:40 2014
@@ -0,0 +1,20 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (C) 2009 Jayway AB
+ Copyright (C) 2007-2008 JVending Masa
+
+  Licensed 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.
+-->
+<component-set>
+    <components></components>
+</component-set>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/DummyMojo.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/DummyMojo.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/DummyMojo.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/DummyMojo.java Sat May 17 14:33:40 2014
@@ -0,0 +1,34 @@
+package org.apache.maven.its.deptree;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Does absolutely nothing.
+ *
+ * @goal dummy
+ * @phase package
+ * @requiresDependencyResolution compile
+ */
+public class DummyMojo extends AbstractMojo
+{
+    /**
+     * The maven project.
+     *
+     * @parameter property="${project}"
+     * @required
+     * @readonly
+     */
+    private MavenProject project;
+
+    /**
+     * @throws MojoExecutionException
+     * @throws MojoFailureException
+     */
+    public void execute() throws MojoExecutionException, MojoFailureException
+    {
+        getLog().info( "Running DummyMojo : " + project.getArtifactId() );
+    }
+}

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java Sat May 17 14:33:40 2014
@@ -0,0 +1,87 @@
+/*******************************************************************************
+ * Copyright (c) 2008, 2011 Sonatype Inc. and others.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *
+ * Contributors:
+ *    Sonatype Inc. - initial API and implementation
+ *******************************************************************************/
+package org.apache.maven.its.deptree;
+
+import org.apache.maven.AbstractMavenLifecycleParticipant;
+import org.apache.maven.MavenExecutionException;
+import org.apache.maven.execution.MavenSession;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
+import org.apache.maven.shared.dependency.graph.ProjectReferenceKeyGenerator;
+import org.codehaus.plexus.component.annotations.Component;
+import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.logging.Logger;
+
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * Resolves all the dependencies in the project immediately after the Project has been read.
+ *
+ * It needs to resolve dependencies from the reactor because in a multi-module build
+ * sibling modules may never have been built yet, so will not exist in any repo.
+ *
+ * It is crucial that reactor dependencies can be found at this point in the build because
+ * this is the only time at which we can modify the classpath. And for modules that produce
+ * archives (eg Android AAR) which contain the actual Java Jar dependency, we need to know
+ * that they exist so that we can add a placeholder for them onto the classpath,
+ * which we can replace with the real classes once they are built.
+ */
+@Component( role = AbstractMavenLifecycleParticipant.class, hint = "default" )
+public final class ResolveDependenciesLifecycleParticipant extends AbstractMavenLifecycleParticipant
+{
+    @Requirement( hint = "default" )
+    private DependencyGraphBuilder dependencyGraphBuilder;
+
+    @Requirement
+    private Logger log;
+
+    @Override
+    public void afterProjectsRead( MavenSession session ) throws MavenExecutionException
+    {
+        log.debug( "" );
+        log.info( "ResolveDependenciesLifecycleParticipant#afterProjectsRead" );
+        log.debug( "" );
+
+        final List<MavenProject> projects = session.getProjects();
+
+        // NB We could get this from session.getProjectMap() but it doesn't exist in Maven-2.2.1 or 3.0.4
+        final Map<String, MavenProject> reactorProjects = new HashMap<String, MavenProject>();
+        final ProjectReferenceKeyGenerator keyGenerator = new ProjectReferenceKeyGenerator();
+
+        log.debug( "Reactor projects:" );
+        for ( MavenProject project : projects )
+        {
+            log.debug( " - " + project );
+            reactorProjects.put( keyGenerator.getProjectReferenceKey( project ), project );
+        }
+        log.debug( "" );
+
+        for ( MavenProject project : projects )
+        {
+            log.debug( "" );
+            log.debug( "project=" + project.getArtifact() );
+
+            try
+            {
+                // No need to filter our search. We want to resolve all artifacts.
+                dependencyGraphBuilder.buildDependencyGraph( project, null, reactorProjects );
+            }
+            catch ( DependencyGraphBuilderException e )
+            {
+                throw new MavenExecutionException( "Could not resolve dependencies for project : " + project, e );
+            }
+        }
+    }
+}
+  

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/expected-tree.txt
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/expected-tree.txt?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/expected-tree.txt (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/expected-tree.txt Sat May 17 14:33:40 2014
@@ -0,0 +1,3 @@
+org.apache.maven.its.dependency-tree:module-z-deps-y:jar:1.0-SNAPSHOT
+\- org.apache.maven.its.dependency-tree:module-y-deps-x:jar:1.0-SNAPSHOT:compile
+   \- org.apache.maven.its.dependency-tree:module-x:jar:1.0-SNAPSHOT:compile

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/invoker.properties
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/invoker.properties?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/invoker.properties (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/invoker.properties Sat May 17 14:33:40 2014
@@ -0,0 +1 @@
+invoker.goals = clean install

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/pom.xml?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/pom.xml (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/pom.xml Sat May 17 14:33:40 2014
@@ -0,0 +1,42 @@
+<?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.its.dependency-tree</groupId>
+  <artifactId>module-x</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencyManagement>
+  </dependencyManagement>
+
+  <dependencies>
+  </dependencies>
+
+  <build>
+  </build>
+</project>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/dependency/SimpleClass.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/dependency/SimpleClass.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/dependency/SimpleClass.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleX/src/main/java/org/apache/maven/shared/dependency/SimpleClass.java Sat May 17 14:33:40 2014
@@ -0,0 +1,9 @@
+package org.apache.maven.shared.dependency;
+
+public final class SimpleClass
+{
+    public String someMethod()
+    {
+        return "fun";
+    }
+}

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/pom.xml?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/pom.xml (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/pom.xml Sat May 17 14:33:40 2014
@@ -0,0 +1,86 @@
+<?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.its.dependency-tree</groupId>
+  <artifactId>module-y-deps-x</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.maven.its.dependency-tree</groupId>
+        <artifactId>module-x</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.dependency-tree</groupId>
+      <artifactId>module-x</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <dependencies>
+          <dependency>
+            <groupId>@project.groupId@</groupId>
+            <artifactId>@project.artifactId@</artifactId>
+            <version>@project.version@</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>default</id>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/tree.txt</outputFile>
+            </configuration>
+            <goals>
+              <goal>tree</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.its.dependency-tree</groupId>
+        <artifactId>multi-module-test-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <extensions>true</extensions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/DependentClass.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/DependentClass.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/DependentClass.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/DependentClass.java Sat May 17 14:33:40 2014
@@ -0,0 +1,10 @@
+package org.apache.maven.shared.dependency;
+
+public final class DependentClass
+{
+    public String someOtherMethod()
+    {
+        final SimpleClass clazz = new SimpleClass();
+        return "bar" + clazz.someMethod();
+    }
+}

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/pom.xml?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/pom.xml (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/pom.xml Sat May 17 14:33:40 2014
@@ -0,0 +1,86 @@
+<?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.its.dependency-tree</groupId>
+  <artifactId>module-z-deps-y</artifactId>
+  <version>1.0-SNAPSHOT</version>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencyManagement>
+    <dependencies>
+      <dependency>
+        <groupId>org.apache.maven.its.dependency-tree</groupId>
+        <artifactId>module-y-deps-x</artifactId>
+        <version>1.0-SNAPSHOT</version>
+      </dependency>
+    </dependencies>
+  </dependencyManagement>
+
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.its.dependency-tree</groupId>
+      <artifactId>module-y-deps-x</artifactId>
+    </dependency>
+  </dependencies>
+
+  <build>
+    <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-dependency-plugin</artifactId>
+        <version>2.8</version>
+        <dependencies>
+          <dependency>
+            <groupId>@project.groupId@</groupId>
+            <artifactId>@project.artifactId@</artifactId>
+            <version>@project.version@</version>
+          </dependency>
+        </dependencies>
+        <executions>
+          <execution>
+            <id>default</id>
+            <phase>validate</phase>
+            <configuration>
+              <outputFile>target/tree.txt</outputFile>
+            </configuration>
+            <goals>
+              <goal>tree</goal>
+            </goals>
+          </execution>
+        </executions>
+      </plugin>
+
+      <plugin>
+        <groupId>org.apache.maven.its.dependency-tree</groupId>
+        <artifactId>multi-module-test-plugin</artifactId>
+        <version>1.0-SNAPSHOT</version>
+        <extensions>true</extensions>
+      </plugin>
+    </plugins>
+  </build>
+</project>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/ContainingClass.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/ContainingClass.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/ContainingClass.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/ContainingClass.java Sat May 17 14:33:40 2014
@@ -0,0 +1,10 @@
+package org.apache.maven.shared.dependency;
+
+public final class ContainingClass
+{
+    public String someOtherMethod()
+    {
+        final DependentClass clazz = new DependentClass();
+        return "foo" + clazz.someOtherMethod();
+    }
+}

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/pom.xml
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/pom.xml?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/pom.xml (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/pom.xml Sat May 17 14:33:40 2014
@@ -0,0 +1,52 @@
+<?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.its.dependency-tree</groupId>
+  <artifactId>multi-module</artifactId>
+  <version>1.0-SNAPSHOT</version>
+  <packaging>pom</packaging>
+
+  <name>VerboseTest</name>
+  <description>
+    Test verbose dependency-tree with actual Maven version through old dependency:tree 2.4, before the feature was removed.
+  </description>
+
+  <properties>
+    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
+  </properties>
+
+  <dependencyManagement>
+  </dependencyManagement>
+
+  <dependencies>
+  </dependencies>
+
+  <modules>
+    <module>moduleX</module>
+    <module>moduleYDepsX</module>
+    <module>moduleZDepsY</module>
+  </modules>
+
+</project>

Added: maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/verify.bsh
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/verify.bsh?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/verify.bsh (added)
+++ maven/shared/trunk/maven-dependency-tree/src/it/multi-module-test/verify.bsh Sat May 17 14:33:40 2014
@@ -0,0 +1,18 @@
+import java.io.*;
+
+import org.codehaus.plexus.util.*;
+
+String actual = FileUtils.fileRead( new File( basedir, "moduleZDepsY/target/tree.txt" ) );
+String expected = FileUtils.fileRead( new File( basedir, "expected-tree.txt" ) );
+
+actual = actual.replaceAll( "[\n\r]+", "\n" );
+expected = expected.replaceAll( "[\n\r]+", "\n" );
+
+System.out.println( "Checking dependency tree..." );
+
+if ( !actual.equals( expected ) )
+{
+    throw new Exception( "Unexpected dependency tree" );
+}
+
+return true;

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/DependencyGraphBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/DependencyGraphBuilder.java?rev=1595491&r1=1595490&r2=1595491&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/DependencyGraphBuilder.java (original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40 2014
@@ -22,6 +22,8 @@ package org.apache.maven.shared.dependen
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.project.MavenProject;
 
+import java.util.Map;
+
 /**
  * Maven project dependency graph builder API, neutral against Maven 2 or Maven 3.
  *
@@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
 public interface DependencyGraphBuilder
 {
     /**
-     * Build the dependency graph.
+     * Build the dependency graph from the repository.
+     *
+     * This is the same as {@link #buildDependencyGraph(org.apache.maven.project.MavenProject,
+     * org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.Map)} with an empty reactorProjects Map.
      *
      * @param project the project
      * @param filter artifact filter (can be <code>null</code>
@@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
      */
     DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter filter )
         throws DependencyGraphBuilderException;
+
+    /**
+     * Build the dependency graph including any dependencies contained in the reactor projects.
+     *
+     * @param project the project
+     * @param filter artifact filter (can be <code>null</code>
+     * @param reactorProjects Map of those projects contained in the reactor.
+     *                        Key is made up of groupId-artifactId-version.
+     * @return the dependency graph
+     * @throws DependencyGraphBuilderException
+     */
+    DependencyNode buildDependencyGraph(
+            MavenProject project, ArtifactFilter filter, Map<String, MavenProject> reactorProjects )
+            throws DependencyGraphBuilderException;
 }

Added: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/ProjectReferenceKeyGenerator.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/ProjectReferenceKeyGenerator.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/ProjectReferenceKeyGenerator.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/ProjectReferenceKeyGenerator.java Sat May 17 14:33:40 2014
@@ -0,0 +1,25 @@
+package org.apache.maven.shared.dependency.graph;
+
+import org.apache.maven.project.MavenProject;
+
+/**
+ * Generates the key used by {@link org.apache.maven.project.MavenProject#getProjectReferences()}
+ * , {@link org.apache.maven.execution.MavenSession#getProjectMap()} and the Map passed into
+ * {@link org.apache.maven.shared.dependency.graph.DependencyGraphBuilder#buildDependencyGraph
+ * (org.apache.maven.project.MavenProject, org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.Map)}.
+ */
+public final class ProjectReferenceKeyGenerator
+{
+    // NB Copied here from MavenProject - because MavenProject#getProjectReferenceId is private
+    public String getProjectReferenceKey( String groupId, String artifactId, String version )
+    {
+        final StringBuilder buffer = new StringBuilder( 128 );
+        buffer.append( groupId ).append( ':' ).append( artifactId ).append( ':' ).append( version );
+        return buffer.toString();
+    }
+
+    public String getProjectReferenceKey( MavenProject project )
+    {
+        return getProjectReferenceKey( project.getGroupId(), project.getArtifactId(), project.getVersion() );
+    }
+}

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java?rev=1595491&r1=1595490&r2=1595491&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java (original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/DefaultDependencyGraphBuilder.java Sat May 17 14:33:40 2014
@@ -33,6 +33,9 @@ import org.codehaus.plexus.context.Conte
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
 
+import java.util.Collections;
+import java.util.Map;
+
 /**
  * Default dependency graph builder that detects current Maven version to delegate to either
  * Maven 2 or Maven 3 specific code.
@@ -52,15 +55,23 @@ public class DefaultDependencyGraphBuild
     public DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter filter )
         throws DependencyGraphBuilderException
     {
+        return buildDependencyGraph( project, filter, Collections.EMPTY_MAP );
+    }
+
+    public DependencyNode buildDependencyGraph(
+            MavenProject project, ArtifactFilter filter, Map<String, MavenProject> reactorProjects )
+            throws DependencyGraphBuilderException
+    {
         try
         {
             String hint = isMaven31() ? "maven31" : isMaven2x() ? "maven2" : "maven3";
-            getLogger().debug( "building " + hint + " dependency graph for " + project.getId() );
 
             DependencyGraphBuilder effectiveGraphBuilder =
-                (DependencyGraphBuilder) container.lookup( DependencyGraphBuilder.class.getCanonicalName(), hint );
+                    (DependencyGraphBuilder) container.lookup( DependencyGraphBuilder.class.getCanonicalName(), hint );
+            getLogger().debug( "building " + hint + " dependency graph for " + project.getId()
+                    + " with " + effectiveGraphBuilder.getClass() );
 
-            return effectiveGraphBuilder.buildDependencyGraph( project, filter );
+            return effectiveGraphBuilder.buildDependencyGraph( project, filter, reactorProjects );
         }
         catch ( ComponentLookupException e )
         {

Added: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Invoker.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Invoker.java?rev=1595491&view=auto
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Invoker.java (added)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Invoker.java Sat May 17 14:33:40 2014
@@ -0,0 +1,48 @@
+package org.apache.maven.shared.dependency.graph.internal;
+
+import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
+
+import java.lang.reflect.InvocationTargetException;
+
+/**
+ * Invokes method on objects using reflection.
+ */
+final class Invoker
+{
+    public Object invoke( Class objectClazz, Object object, String method )
+            throws DependencyGraphBuilderException
+    {
+        try
+        {
+            return objectClazz.getMethod( method ).invoke( object );
+        } catch ( IllegalAccessException e )
+        {
+            throw new DependencyGraphBuilderException( e.getMessage(), e );
+        } catch ( InvocationTargetException e )
+        {
+            throw new DependencyGraphBuilderException( e.getMessage(), e );
+        } catch ( NoSuchMethodException e )
+        {
+            throw new DependencyGraphBuilderException( e.getMessage(), e );
+        }
+    }
+
+    public Object invoke( Object object, String method, Class<?> clazz, Object arg )
+            throws DependencyGraphBuilderException
+    {
+        try
+        {
+            final Class objectClazz = object.getClass();
+            return objectClazz.getMethod( method, clazz ).invoke( object, arg );
+        } catch ( IllegalAccessException e )
+        {
+            throw new DependencyGraphBuilderException( e.getMessage(), e );
+        } catch ( InvocationTargetException e )
+        {
+            throw new DependencyGraphBuilderException( e.getMessage(), e );
+        } catch ( NoSuchMethodException e )
+        {
+            throw new DependencyGraphBuilderException( e.getMessage(), e );
+        }
+    }
+}

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven2DependencyGraphBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven2DependencyGraphBuilder.java?rev=1595491&r1=1595490&r2=1595491&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven2DependencyGraphBuilder.java (original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven2DependencyGraphBuilder.java Sat May 17 14:33:40 2014
@@ -22,6 +22,7 @@ package org.apache.maven.shared.dependen
 import java.util.ArrayList;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.project.MavenProject;
@@ -32,6 +33,7 @@ import org.apache.maven.shared.dependenc
 import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 /**
  * Wrapper around Maven 2 dependency tree builder.
@@ -42,6 +44,7 @@ import org.codehaus.plexus.component.ann
  */
 @Component( role = DependencyGraphBuilder.class, hint = "maven2" )
 public class Maven2DependencyGraphBuilder
+    extends AbstractLogEnabled
     implements DependencyGraphBuilder
 {
     @Requirement
@@ -60,6 +63,14 @@ public class Maven2DependencyGraphBuilde
         }
     }
 
+    public DependencyNode buildDependencyGraph(
+            MavenProject project, ArtifactFilter filter, Map<String, MavenProject> reactorProjects )
+            throws DependencyGraphBuilderException
+    {
+        getLogger().warn( "Reactor projects ignored - reactor dependencies cannot be resolved in Maven2" );
+        return buildDependencyGraph( project, filter );
+    }
+
     private DependencyNode buildDependencyNode( DependencyNode parent,
                                                 org.apache.maven.shared.dependency.tree.DependencyNode node,
                                                 ArtifactFilter filter )

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyGraphBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyGraphBuilder.java?rev=1595491&r1=1595490&r2=1595491&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyGraphBuilder.java (original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven31DependencyGraphBuilder.java Sat May 17 14:33:40 2014
@@ -19,11 +19,6 @@ package org.apache.maven.shared.dependen
  * under the License.
  */
 
-import java.lang.reflect.InvocationTargetException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
@@ -38,14 +33,20 @@ import org.apache.maven.project.ProjectD
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
 import org.apache.maven.shared.dependency.graph.DependencyNode;
+import org.apache.maven.shared.dependency.graph.ProjectReferenceKeyGenerator;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
-import org.eclipse.aether.DefaultRepositorySystemSession;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.eclipse.aether.RepositorySystemSession;
 import org.eclipse.aether.graph.Dependency;
-import org.eclipse.aether.util.graph.manager.DependencyManagerUtils;
 import org.eclipse.aether.version.VersionConstraint;
 
+import java.util.ArrayList;
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Map;
+
 /**
  * Wrapper around Eclipse Aether dependency resolver, used in Maven 3.1.
  *
@@ -55,6 +56,7 @@ import org.eclipse.aether.version.Versio
  */
 @Component( role = DependencyGraphBuilder.class, hint = "maven31" )
 public class Maven31DependencyGraphBuilder
+    extends AbstractLogEnabled
     implements DependencyGraphBuilder
 {
     @Requirement
@@ -63,17 +65,25 @@ public class Maven31DependencyGraphBuild
     @Requirement
     private ArtifactFactory factory;
 
+    private final Invoker invoker = new Invoker();
+    private final ProjectReferenceKeyGenerator keyGenerator = new ProjectReferenceKeyGenerator();
+
     public DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter filter )
         throws DependencyGraphBuilderException
     {
-        try
-        {
-            ProjectBuildingRequest projectBuildingRequest =
-                (ProjectBuildingRequest) invoke( project.getClass(), project, "getProjectBuildingRequest" );
+        return buildDependencyGraph( project, filter, Collections.EMPTY_MAP );
+    }
+
+    public DependencyNode buildDependencyGraph(
+            MavenProject project, ArtifactFilter filter, Map<String, MavenProject> reactorProjects )
+            throws DependencyGraphBuilderException
+    {
+        ProjectBuildingRequest projectBuildingRequest =
+                (ProjectBuildingRequest) invoker.invoke( project.getClass(), project, "getProjectBuildingRequest" );
 
-            RepositorySystemSession session =
-                (RepositorySystemSession) invoke( ProjectBuildingRequest.class, projectBuildingRequest,
-                                                  "getRepositorySession" );
+        RepositorySystemSession session =
+                (RepositorySystemSession) invoker.invoke( ProjectBuildingRequest.class, projectBuildingRequest,
+                        "getRepositorySession" );
 
             /*if ( Boolean.TRUE != ( (Boolean) session.getConfigProperties().get( DependencyManagerUtils.NODE_DATA_PREMANAGED_VERSION ) ) )
             {
@@ -82,47 +92,68 @@ public class Maven31DependencyGraphBuild
                 session = newSession;
             }*/
 
-            DependencyResolutionRequest request =
-                new DefaultDependencyResolutionRequest();
-            request.setMavenProject( project );
-            invoke( request, "setRepositorySession", RepositorySystemSession.class, session );
-
-            DependencyResolutionResult result = resolver.resolve( request );
-
-            org.eclipse.aether.graph.DependencyNode graph =
-                (org.eclipse.aether.graph.DependencyNode) invoke( DependencyResolutionResult.class, result,
-                                                                  "getDependencyGraph" );
+        final DependencyResolutionRequest request = new DefaultDependencyResolutionRequest();
+        request.setMavenProject( project );
+        invoker.invoke( request, "setRepositorySession", RepositorySystemSession.class, session );
 
-            return buildDependencyNode( null, graph, project.getArtifact(), filter );
-        }
-        catch ( DependencyResolutionException e )
-        {
-            throw new DependencyGraphBuilderException( e.getMessage(), e );
-        }
-        catch ( IllegalAccessException e )
-        {
-            throw new DependencyGraphBuilderException( e.getMessage(), e );
-        }
-        catch ( InvocationTargetException e )
+        final DependencyResolutionResult result = resolveDependencies( request, reactorProjects );
+        org.eclipse.aether.graph.DependencyNode graph =
+                ( org.eclipse.aether.graph.DependencyNode ) invoker.invoke( DependencyResolutionResult.class, result,
+                        "getDependencyGraph" );
+
+        return buildDependencyNode( null, graph, project.getArtifact(), filter );
+    }
+
+    private DependencyResolutionResult resolveDependencies(DependencyResolutionRequest request,
+                                                           Map<String, MavenProject> reactorProjects)
+            throws DependencyGraphBuilderException
+    {
+        try
         {
-            throw new DependencyGraphBuilderException( e.getMessage(), e );
+            return resolver.resolve( request );
         }
-        catch ( NoSuchMethodException e )
+        catch ( DependencyResolutionException e )
         {
-            throw new DependencyGraphBuilderException( e.getMessage(), e );
+            // Ignore any resolution failure for deps that are part of the reactor but have not yet been built.
+            // NB Typing has been removed because DependencyResolutionResult returns Sonatype aether in 3.0.4 and
+            // Eclipse aether in 3.1.1 and while dep-tree is a single module we can only compile against one of them.
+            //
+            // NB While applying this code to Maven3DependencyGraphBuilder is trivial it won't work because
+            // in Maven 3, MavenProject.getProjectReferences isn't populated. So we would need to have the reactor
+            // modules passed in separately which would change the API for DependencyGraphBuilder. If
+            // MavenProject.getProjectReferences were populated (like it should be) then this would work for Maven3 too.
+            //
+            // NB There doesn't seem to be any way to apply this to Maven2DependencyGraphBuilder as there is no
+            // concept of partial resolution like there is is 3 and 3.1
+            final DependencyResolutionResult result = e.getResult();
+            final List<Dependency> reactorDeps = getReactorDependencies( reactorProjects, result.getUnresolvedDependencies() );
+            invoker.invoke( result.getUnresolvedDependencies(), "removeAll", Collection.class, reactorDeps );
+            invoker.invoke( result.getResolvedDependencies(), "addAll", Collection.class, reactorDeps );
+
+            if ( !result.getUnresolvedDependencies().isEmpty() ) {
+                throw new DependencyGraphBuilderException( "Could not resolve the following dependencies : "
+                        + result.getUnresolvedDependencies(), e );
+            }
+            getLogger().debug( "Resolved dependencies after ignoring reactor dependencies : " + reactorDeps );
+            return result;
         }
     }
 
-    private Object invoke( Class<?> clazz, Object object, String method )
-        throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
-    {
-        return clazz.getMethod( method ).invoke( object );
-    }
-
-    private Object invoke( Object object, String method, Class<?> clazz, Object arg )
-        throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
+    private List<Dependency> getReactorDependencies( Map<String, MavenProject> reactorProjects, List<?> dependencies )
     {
-        return object.getClass().getMethod( method, clazz ).invoke( object, arg );
+        final List<Dependency> reactorDeps = new ArrayList<Dependency>();
+        for ( final Object untypedDependency : dependencies )
+        {
+            final Dependency dependency = (Dependency) untypedDependency;
+            final org.eclipse.aether.artifact.Artifact depArtifact = dependency.getArtifact();
+            final String projectRefId = keyGenerator.getProjectReferenceKey(
+                    depArtifact.getGroupId(), depArtifact.getArtifactId(), depArtifact.getVersion()
+            );
+            if ( reactorProjects.containsKey( projectRefId ) ) {
+                reactorDeps.add( dependency );
+            }
+        }
+        return reactorDeps;
     }
 
     private Artifact getDependencyArtifact( Dependency dep )

Modified: maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java
URL: http://svn.apache.org/viewvc/maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java?rev=1595491&r1=1595490&r2=1595491&view=diff
==============================================================================
--- maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java (original)
+++ maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/shared/dependency/graph/internal/Maven3DependencyGraphBuilder.java Sat May 17 14:33:40 2014
@@ -21,8 +21,10 @@ package org.apache.maven.shared.dependen
 
 import java.lang.reflect.InvocationTargetException;
 import java.util.ArrayList;
+import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.Map;
 
 import org.apache.maven.artifact.Artifact;
 import org.apache.maven.artifact.factory.ArtifactFactory;
@@ -38,8 +40,10 @@ import org.apache.maven.project.ProjectD
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilder;
 import org.apache.maven.shared.dependency.graph.DependencyGraphBuilderException;
 import org.apache.maven.shared.dependency.graph.DependencyNode;
+import org.apache.maven.shared.dependency.graph.ProjectReferenceKeyGenerator;
 import org.codehaus.plexus.component.annotations.Component;
 import org.codehaus.plexus.component.annotations.Requirement;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.sonatype.aether.graph.Dependency;
 import org.sonatype.aether.version.VersionConstraint;
 
@@ -52,6 +56,7 @@ import org.sonatype.aether.version.Versi
  */
 @Component( role = DependencyGraphBuilder.class, hint = "maven3" )
 public class Maven3DependencyGraphBuilder
+    extends AbstractLogEnabled
     implements DependencyGraphBuilder
 {
     @Requirement
@@ -60,24 +65,87 @@ public class Maven3DependencyGraphBuilde
     @Requirement
     private ArtifactFactory factory;
 
+    private final Invoker invoker = new Invoker();
+    private final ProjectReferenceKeyGenerator keyGenerator = new ProjectReferenceKeyGenerator();
+
     public DependencyNode buildDependencyGraph( MavenProject project, ArtifactFilter filter )
         throws DependencyGraphBuilderException
     {
-        try
-        {
-            ProjectBuildingRequest projectBuildingRequest =
+        return buildDependencyGraph( project, filter, Collections.EMPTY_MAP );
+    }
+
+    public DependencyNode buildDependencyGraph(
+            MavenProject project, ArtifactFilter filter, Map<String, MavenProject> reactorProjects )
+            throws DependencyGraphBuilderException
+    {
+        ProjectBuildingRequest projectBuildingRequest =
                 (ProjectBuildingRequest) invoke( project, "getProjectBuildingRequest" );
 
-            DependencyResolutionRequest request =
+        DependencyResolutionRequest request =
                 new DefaultDependencyResolutionRequest( project, projectBuildingRequest.getRepositorySession() );
 
-            DependencyResolutionResult result = resolver.resolve( request );
+        final DependencyResolutionResult result = resolveDependencies( request, reactorProjects );
+
+        return buildDependencyNode( null, result.getDependencyGraph(), project.getArtifact(), filter );
+    }
 
-            return buildDependencyNode( null, result.getDependencyGraph(), project.getArtifact(), filter );
+    private DependencyResolutionResult resolveDependencies(DependencyResolutionRequest request,
+                                                           Map<String, MavenProject> reactorProjects)
+            throws DependencyGraphBuilderException
+    {
+        try
+        {
+            return resolver.resolve( request );
         }
         catch ( DependencyResolutionException e )
         {
-            throw new DependencyGraphBuilderException( e.getMessage(), e );
+            // Ignore any resolution failure for deps that are part of the reactor but have not yet been built.
+            // NB Typing has been removed because DependencyResolutionResult returns Sonatype aether in 3.0.4 and
+            // Eclipse aether in 3.1.1 and while dep-tree is a single module we can only compile against one of them.
+            //
+            // NB While applying this code to Maven3DependencyGraphBuilder is trivial it won't work because
+            // in Maven 3, MavenProject.getProjectReferences isn't populated. So we would need to have the reactor
+            // modules passed in separately which would change the API for DependencyGraphBuilder. If
+            // MavenProject.getProjectReferences were populated (like it should be) then this would work for Maven3 too.
+            //
+            // NB There doesn't seem to be any way to apply this to Maven2DependencyGraphBuilder as there is no
+            // concept of partial resolution like there is is 3 and 3.1
+            final DependencyResolutionResult result = e.getResult();
+            final List<Dependency> reactorDeps = getReactorDependencies( reactorProjects, result.getUnresolvedDependencies() );
+            invoker.invoke( result.getUnresolvedDependencies(), "removeAll", Collection.class, reactorDeps );
+            invoker.invoke( result.getResolvedDependencies(), "addAll", Collection.class, reactorDeps );
+
+            if ( !result.getUnresolvedDependencies().isEmpty() ) {
+                throw new DependencyGraphBuilderException( "Could not resolve the following dependencies : "
+                        + result.getUnresolvedDependencies(), e );
+            }
+            getLogger().debug( "Resolved dependencies after ignoring reactor dependencies : " + reactorDeps );
+            return result;
+        }
+    }
+
+    private List<org.sonatype.aether.graph.Dependency> getReactorDependencies( Map<String, MavenProject> reactorProjects, List<?> dependencies )
+    {
+        final List<org.sonatype.aether.graph.Dependency> reactorDeps = new ArrayList<org.sonatype.aether.graph.Dependency>();
+        for ( final Object untypedDependency : dependencies )
+        {
+            final org.sonatype.aether.graph.Dependency dependency = ( org.sonatype.aether.graph.Dependency ) untypedDependency;
+            final org.sonatype.aether.artifact.Artifact depArtifact = dependency.getArtifact();
+            final String projectRefId = keyGenerator.getProjectReferenceKey(
+                    depArtifact.getGroupId(), depArtifact.getArtifactId(), depArtifact.getVersion()
+            );
+            if ( reactorProjects.containsKey( projectRefId ) ) {
+                reactorDeps.add( dependency );
+            }
+        }
+        return reactorDeps;
+    }
+
+    private Object invoke( Object object, String method ) throws DependencyGraphBuilderException
+    {
+        try
+        {
+            return object.getClass().getMethod( method ).invoke( object );
         }
         catch ( IllegalAccessException e )
         {
@@ -93,12 +161,6 @@ public class Maven3DependencyGraphBuilde
         }
     }
 
-    private Object invoke( Object object, String method )
-        throws IllegalAccessException, InvocationTargetException, NoSuchMethodException
-    {
-        return object.getClass().getMethod( method ).invoke( object );
-    }
-
     private Artifact getDependencyArtifact( Dependency dep )
     {
         org.sonatype.aether.artifact.Artifact artifact = dep.getArtifact();



Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
Yes, you could set a low but effective bar and enforce that via build.
And in fact checkstyle can be used to enforce licence so it becomes a
superset of rat.


On Wed, May 21, 2014 at 9:49 AM, Hervé BOUTEMY <he...@free.fr>wrote:

> Le mardi 20 mai 2014 09:52:26 William Ferguson a écrit :
> > On Tue, May 20, 2014 at 5:47 AM, Hervé BOUTEMY <herve.boutemy@free.fr
> >wrote:
> > > > 1) Is there no automatic checkstyle verification as part of the
> build?
> > > > We
> > > > use it in the android-maven-plugin and I though it was standard
> practice
> > > > across the Maven projects.
> > >
> > > it's only done on site generation, and you can simply ignore the result
> > > does android-maven-plugin have more aggressive configuration?
> >
> > Yes. Std build fails unless it complies.
> >
> > IMO that's what you need since it is the developer committing code that
> has
> > the understanding necessary to provide the Javadoc comments. And
> invariably
> > it is the Javadoc comments that suffer.
> ok, I see: like rat
>
> we never had courage to do so, feeling that this would be seen as a hurdle
> to
> contribution: the exact opposite of actual idea, that it would help
> contributors to simply follow conventions locally before submitting patch
> (and
> avoid "people who know and care" take time to fix things as much as they
> can)
>
> if you look at checkstyle report on every component, you'll see that there
> are
> many conventions not followed in general.
> Perhaps if we chose a subset of conventions and made them active as
> default,
> this could be ok: I didn't really tried to do so and convince the team that
> this could be more helpful than nasty
>
> Regards,
>
> Hervé
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le mardi 20 mai 2014 09:52:26 William Ferguson a écrit :
> On Tue, May 20, 2014 at 5:47 AM, Hervé BOUTEMY <he...@free.fr>wrote:
> > > 1) Is there no automatic checkstyle verification as part of the build?
> > > We
> > > use it in the android-maven-plugin and I though it was standard practice
> > > across the Maven projects.
> > 
> > it's only done on site generation, and you can simply ignore the result
> > does android-maven-plugin have more aggressive configuration?
> 
> Yes. Std build fails unless it complies.
> 
> IMO that's what you need since it is the developer committing code that has
> the understanding necessary to provide the Javadoc comments. And invariably
> it is the Javadoc comments that suffer.
ok, I see: like rat

we never had courage to do so, feeling that this would be seen as a hurdle to 
contribution: the exact opposite of actual idea, that it would help 
contributors to simply follow conventions locally before submitting patch (and 
avoid "people who know and care" take time to fix things as much as they can)

if you look at checkstyle report on every component, you'll see that there are 
many conventions not followed in general.
Perhaps if we chose a subset of conventions and made them active as default, 
this could be ok: I didn't really tried to do so and convince the team that 
this could be more helpful than nasty

Regards,

Hervé

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le samedi 24 mai 2014 11:10:04 William Ferguson a écrit :
> > parameters and local variables are not considered final: there is nothing
> > wrong
> 
> with modifying their value, and nothing good to get by forcing them to be
> 
> > final
> 
> But there *is* value is defining them to be final.
> 
> If you as the programmer know that a value should never change, then by
> denoting it as final you can enforce that it is not inadvertently modified
> by someone else. If they deem that the restriction needs to be loosened
> because requirements have changed then they can do so.
> 
> It is just like specifying an assertion. It is about code correctness and
> less failures.
I understand your point, I know the value of giving as much value as possible 
to static checks done by compiler

but if you don't have big ultra-complex methods, this final keyword adds 
unnecessary clutter

that's my opinion, and that was the opinion of the team a few years ago, the 
last time this was discussed

Regards,

Hervé

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le samedi 24 mai 2014 05:15:31 Manfred Moser a écrit :
> I totally agree with William here. I also think that any standard that is
> not enforced easily is pointless.
+1
I measure it every time I take time to run the Checkstyle report and fix every 
little inconsistency we made over time

> Thats why I implemented the checkstyle
> verification to be part of the default build in the android maven plugin
> (and other projects). I find this tremendously helpful. It removes any
> doubts on the potentially committer side. Its gotta build..
yes, I like it, but last time we discussed it, some other ones didn't like it: 
they felt more tracked than helped
notice that we probably set the bar too high in our Checkstyle rules: even 
when I take time to fix errors reported by Checkstyle, I don't try to fix 
everything, but only my favorite ones

we probably should define a lighter configuration to check (and fail) on each 
build

Regards,

Hervé

> 
> manfred
> 
> William Ferguson wrote on 23.05.2014 18:10:
> >> parameters and local variables are not considered final: there is nothing
> >> wrong
> > 
> > with modifying their value, and nothing good to get by forcing them to be
> > 
> >> final
> > 
> > But there *is* value is defining them to be final.
> > 
> > If you as the programmer know that a value should never change, then by
> > denoting it as final you can enforce that it is not inadvertently modified
> > by someone else. If they deem that the restriction needs to be loosened
> > because requirements have changed then they can do so.
> > 
> > It is just like specifying an assertion. It is about code correctness and
> > less failures.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Jeff Jensen <je...@upstairstechnology.com>.
+1
In my circles, changing method params is a bad practice.

Enforcement of rules is key - I do the same thing Manfred, fail the build
on a set of FindBugs, PMD, and CheckStyle violations.  Really makes coders
adhere!


On Fri, May 23, 2014 at 10:15 PM, Manfred Moser <ma...@mosabuam.com>wrote:

> I totally agree with William here. I also think that any standard that is
> not enforced easily is pointless. Thats why I implemented the checkstyle
> verification to be part of the default build in the android maven plugin
> (and other projects). I find this tremendously helpful. It removes any
> doubts on the potentially committer side. Its gotta build..
>
> manfred
>
> William Ferguson wrote on 23.05.2014 18:10:
>
> >>
> >> parameters and local variables are not considered final: there is
> nothing
> >> wrong
> >>
> > with modifying their value, and nothing good to get by forcing them to be
> >> final
> >>
> >
> > But there *is* value is defining them to be final.
> >
> > If you as the programmer know that a value should never change, then by
> > denoting it as final you can enforce that it is not inadvertently
> modified
> > by someone else. If they deem that the restriction needs to be loosened
> > because requirements have changed then they can do so.
> >
> > It is just like specifying an assertion. It is about code correctness and
> > less failures.
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Manfred Moser <ma...@mosabuam.com>.
I totally agree with William here. I also think that any standard that is not enforced easily is pointless. Thats why I implemented the checkstyle verification to be part of the default build in the android maven plugin (and other projects). I find this tremendously helpful. It removes any doubts on the potentially committer side. Its gotta build.. 

manfred

William Ferguson wrote on 23.05.2014 18:10:

>>
>> parameters and local variables are not considered final: there is nothing
>> wrong
>>
> with modifying their value, and nothing good to get by forcing them to be
>> final
>>
> 
> But there *is* value is defining them to be final.
> 
> If you as the programmer know that a value should never change, then by
> denoting it as final you can enforce that it is not inadvertently modified
> by someone else. If they deem that the restriction needs to be loosened
> because requirements have changed then they can do so.
> 
> It is just like specifying an assertion. It is about code correctness and
> less failures.
> 


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
>
> parameters and local variables are not considered final: there is nothing
> wrong
>
with modifying their value, and nothing good to get by forcing them to be
> final
>

But there *is* value is defining them to be final.

If you as the programmer know that a value should never change, then by
denoting it as final you can enforce that it is not inadvertently modified
by someone else. If they deem that the restriction needs to be loosened
because requirements have changed then they can do so.

It is just like specifying an assertion. It is about code correctness and
less failures.

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le jeudi 22 mai 2014 15:25:05 William Ferguson a écrit :
> > I do not agree on this one, and that's the meaning of the coding style
> 
> Wouldn't you rather have the compiler catch the error as opposed to
> manually introspecting the code each time?
parameters and local variables are not considered final: there is nothing wrong 
with modifying their value, and nothing good to get by forcing them to be final

that's our position

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
>
> I do not agree on this one, and that's the meaning of the coding style
>

Wouldn't you rather have the compiler catch the error as opposed to
manually introspecting the code each time?

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le mercredi 21 mai 2014 11:14:05 William Ferguson a écrit :
> Yes immutable objects are the big plus.
> 
> But I also find that final locals vastly improve code structure. IME the
> vast majority of objects are set once and never modified. Any attempt to do
> so is generally a sign of a bug. Having the compiler catch that is a real
> boon.
I do not agree on this one, and that's the meaning of the coding style
:)

Regards,

Hervé

> 
> On Wed, May 21, 2014 at 9:41 AM, Hervé BOUTEMY <he...@free.fr>wrote:
> > Le mardi 20 mai 2014 09:59:24 Jason van Zyl a écrit :
> > > On May 19, 2014, at 7:52 PM, William Ferguson
> > 
> > <wi...@xandar.com.au> wrote:
> > > > One of the Maven Java code conventions (listed on that page) is to
> > > > 
> > > >    - Avoid using final modifier on all member variables and arguments.
> > > > 
> > > > I was just querying the sanity of that. All the other code conventions
> > > > either make sense or are a reasonable arbitrary decision. This one
> > 
> > appears
> > 
> > > > to be the exact opposite of what should be done.
> > > 
> > > So this is not a good idea in general, but we do not heavily employ
> > > constructor injection yet and a lot of our code still relies on setter
> > > or
> > > field injection. If the code in question is not a container controlled
> > > component definitely make fields final where you can. If they are
> > 
> > injected
> > 
> > > you can't. It's a long slog but I have a branch where I'm flipping the
> > 
> > core
> > 
> > > to JSR330 and everywhere possible I'm using constructor injection and
> > > private final fields. So I would agree in general that rule is not a
> > > good
> > > one, just a vestige of how we use our container.
> > 
> > ok for member variables: if we could use constructor injection, we whould
> > be
> > able to use final member variables, and that would be better
> > 
> > but for final arguments (and final local variables), we just avoid final
> > since it
> > doesn't give much value and is less readable: this one is really a choice
> > that
> > I'm fine with.
> > 
> > Regards,
> > 
> > Hervé
> > 
> > > > William
> > > 
> > > Thanks,
> > > 
> > > Jason
> > > 
> > > ----------------------------------------------------------
> > > Jason van Zyl
> > > Founder,  Apache Maven
> > > http://twitter.com/jvanzyl
> > > http://twitter.com/takari_io
> > > ---------------------------------------------------------
> > > 
> > > A language that doesn’t affect the way you think about programming is
> > > not
> > > worth knowing.
> > > 
> > >  -- Alan Perlis
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
Yes immutable objects are the big plus.

But I also find that final locals vastly improve code structure. IME the
vast majority of objects are set once and never modified. Any attempt to do
so is generally a sign of a bug. Having the compiler catch that is a real
boon.


On Wed, May 21, 2014 at 9:41 AM, Hervé BOUTEMY <he...@free.fr>wrote:

> Le mardi 20 mai 2014 09:59:24 Jason van Zyl a écrit :
> > On May 19, 2014, at 7:52 PM, William Ferguson
> <wi...@xandar.com.au> wrote:
> > > One of the Maven Java code conventions (listed on that page) is to
> > >
> > >    - Avoid using final modifier on all member variables and arguments.
> > >
> > > I was just querying the sanity of that. All the other code conventions
> > > either make sense or are a reasonable arbitrary decision. This one
> appears
> > > to be the exact opposite of what should be done.
> >
> > So this is not a good idea in general, but we do not heavily employ
> > constructor injection yet and a lot of our code still relies on setter or
> > field injection. If the code in question is not a container controlled
> > component definitely make fields final where you can. If they are
> injected
> > you can't. It's a long slog but I have a branch where I'm flipping the
> core
> > to JSR330 and everywhere possible I'm using constructor injection and
> > private final fields. So I would agree in general that rule is not a good
> > one, just a vestige of how we use our container.
> ok for member variables: if we could use constructor injection, we whould
> be
> able to use final member variables, and that would be better
>
> but for final arguments (and final local variables), we just avoid final
> since it
> doesn't give much value and is less readable: this one is really a choice
> that
> I'm fine with.
>
> Regards,
>
> Hervé
>
> > > William
> >
> > Thanks,
> >
> > Jason
> >
> > ----------------------------------------------------------
> > Jason van Zyl
> > Founder,  Apache Maven
> > http://twitter.com/jvanzyl
> > http://twitter.com/takari_io
> > ---------------------------------------------------------
> >
> > A language that doesn’t affect the way you think about programming is not
> > worth knowing.
> >
> >  -- Alan Perlis
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le mardi 20 mai 2014 09:59:24 Jason van Zyl a écrit :
> On May 19, 2014, at 7:52 PM, William Ferguson 
<wi...@xandar.com.au> wrote:
> > One of the Maven Java code conventions (listed on that page) is to
> > 
> >    - Avoid using final modifier on all member variables and arguments.
> > 
> > I was just querying the sanity of that. All the other code conventions
> > either make sense or are a reasonable arbitrary decision. This one appears
> > to be the exact opposite of what should be done.
> 
> So this is not a good idea in general, but we do not heavily employ
> constructor injection yet and a lot of our code still relies on setter or
> field injection. If the code in question is not a container controlled
> component definitely make fields final where you can. If they are injected
> you can't. It's a long slog but I have a branch where I'm flipping the core
> to JSR330 and everywhere possible I'm using constructor injection and
> private final fields. So I would agree in general that rule is not a good
> one, just a vestige of how we use our container.
ok for member variables: if we could use constructor injection, we whould be 
able to use final member variables, and that would be better

but for final arguments (and final local variables), we just avoid final since it 
doesn't give much value and is less readable: this one is really a choice that 
I'm fine with.

Regards,

Hervé

> > William
> 
> Thanks,
> 
> Jason
> 
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> http://twitter.com/takari_io
> ---------------------------------------------------------
> 
> A language that doesn’t affect the way you think about programming is not
> worth knowing.
> 
>  -- Alan Perlis


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Jason van Zyl <ja...@takari.io>.
On May 19, 2014, at 7:52 PM, William Ferguson <wi...@xandar.com.au> wrote:

> 
> One of the Maven Java code conventions (listed on that page) is to
> 
>    - Avoid using final modifier on all member variables and arguments.
> 
> I was just querying the sanity of that. All the other code conventions
> either make sense or are a reasonable arbitrary decision. This one appears
> to be the exact opposite of what should be done.
> 

So this is not a good idea in general, but we do not heavily employ constructor injection yet and a lot of our code still relies on setter or field injection. If the code in question is not a container controlled component definitely make fields final where you can. If they are injected you can't. It's a long slog but I have a branch where I'm flipping the core to JSR330 and everywhere possible I'm using constructor injection and private final fields. So I would agree in general that rule is not a good one, just a vestige of how we use our container.

> William

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

A language that doesn’t affect the way you think about programming is not worth knowing. 
 
 -- Alan Perlis










Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
On Tue, May 20, 2014 at 5:47 AM, Hervé BOUTEMY <he...@free.fr>wrote:

> > 1) Is there no automatic checkstyle verification as part of the build? We
> > use it in the android-maven-plugin and I though it was standard practice
> > across the Maven projects.
>


> it's only done on site generation, and you can simply ignore the result
> does android-maven-plugin have more aggressive configuration?
>

Yes. Std build fails unless it complies.

IMO that's what you need since it is the developer committing code that has
the understanding necessary to provide the Javadoc comments. And invariably
it is the Javadoc comments that suffer.


> 2) Why is the following one of the Java code conventions? Why would you
> > remove that information from the compiler? I always work to the exact
> > opposite of that unless I need to conform with a tool that uses
> reflection
> > and can't handle final variables.
> >
> >    - *Modifier*: Avoid using final modifier on all member variables and
> >    arguments.
> I don't understand what you're talking about here
>

One of the Maven Java code conventions (listed on that page) is to

    - Avoid using final modifier on all member variables and arguments.

I was just querying the sanity of that. All the other code conventions
either make sense or are a reasonable arbitrary decision. This one appears
to be the exact opposite of what should be done.

William

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
Le lundi 19 mai 2014 13:30:57 William Ferguson a écrit :
> Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
>  said:
> notice there are a few places where coding conventions are not respected:
> this would be great if you could have a look (previous comments are more
> important :) )
> see http://maven.apache.org/developers/conventions/code.html for more
> information, and tooling for automatic IDE handling
> 
> 
> I thought I was adhering. Thought I had configured IntelliJ with an
> appropriate checkstyle config, but I'll apply it again. Two questions:
> 
> 1) Is there no automatic checkstyle verification as part of the build? We
> use it in the android-maven-plugin and I though it was standard practice
> across the Maven projects.
it's only done on site generation, and you can simply ignore the result

does android-maven-plugin have more aggressive configuration?

> 
> 2) Why is the following one of the Java code conventions? Why would you
> remove that information from the compiler? I always work to the exact
> opposite of that unless I need to conform with a tool that uses reflection
> and can't handle final variables.
> 
>    - *Modifier*: Avoid using final modifier on all member variables and
>    arguments.
I don't understand what you're talking about here

Regards,

Hervé

> 
> 
> William


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
 said:
notice there are a few places where coding conventions are not respected:
this would be great if you could have a look (previous comments are more
important :) )
see http://maven.apache.org/developers/conventions/code.html for more
information, and tooling for automatic IDE handling


I thought I was adhering. Thought I had configured IntelliJ with an
appropriate checkstyle config, but I'll apply it again. Two questions:

1) Is there no automatic checkstyle verification as part of the build? We
use it in the android-maven-plugin and I though it was standard practice
across the Maven projects.

2) Why is the following one of the Java code conventions? Why would you
remove that information from the compiler? I always work to the exact
opposite of that unless I need to conform with a tool that uses reflection
and can't handle final variables.

   - *Modifier*: Avoid using final modifier on all member variables and
   arguments.


William



On Mon, May 19, 2014 at 3:39 AM, Jason van Zyl <ja...@takari.io> wrote:

> All the formatting and license header issues are resolved. William needs
> to verify the license for one file. Aside from that he can answer any other
> questions here.
>
> BTW, SVN makes this not very fun. I think we should get more aggressive on
> our conversion. Most contributions I'm seeing lately are coming through
> Github. Having to use git-svn or make patches between copies is not really
> fun.
>
> On May 18, 2014, at 10:51 AM, Hervé BOUTEMY <he...@free.fr> wrote:
>
> >> +    DependencyNode buildDependencyGraph(
> >> +            MavenProject project, ArtifactFilter filter, Map<String,
> >> MavenProject> reactorProjects ) +            throws
> >> DependencyGraphBuilderException;
> >
> > why expect a Map<String, MavenProject> reactorProjects, when a
> > List<MavenProject> seems simpler and more natural (result from
> > MavenSession.getProjects())?
> >
> > Regards,
> >
> > Hervé
> >
> > Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> >> Author: jvanzyl
> >> Date: Sat May 17 14:33:40 2014
> >> New Revision: 1595491
> >>
> >> URL: http://svn.apache.org/r1595491
> >> Log:
> >> MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> >> accepts the reactor projects and resolves dependencies from within the
> >> reactor. - Added multi-module-test to validate that the new method works
> >> against both direct and transitive deps. - Added multi-module-plugin to
> be
> >> used to validate multi-module-test - Added ProjectReferenceKeyGenerator
> as
> >> there is currently no public method to generate the key for
> >> MavenProject#projectReferences, MavenSession#projectMap or the Map of
> >> reactor projects that we will use. - Separated the reflective invocation
> >> out into the Invoker class.
> >> - Made maven-project dependency scope=provided as at runtime we want the
> >> version in the maven install, not 2.2.0 Submitted by: William Ferguson
> >> <wi...@xandar.com.au>
> >>
> > ...
> >>
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> >> red/dependency/graph/DependencyGraphBuilder.java (original) +++
> >>
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> >> red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40
> 2014 @@
> >> -22,6 +22,8 @@ package org.apache.maven.shared.dependen
> >> import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
> >> import org.apache.maven.project.MavenProject;
> >>
> >> +import java.util.Map;
> >> +
> >> /**
> >>  * Maven project dependency graph builder API, neutral against Maven 2
> or
> >> Maven 3. *
> >> @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
> >> public interface DependencyGraphBuilder
> >> {
> >>     /**
> >> -     * Build the dependency graph.
> >> +     * Build the dependency graph from the repository.
> >> +     *
> >> +     * This is the same as {@link
> >> #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
> >> org.apache.maven.artifact.resolver.filter.ArtifactFilter,
> java.util.Map)}
> >> with an empty reactorProjects Map. *
> >>      * @param project the project
> >>      * @param filter artifact filter (can be <code>null</code>
> >> @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
> >>      */
> >>     DependencyNode buildDependencyGraph( MavenProject project,
> >> ArtifactFilter filter ) throws DependencyGraphBuilderException;
> >> +
> >> +    /**
> >> +     * Build the dependency graph including any dependencies contained
> in
> >> the reactor projects. +     *
> >> +     * @param project the project
> >> +     * @param filter artifact filter (can be <code>null</code>
> >> +     * @param reactorProjects Map of those projects contained in the
> >> reactor. +     *                        Key is made up of
> >> groupId-artifactId-version. +     * @return the dependency graph
> >> +     * @throws DependencyGraphBuilderException
> >> +     */
> >> +    DependencyNode buildDependencyGraph(
> >> +            MavenProject project, ArtifactFilter filter, Map<String,
> >> MavenProject> reactorProjects ) +            throws
> >> DependencyGraphBuilderException;
> >> }
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> http://twitter.com/takari_io
> ---------------------------------------------------------
>
> I never make the mistake of arguing with people for whose opinions I have
> no respect.
>
> -- Edward Gibbon
>
>
>
>
>
>
>
>
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
 said:

in Maven31DependencyGraphBuilder.java, why use invoker for invoker.invoke(
result.getUnresolvedDependencies(), "removeAll", Collection.class,
reactorDeps ); : this is simply collection, no?

Correct, it is simply a collection. In the first instance I did indeed just
call
  result.getUnresolvedDependencies().removeAll( reactorDeps );
But the intent of the code was obfuscated by the 2 different types of
invocation so I converted it to use reflection as it is required by #addAll
on the next line. I think the small runtime cost of reflection is vastly
outweighed by the readability off the code.

William



On Mon, May 19, 2014 at 3:39 AM, Jason van Zyl <ja...@takari.io> wrote:

> All the formatting and license header issues are resolved. William needs
> to verify the license for one file. Aside from that he can answer any other
> questions here.
>
> BTW, SVN makes this not very fun. I think we should get more aggressive on
> our conversion. Most contributions I'm seeing lately are coming through
> Github. Having to use git-svn or make patches between copies is not really
> fun.
>
> On May 18, 2014, at 10:51 AM, Hervé BOUTEMY <he...@free.fr> wrote:
>
> >> +    DependencyNode buildDependencyGraph(
> >> +            MavenProject project, ArtifactFilter filter, Map<String,
> >> MavenProject> reactorProjects ) +            throws
> >> DependencyGraphBuilderException;
> >
> > why expect a Map<String, MavenProject> reactorProjects, when a
> > List<MavenProject> seems simpler and more natural (result from
> > MavenSession.getProjects())?
> >
> > Regards,
> >
> > Hervé
> >
> > Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> >> Author: jvanzyl
> >> Date: Sat May 17 14:33:40 2014
> >> New Revision: 1595491
> >>
> >> URL: http://svn.apache.org/r1595491
> >> Log:
> >> MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> >> accepts the reactor projects and resolves dependencies from within the
> >> reactor. - Added multi-module-test to validate that the new method works
> >> against both direct and transitive deps. - Added multi-module-plugin to
> be
> >> used to validate multi-module-test - Added ProjectReferenceKeyGenerator
> as
> >> there is currently no public method to generate the key for
> >> MavenProject#projectReferences, MavenSession#projectMap or the Map of
> >> reactor projects that we will use. - Separated the reflective invocation
> >> out into the Invoker class.
> >> - Made maven-project dependency scope=provided as at runtime we want the
> >> version in the maven install, not 2.2.0 Submitted by: William Ferguson
> >> <wi...@xandar.com.au>
> >>
> > ...
> >>
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> >> red/dependency/graph/DependencyGraphBuilder.java (original) +++
> >>
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> >> red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40
> 2014 @@
> >> -22,6 +22,8 @@ package org.apache.maven.shared.dependen
> >> import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
> >> import org.apache.maven.project.MavenProject;
> >>
> >> +import java.util.Map;
> >> +
> >> /**
> >>  * Maven project dependency graph builder API, neutral against Maven 2
> or
> >> Maven 3. *
> >> @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
> >> public interface DependencyGraphBuilder
> >> {
> >>     /**
> >> -     * Build the dependency graph.
> >> +     * Build the dependency graph from the repository.
> >> +     *
> >> +     * This is the same as {@link
> >> #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
> >> org.apache.maven.artifact.resolver.filter.ArtifactFilter,
> java.util.Map)}
> >> with an empty reactorProjects Map. *
> >>      * @param project the project
> >>      * @param filter artifact filter (can be <code>null</code>
> >> @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
> >>      */
> >>     DependencyNode buildDependencyGraph( MavenProject project,
> >> ArtifactFilter filter ) throws DependencyGraphBuilderException;
> >> +
> >> +    /**
> >> +     * Build the dependency graph including any dependencies contained
> in
> >> the reactor projects. +     *
> >> +     * @param project the project
> >> +     * @param filter artifact filter (can be <code>null</code>
> >> +     * @param reactorProjects Map of those projects contained in the
> >> reactor. +     *                        Key is made up of
> >> groupId-artifactId-version. +     * @return the dependency graph
> >> +     * @throws DependencyGraphBuilderException
> >> +     */
> >> +    DependencyNode buildDependencyGraph(
> >> +            MavenProject project, ArtifactFilter filter, Map<String,
> >> MavenProject> reactorProjects ) +            throws
> >> DependencyGraphBuilderException;
> >> }
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> http://twitter.com/takari_io
> ---------------------------------------------------------
>
> I never make the mistake of arguing with people for whose opinions I have
> no respect.
>
> -- Edward Gibbon
>
>
>
>
>
>
>
>
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
 said:
in pom.xml, why remove */pom.xml?

I can't recall. Possibly because I was explicitly declaring the ITs to
ensure the execution order which I later found out depends entirely upon
folder name. Or maybe because my sensibilities were offended by the
combination of explicit definition + overlapping wildcard definition.

In any case, I would suggest that the explicit definition be replaced with
a single */.pom.xml wild card definition.

Where/how would you like me to make the change?

William



On Mon, May 19, 2014 at 3:39 AM, Jason van Zyl <ja...@takari.io> wrote:

> All the formatting and license header issues are resolved. William needs
> to verify the license for one file. Aside from that he can answer any other
> questions here.
>
> BTW, SVN makes this not very fun. I think we should get more aggressive on
> our conversion. Most contributions I'm seeing lately are coming through
> Github. Having to use git-svn or make patches between copies is not really
> fun.
>
> On May 18, 2014, at 10:51 AM, Hervé BOUTEMY <he...@free.fr> wrote:
>
> >> +    DependencyNode buildDependencyGraph(
> >> +            MavenProject project, ArtifactFilter filter, Map<String,
> >> MavenProject> reactorProjects ) +            throws
> >> DependencyGraphBuilderException;
> >
> > why expect a Map<String, MavenProject> reactorProjects, when a
> > List<MavenProject> seems simpler and more natural (result from
> > MavenSession.getProjects())?
> >
> > Regards,
> >
> > Hervé
> >
> > Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> >> Author: jvanzyl
> >> Date: Sat May 17 14:33:40 2014
> >> New Revision: 1595491
> >>
> >> URL: http://svn.apache.org/r1595491
> >> Log:
> >> MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> >> accepts the reactor projects and resolves dependencies from within the
> >> reactor. - Added multi-module-test to validate that the new method works
> >> against both direct and transitive deps. - Added multi-module-plugin to
> be
> >> used to validate multi-module-test - Added ProjectReferenceKeyGenerator
> as
> >> there is currently no public method to generate the key for
> >> MavenProject#projectReferences, MavenSession#projectMap or the Map of
> >> reactor projects that we will use. - Separated the reflective invocation
> >> out into the Invoker class.
> >> - Made maven-project dependency scope=provided as at runtime we want the
> >> version in the maven install, not 2.2.0 Submitted by: William Ferguson
> >> <wi...@xandar.com.au>
> >>
> > ...
> >>
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> >> red/dependency/graph/DependencyGraphBuilder.java (original) +++
> >>
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> >> red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40
> 2014 @@
> >> -22,6 +22,8 @@ package org.apache.maven.shared.dependen
> >> import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
> >> import org.apache.maven.project.MavenProject;
> >>
> >> +import java.util.Map;
> >> +
> >> /**
> >>  * Maven project dependency graph builder API, neutral against Maven 2
> or
> >> Maven 3. *
> >> @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
> >> public interface DependencyGraphBuilder
> >> {
> >>     /**
> >> -     * Build the dependency graph.
> >> +     * Build the dependency graph from the repository.
> >> +     *
> >> +     * This is the same as {@link
> >> #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
> >> org.apache.maven.artifact.resolver.filter.ArtifactFilter,
> java.util.Map)}
> >> with an empty reactorProjects Map. *
> >>      * @param project the project
> >>      * @param filter artifact filter (can be <code>null</code>
> >> @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
> >>      */
> >>     DependencyNode buildDependencyGraph( MavenProject project,
> >> ArtifactFilter filter ) throws DependencyGraphBuilderException;
> >> +
> >> +    /**
> >> +     * Build the dependency graph including any dependencies contained
> in
> >> the reactor projects. +     *
> >> +     * @param project the project
> >> +     * @param filter artifact filter (can be <code>null</code>
> >> +     * @param reactorProjects Map of those projects contained in the
> >> reactor. +     *                        Key is made up of
> >> groupId-artifactId-version. +     * @return the dependency graph
> >> +     * @throws DependencyGraphBuilderException
> >> +     */
> >> +    DependencyNode buildDependencyGraph(
> >> +            MavenProject project, ArtifactFilter filter, Map<String,
> >> MavenProject> reactorProjects ) +            throws
> >> DependencyGraphBuilderException;
> >> }
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org
> >
>
> Thanks,
>
> Jason
>
> ----------------------------------------------------------
> Jason van Zyl
> Founder,  Apache Maven
> http://twitter.com/jvanzyl
> http://twitter.com/takari_io
> ---------------------------------------------------------
>
> I never make the mistake of arguing with people for whose opinions I have
> no respect.
>
> -- Edward Gibbon
>
>
>
>
>
>
>
>
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Jason van Zyl <ja...@takari.io>.
All the formatting and license header issues are resolved. William needs to verify the license for one file. Aside from that he can answer any other questions here.

BTW, SVN makes this not very fun. I think we should get more aggressive on our conversion. Most contributions I'm seeing lately are coming through Github. Having to use git-svn or make patches between copies is not really fun.

On May 18, 2014, at 10:51 AM, Hervé BOUTEMY <he...@free.fr> wrote:

>> +    DependencyNode buildDependencyGraph(
>> +            MavenProject project, ArtifactFilter filter, Map<String,
>> MavenProject> reactorProjects ) +            throws
>> DependencyGraphBuilderException;
> 
> why expect a Map<String, MavenProject> reactorProjects, when a 
> List<MavenProject> seems simpler and more natural (result from 
> MavenSession.getProjects())?
> 
> Regards,
> 
> Hervé
> 
> Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
>> Author: jvanzyl
>> Date: Sat May 17 14:33:40 2014
>> New Revision: 1595491
>> 
>> URL: http://svn.apache.org/r1595491
>> Log:
>> MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
>> accepts the reactor projects and resolves dependencies from within the
>> reactor. - Added multi-module-test to validate that the new method works
>> against both direct and transitive deps. - Added multi-module-plugin to be
>> used to validate multi-module-test - Added ProjectReferenceKeyGenerator as
>> there is currently no public method to generate the key for
>> MavenProject#projectReferences, MavenSession#projectMap or the Map of
>> reactor projects that we will use. - Separated the reflective invocation
>> out into the Invoker class.
>> - Made maven-project dependency scope=provided as at runtime we want the
>> version in the maven install, not 2.2.0 Submitted by: William Ferguson
>> <wi...@xandar.com.au>
>> 
> ...
>> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
>> red/dependency/graph/DependencyGraphBuilder.java (original) +++
>> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
>> red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40 2014 @@
>> -22,6 +22,8 @@ package org.apache.maven.shared.dependen
>> import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
>> import org.apache.maven.project.MavenProject;
>> 
>> +import java.util.Map;
>> +
>> /**
>>  * Maven project dependency graph builder API, neutral against Maven 2 or
>> Maven 3. *
>> @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
>> public interface DependencyGraphBuilder
>> {
>>     /**
>> -     * Build the dependency graph.
>> +     * Build the dependency graph from the repository.
>> +     *
>> +     * This is the same as {@link
>> #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
>> org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.Map)}
>> with an empty reactorProjects Map. *
>>      * @param project the project
>>      * @param filter artifact filter (can be <code>null</code>
>> @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
>>      */
>>     DependencyNode buildDependencyGraph( MavenProject project,
>> ArtifactFilter filter ) throws DependencyGraphBuilderException;
>> +
>> +    /**
>> +     * Build the dependency graph including any dependencies contained in
>> the reactor projects. +     *
>> +     * @param project the project
>> +     * @param filter artifact filter (can be <code>null</code>
>> +     * @param reactorProjects Map of those projects contained in the
>> reactor. +     *                        Key is made up of
>> groupId-artifactId-version. +     * @return the dependency graph
>> +     * @throws DependencyGraphBuilderException
>> +     */
>> +    DependencyNode buildDependencyGraph(
>> +            MavenProject project, ArtifactFilter filter, Map<String,
>> MavenProject> reactorProjects ) +            throws
>> DependencyGraphBuilderException;
>> }
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
> 

Thanks,

Jason

----------------------------------------------------------
Jason van Zyl
Founder,  Apache Maven
http://twitter.com/jvanzyl
http://twitter.com/takari_io
---------------------------------------------------------

I never make the mistake of arguing with people for whose opinions I have no respect.

-- Edward Gibbon










Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
On Mon, May 19, 2014 at 8:49 AM, William Ferguson <
william.ferguson@xandar.com.au> wrote:

> Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
>  said:
> in interface DependencyGraphBuilder, why expect a Map reactorProjects,
> when a List seems simpler and more natural (result from
> MavenSession.getProjects())?
>
> Good point. We could pass in List<Project> and construct the Map
> internally.
> Where/How would you like me to make the change?
> William
>
>
>
> On Mon, May 19, 2014 at 12:51 AM, Hervé BOUTEMY <he...@free.fr>wrote:
>
>> > +    DependencyNode buildDependencyGraph(
>> > +            MavenProject project, ArtifactFilter filter, Map<String,
>> > MavenProject> reactorProjects ) +            throws
>> > DependencyGraphBuilderException;
>>
>> why expect a Map<String, MavenProject> reactorProjects, when a
>> List<MavenProject> seems simpler and more natural (result from
>> MavenSession.getProjects())?
>>
>> Regards,
>>
>> Hervé
>>
>> Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
>> > Author: jvanzyl
>> > Date: Sat May 17 14:33:40 2014
>> > New Revision: 1595491
>> >
>> > URL: http://svn.apache.org/r1595491
>> > Log:
>> > MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
>> > accepts the reactor projects and resolves dependencies from within the
>> > reactor. - Added multi-module-test to validate that the new method works
>> > against both direct and transitive deps. - Added multi-module-plugin to
>> be
>> > used to validate multi-module-test - Added ProjectReferenceKeyGenerator
>> as
>> > there is currently no public method to generate the key for
>> > MavenProject#projectReferences, MavenSession#projectMap or the Map of
>> > reactor projects that we will use. - Separated the reflective invocation
>> > out into the Invoker class.
>> > - Made maven-project dependency scope=provided as at runtime we want the
>> > version in the maven install, not 2.2.0 Submitted by: William Ferguson
>> > <wi...@xandar.com.au>
>> >
>> ...
>> >
>> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
>> > red/dependency/graph/DependencyGraphBuilder.java (original) +++
>> >
>> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
>> > red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40
>> 2014 @@
>> > -22,6 +22,8 @@ package org.apache.maven.shared.dependen
>> >  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
>> >  import org.apache.maven.project.MavenProject;
>> >
>> > +import java.util.Map;
>> > +
>> >  /**
>> >   * Maven project dependency graph builder API, neutral against Maven 2
>> or
>> > Maven 3. *
>> > @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
>> >  public interface DependencyGraphBuilder
>> >  {
>> >      /**
>> > -     * Build the dependency graph.
>> > +     * Build the dependency graph from the repository.
>> > +     *
>> > +     * This is the same as {@link
>> > #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
>> > org.apache.maven.artifact.resolver.filter.ArtifactFilter,
>> java.util.Map)}
>> > with an empty reactorProjects Map. *
>> >       * @param project the project
>> >       * @param filter artifact filter (can be <code>null</code>
>> > @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
>> >       */
>> >      DependencyNode buildDependencyGraph( MavenProject project,
>> > ArtifactFilter filter ) throws DependencyGraphBuilderException;
>> > +
>> > +    /**
>> > +     * Build the dependency graph including any dependencies contained
>> in
>> > the reactor projects. +     *
>> > +     * @param project the project
>> > +     * @param filter artifact filter (can be <code>null</code>
>> > +     * @param reactorProjects Map of those projects contained in the
>> > reactor. +     *                        Key is made up of
>> > groupId-artifactId-version. +     * @return the dependency graph
>> > +     * @throws DependencyGraphBuilderException
>> > +     */
>> > +    DependencyNode buildDependencyGraph(
>> > +            MavenProject project, ArtifactFilter filter, Map<String,
>> > MavenProject> reactorProjects ) +            throws
>> > DependencyGraphBuilderException;
>> >  }
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
>> For additional commands, e-mail: dev-help@maven.apache.org
>>
>>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
if you want to work on github and send pull requests, no problem

Regards,

Hervé

Le lundi 19 mai 2014 08:49:28 William Ferguson a écrit :
> Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
>  said:
> in interface DependencyGraphBuilder, why expect a Map reactorProjects, when
> a List seems simpler and more natural (result from
> MavenSession.getProjects())?
> 
> Good point. We could pass in List<Project> and construct the Map internally.
> Where/How would you like me to make the change?
> William
> 
> On Mon, May 19, 2014 at 12:51 AM, Hervé BOUTEMY 
<he...@free.fr>wrote:
> > > +    DependencyNode buildDependencyGraph(
> > > +            MavenProject project, ArtifactFilter filter, Map<String,
> > > MavenProject> reactorProjects ) +            throws
> > > DependencyGraphBuilderException;
> > 
> > why expect a Map<String, MavenProject> reactorProjects, when a
> > List<MavenProject> seems simpler and more natural (result from
> > MavenSession.getProjects())?
> > 
> > Regards,
> > 
> > Hervé
> > 
> > Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> > > Author: jvanzyl
> > > Date: Sat May 17 14:33:40 2014
> > > New Revision: 1595491
> > > 
> > > URL: http://svn.apache.org/r1595491
> > > Log:
> > > MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> > > accepts the reactor projects and resolves dependencies from within the
> > > reactor. - Added multi-module-test to validate that the new method works
> > > against both direct and transitive deps. - Added multi-module-plugin to
> > 
> > be
> > 
> > > used to validate multi-module-test - Added ProjectReferenceKeyGenerator
> > 
> > as
> > 
> > > there is currently no public method to generate the key for
> > > MavenProject#projectReferences, MavenSession#projectMap or the Map of
> > > reactor projects that we will use. - Separated the reflective invocation
> > > out into the Invoker class.
> > > - Made maven-project dependency scope=provided as at runtime we want the
> > > version in the maven install, not 2.2.0 Submitted by: William Ferguson
> > > <wi...@xandar.com.au>
> > 
> > ...
> > 
> > maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sh
> > a
> > 
> > > red/dependency/graph/DependencyGraphBuilder.java (original) +++
> > 
> > maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sh
> > a
> > 
> > > red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40
> > 
> > 2014 @@
> > 
> > > -22,6 +22,8 @@ package org.apache.maven.shared.dependen
> > > 
> > >  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
> > >  import org.apache.maven.project.MavenProject;
> > > 
> > > +import java.util.Map;
> > > +
> > > 
> > >  /**
> > >  
> > >   * Maven project dependency graph builder API, neutral against Maven 2
> > 
> > or
> > 
> > > Maven 3. *
> > > @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
> > > 
> > >  public interface DependencyGraphBuilder
> > >  {
> > >  
> > >      /**
> > > 
> > > -     * Build the dependency graph.
> > > +     * Build the dependency graph from the repository.
> > > +     *
> > > +     * This is the same as {@link
> > > #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
> > > org.apache.maven.artifact.resolver.filter.ArtifactFilter,
> > > java.util.Map)}
> > > with an empty reactorProjects Map. *
> > > 
> > >       * @param project the project
> > >       * @param filter artifact filter (can be <code>null</code>
> > > 
> > > @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
> > > 
> > >       */
> > >      
> > >      DependencyNode buildDependencyGraph( MavenProject project,
> > > 
> > > ArtifactFilter filter ) throws DependencyGraphBuilderException;
> > > +
> > > +    /**
> > > +     * Build the dependency graph including any dependencies contained
> > 
> > in
> > 
> > > the reactor projects. +     *
> > > +     * @param project the project
> > > +     * @param filter artifact filter (can be <code>null</code>
> > > +     * @param reactorProjects Map of those projects contained in the
> > > reactor. +     *                        Key is made up of
> > > groupId-artifactId-version. +     * @return the dependency graph
> > > +     * @throws DependencyGraphBuilderException
> > > +     */
> > > +    DependencyNode buildDependencyGraph(
> > > +            MavenProject project, ArtifactFilter filter, Map<String,
> > > MavenProject> reactorProjects ) +            throws
> > > DependencyGraphBuilderException;
> > > 
> > >  }
> > 
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> > For additional commands, e-mail: dev-help@maven.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by William Ferguson <wi...@xandar.com.au>.
Hervé Boutemy <https://plus.google.com/u/0/107251243568189719606?prsrc=4>
 said:
in interface DependencyGraphBuilder, why expect a Map reactorProjects, when
a List seems simpler and more natural (result from
MavenSession.getProjects())?

Good point. We could pass in List<Project> and construct the Map internally.
Where/How would you like me to make the change?
William



On Mon, May 19, 2014 at 12:51 AM, Hervé BOUTEMY <he...@free.fr>wrote:

> > +    DependencyNode buildDependencyGraph(
> > +            MavenProject project, ArtifactFilter filter, Map<String,
> > MavenProject> reactorProjects ) +            throws
> > DependencyGraphBuilderException;
>
> why expect a Map<String, MavenProject> reactorProjects, when a
> List<MavenProject> seems simpler and more natural (result from
> MavenSession.getProjects())?
>
> Regards,
>
> Hervé
>
> Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> > Author: jvanzyl
> > Date: Sat May 17 14:33:40 2014
> > New Revision: 1595491
> >
> > URL: http://svn.apache.org/r1595491
> > Log:
> > MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> > accepts the reactor projects and resolves dependencies from within the
> > reactor. - Added multi-module-test to validate that the new method works
> > against both direct and transitive deps. - Added multi-module-plugin to
> be
> > used to validate multi-module-test - Added ProjectReferenceKeyGenerator
> as
> > there is currently no public method to generate the key for
> > MavenProject#projectReferences, MavenSession#projectMap or the Map of
> > reactor projects that we will use. - Separated the reflective invocation
> > out into the Invoker class.
> > - Made maven-project dependency scope=provided as at runtime we want the
> > version in the maven install, not 2.2.0 Submitted by: William Ferguson
> > <wi...@xandar.com.au>
> >
> ...
> >
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> > red/dependency/graph/DependencyGraphBuilder.java (original) +++
> >
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> > red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40
> 2014 @@
> > -22,6 +22,8 @@ package org.apache.maven.shared.dependen
> >  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
> >  import org.apache.maven.project.MavenProject;
> >
> > +import java.util.Map;
> > +
> >  /**
> >   * Maven project dependency graph builder API, neutral against Maven 2
> or
> > Maven 3. *
> > @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
> >  public interface DependencyGraphBuilder
> >  {
> >      /**
> > -     * Build the dependency graph.
> > +     * Build the dependency graph from the repository.
> > +     *
> > +     * This is the same as {@link
> > #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
> > org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.Map)}
> > with an empty reactorProjects Map. *
> >       * @param project the project
> >       * @param filter artifact filter (can be <code>null</code>
> > @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
> >       */
> >      DependencyNode buildDependencyGraph( MavenProject project,
> > ArtifactFilter filter ) throws DependencyGraphBuilderException;
> > +
> > +    /**
> > +     * Build the dependency graph including any dependencies contained
> in
> > the reactor projects. +     *
> > +     * @param project the project
> > +     * @param filter artifact filter (can be <code>null</code>
> > +     * @param reactorProjects Map of those projects contained in the
> > reactor. +     *                        Key is made up of
> > groupId-artifactId-version. +     * @return the dependency graph
> > +     * @throws DependencyGraphBuilderException
> > +     */
> > +    DependencyNode buildDependencyGraph(
> > +            MavenProject project, ArtifactFilter filter, Map<String,
> > MavenProject> reactorProjects ) +            throws
> > DependencyGraphBuilderException;
> >  }
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
> For additional commands, e-mail: dev-help@maven.apache.org
>
>

Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
> +    DependencyNode buildDependencyGraph(
> +            MavenProject project, ArtifactFilter filter, Map<String,
> MavenProject> reactorProjects ) +            throws
> DependencyGraphBuilderException;

why expect a Map<String, MavenProject> reactorProjects, when a 
List<MavenProject> seems simpler and more natural (result from 
MavenSession.getProjects())?

Regards,

Hervé

Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> Author: jvanzyl
> Date: Sat May 17 14:33:40 2014
> New Revision: 1595491
> 
> URL: http://svn.apache.org/r1595491
> Log:
> MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> accepts the reactor projects and resolves dependencies from within the
> reactor. - Added multi-module-test to validate that the new method works
> against both direct and transitive deps. - Added multi-module-plugin to be
> used to validate multi-module-test - Added ProjectReferenceKeyGenerator as
> there is currently no public method to generate the key for
> MavenProject#projectReferences, MavenSession#projectMap or the Map of
> reactor projects that we will use. - Separated the reflective invocation
> out into the Invoker class.
> - Made maven-project dependency scope=provided as at runtime we want the
> version in the maven install, not 2.2.0 Submitted by: William Ferguson
> <wi...@xandar.com.au>
> 
...
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> red/dependency/graph/DependencyGraphBuilder.java (original) +++
> maven/shared/trunk/maven-dependency-tree/src/main/java/org/apache/maven/sha
> red/dependency/graph/DependencyGraphBuilder.java Sat May 17 14:33:40 2014 @@
> -22,6 +22,8 @@ package org.apache.maven.shared.dependen
>  import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
>  import org.apache.maven.project.MavenProject;
> 
> +import java.util.Map;
> +
>  /**
>   * Maven project dependency graph builder API, neutral against Maven 2 or
> Maven 3. *
> @@ -31,7 +33,10 @@ import org.apache.maven.project.MavenPro
>  public interface DependencyGraphBuilder
>  {
>      /**
> -     * Build the dependency graph.
> +     * Build the dependency graph from the repository.
> +     *
> +     * This is the same as {@link
> #buildDependencyGraph(org.apache.maven.project.MavenProject, +     *
> org.apache.maven.artifact.resolver.filter.ArtifactFilter, java.util.Map)}
> with an empty reactorProjects Map. *
>       * @param project the project
>       * @param filter artifact filter (can be <code>null</code>
> @@ -40,4 +45,18 @@ public interface DependencyGraphBuilder
>       */
>      DependencyNode buildDependencyGraph( MavenProject project,
> ArtifactFilter filter ) throws DependencyGraphBuilderException;
> +
> +    /**
> +     * Build the dependency graph including any dependencies contained in
> the reactor projects. +     *
> +     * @param project the project
> +     * @param filter artifact filter (can be <code>null</code>
> +     * @param reactorProjects Map of those projects contained in the
> reactor. +     *                        Key is made up of
> groupId-artifactId-version. +     * @return the dependency graph
> +     * @throws DependencyGraphBuilderException
> +     */
> +    DependencyNode buildDependencyGraph(
> +            MavenProject project, ArtifactFilter filter, Map<String,
> MavenProject> reactorProjects ) +            throws
> DependencyGraphBuilderException;
>  }


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


Re: svn commit: r1595491 - in /maven/shared/trunk/maven-dependency-tree: ./ src/it/multi-module-plugin/ src/it/multi-module-plugin/resources/ src/it/multi-module-plugin/resources/META-INF/ src/it/multi-module-plugin/resources/META-INF/plexus/ src/it/multi-...

Posted by Hervé BOUTEMY <he...@free.fr>.
there are license problems in this commit

see "mvn apache-rat:check" result:

Unapproved licenses:

  src/main/java/org/apache/maven/shared/dependency/graph/ProjectReferenceKeyGenerator.java
  src/main/java/org/apache/maven/shared/dependency/graph/internal/Invoker.java
  src/it/multi-module-
plugin/src/main/java/org/apache/maven/its/deptree/ResolveDependenciesLifecycleParticipant.java
  src/it/multi-module-
plugin/src/main/java/org/apache/maven/its/deptree/DummyMojo.java
  src/it/multi-module-
test/moduleZDepsY/src/main/java/org/apache/maven/shared/dependency/ContainingClass.java
  src/it/multi-module-
test/moduleX/src/main/java/org/apache/maven/shared/dependency/SimpleClass.java
  src/it/multi-module-test/expected-tree.txt
  src/it/multi-module-test/invoker.properties
  src/it/multi-module-
test/moduleYDepsX/src/main/java/org/apache/maven/shared/dependency/DependentClass.java
  src/it/multi-module-test/verify.bsh

Regards,

Hervé

Le samedi 17 mai 2014 14:33:41 jvanzyl@apache.org a écrit :
> Author: jvanzyl
> Date: Sat May 17 14:33:40 2014
> New Revision: 1595491
> 
> URL: http://svn.apache.org/r1595491
> Log:
> MSHARED-336: Added an overloaded method to DependencyGraphBuilder that
> accepts the reactor projects and resolves dependencies from within the
> reactor. - Added multi-module-test to validate that the new method works
> against both direct and transitive deps. - Added multi-module-plugin to be
> used to validate multi-module-test - Added ProjectReferenceKeyGenerator as
> there is currently no public method to generate the key for
> MavenProject#projectReferences, MavenSession#projectMap or the Map of
> reactor projects that we will use. - Separated the reflective invocation
> out into the Invoker class.
> - Made maven-project dependency scope=provided as at runtime we want the
> version in the maven install, not 2.2.0 Submitted by: William Ferguson
> <wi...@xandar.com.au>


---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org