You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by Brian Fox <br...@infinity.nu> on 2010/04/22 15:02:52 UTC

odd behavior with m3-beta-1

Last night I was looking at an irc user's pom for a parsing error:

<?xml version="1.0" encoding="UTF-8"?>
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.lwjgl</groupId>
  <artifactId>lwjgl-linux-64</artifactId>
  <version>2.4.2</version>
  <repositories>
    <repository>
      <id>newdawnsoftware</id>
      <url>http://www.newdawnsoftware.com/maven2</url>
    </repository>
  </repositories>
  <dependencies>
    <dependency>
      <groupId>net.java.games</groupId>
      <artifactId>jinput</artifactId>
      <version>2.0.1</version>
    </dependency>
    <dependency>
      <groupId>net.java.games</groupId>
      <artifactId>jinput</artifactId>
      <version>2.0.1</version>
      <classifier>linux-natives</classifier>
    </dependency>
  </dependencies>
</project>


I put this on my desktop and ran:

c:\Users\brianf\Desktop>mvn help:effective-pom

And it started downloading all updated versions of the
plugins...plugins that aren't being used in this execution and aren't
referenced in the pom directly. I've seen this happen before with a
few other projects and it seems odd to me, is this new behavior or is
my memory failing?

[INFO] Scanning for projects...
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-compiler-plugin/2.3/maven-compiler-plugin-2.3.jar
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-compiler-plugin/2.3/maven-compiler-plugin-2.3.jar (30 KB at 13
.8 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-resources-plugin/2.4.2/maven-resources-plugin-2.4.2.jar
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-resources-plugin/2.4.2/maven-resources-plugin-2.4.2.jar (24 KB
 at 119.7 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-surefire-plugin/2.5/maven-surefire-plugin-2.5.jar
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-surefire-plugin/2.5/maven-surefire-plugin-2.5.jar (33 KB at 24
.3 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-clean-plugin/2.4/maven-clean-plugin-2.4.jar
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-clean-plugin/2.4/maven-clean-plugin-2.4.jar (23 KB at 16.6 KB/
sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.jar
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-release-plugin/2.0/maven-release-plugin-2.0.jar (38 KB at 27.7
 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/sonatype
/plugins/maven-metadata.xml
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/sonatype/
plugins/maven-metadata.xml (5 KB at 1.9 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-metadata.xml
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-metadata.xml (9 KB at 1.7 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-help-plugin/maven-metadata.xml
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-help-plugin/maven-metadata.xml (765 B at 0.1 KB/sec)
Downloading: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/m
aven/plugins/maven-help-plugin/2.1.1/maven-help-plugin-2.1.1.jar
Downloaded: http://192.168.101.21:8081/nexus/content/groups/public/org/apache/ma
ven/plugins/maven-help-plugin/2.1.1/maven-help-plugin-2.1.1.jar (60 KB at 40.0 K
B/sec)
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building lwjgl-linux-64 2.4.2
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-help-plugin:2.1.1:effective-pom (default-cli) @ lwjgl-linux-64
---

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


Re: odd behavior with m3-beta-1

Posted by Brian Fox <br...@infinity.nu>.
Ok I think I understand now. The project.build.plugins are searched so
that they would override the pluginGroup metadata for the prefix...AND
all the default plugins are now in project.build.plugins instead of
pluginManagement. This is the bigger change here but the upshot is
that effective-pom now shows all the default bindings to the user.
Previously it was all magic. That's a good tradeoff for a few
downloads the first time run.

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


Re: odd behavior with m3-beta-1

Posted by Benjamin Bentmann <be...@udo.edu>.
Brian Fox:

> I put this on my desktop and ran:
>
> c:\Users\brianf\Desktop>mvn help:effective-pom
>
> And it started downloading all updated versions of the
> plugins...plugins that aren't being used in this execution and aren't
> referenced in the pom directly.

In short, the plugin JARs (and only those) are downloaded to resolve the 
plugin prefix "help" from your command. Executing

   mvn org.apache.maven.plugins:maven-help-plugin:effective-pom

wouldn't have downloaded anything but the Help Plugin and its dependencies.

As a reminder, to resolve a plugin prefix Maven looks in these locations
1. project.build.plugins
2. project.build.pluginManagement.plugins
3. settings.pluginGroups
See also [0].

The other thing that contributes to your log is the fact that Maven 3 
merges the lifecycle bindings into the effective POM (see also [1]). In 
other words, the Compiler Plugin, Resources Plugin etc. will now show up 
in the effective POM's build/plugins section (along with their default 
executions) as if the user had defined them.

So to summarize, the maven-x-plugin.jar was downloaded because
a) maven-x-plugin was present in project.build.plugins
b) project.build.plugins was searched for a prefix match with "help"


Benjamin


[0] http://jira.codehaus.org/browse/MNG-2432
[1] http://jira.codehaus.org/browse/MPH-13

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