Maven will use the first version of a plugin it sees, so somewhere in
your workspace you have an old version of the dependency plugin and when
running the other projects, it is still using this old version.

-----Original Message-----
From: Rune Flobakk [mailto:[EMAIL PROTECTED] 
Sent: Thursday, September 04, 2008 6:32 AM
To: users@maven.apache.org
Subject: maven-dependency-plugin 2.0 fails when running eclipse:eclipse

Hello,

On my project we have quite a large codebase separated in several Maven
multimodule projects. In one of the parent poms I have configured to use
maven-dependency-plugin to verify that we use dependencies
appropriately, as described here:
http://maven.apache.org/plugins/maven-dependency-plugin/examples/failing
-the-build-on-dependency-analysis-warnings.html

Snippet from our parent pom:
<build>
  ...
    <plugin>
      <groupId>org.apache.maven.plugins</groupId>
      <artifactId>maven-dependency-plugin</artifactId>
    </plugin>
  </plugins>
  <pluginManagement>
    <plugins>
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <version>2.0</version>
        <executions>
          <execution>
            <id>analyze</id>
            <phase>verify</phase>
            <goals>
              <goal>analyze-only</goal>
            </goals>
            <configuration>
              <failOnWarning>true</failOnWarning>
              <ignoreNonCompile>true</ignoreNonCompile>
            </configuration>
          </execution>
        </executions>
      </plugin>
    ...
  </pluginManagement>
</build>

When I run any lifecycle phase including verify (e.g. install, deploy)
from that parent pom, every child module gets its dependency use
checked, and the build fails on violations. All well!

But when I run eclipse:eclipse and specifies a "workspace" pom, which
only lists modules from many different projects, some external to this
project but still internal to the organization, for some reason Maven
seems to do "something" with the maven-dependency-plugin execution
config for that one multimodule project. The problem as I understand it,
is that the projects involved in the "workspace" pom uses different
versions of maven-dependency-plugin, and I see that Maven downloads both
2.0-alpha-4 and 2.0 when I run eclipse:eclipse.

The error message I get from Maven is this:
[INFO]
------------------------------------------------------------------------
[INFO] Building project-x
[INFO]    task-segment: [eclipse:eclipse]
[INFO]
------------------------------------------------------------------------
[INFO] Preparing eclipse:eclipse
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] 'analyze-only' was specified in an execution, but not found in
the plugin [INFO]
------------------------------------------------------------------------

When building project-x on its own, everything is OK. So why does Maven
get confused on which plugin version it should use when the project-x is
included as one of many modules of a super-super-pom?

Sorry for a very verbose mail, I hope it's possible to understand the
problem. Thanks in advance for any help :)

Regards,
Rune Flobakk


---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to