Hello Nick

I have added

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <executions>
        <execution>
            <id>analyze</id>
            <phase>verify</phase>
            <goals>
                <goal>analyze-dep-mgt</goal>
            </goals>
            <configuration>
                <failBuild>true</failBuild>
                <ignoreDirect>false</ignoreDirect>
            </configuration>
        </execution>
    </executions>
</plugin>

in the child project which is using the company pom.

The build still succeds:

[INFO] [dependency:analyze-dep-mgt {execution: analyze}]
[INFO] Found Resolved Dependency / DependencyManagement mismatches:
[INFO]  Dependency: org.json:json:jar
[INFO]          DepMgt  : [1.0.2]
[INFO]          Resolved: 1.0.2
[INFO]  Dependency: commons-lang:commons-lang:jar
[INFO]          DepMgt  : [2.4]
[INFO]          Resolved: 2.4
[INFO]  Dependency: log4j:log4j:jar
[INFO]          DepMgt  : [1.2.14]
[INFO]          Resolved: 1.2.14
[INFO]  Dependency: opensymphony:quartz-all:jar
[INFO]          DepMgt  : [1.6.5]
[INFO]          Resolved: 1.6.5
[INFO]  Dependency: org.apache.cayenne:cayenne-server:jar
[INFO]          DepMgt  : [3.0M6]
[INFO]          Resolved: 3.0M5
[INFO]  Dependency: mysql:mysql-connector-java:jar
[INFO]          DepMgt  : [5.0.6]
[INFO]          Resolved: 5.0.6
[INFO]    None
[INFO]
------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO]
------------------------------------------------------------------------

Focus on the org.apache.cayenne:cayenne-server:jar.

In my child project there is:

<dependency>
    <groupId>org.apache.cayenne</groupId>
    <artifactId>cayenne-server</artifactId>
    <version>[3.0M5]</version>
</dependency>

and in company pom:

<dependencyManagement>
        <dependency>
            <groupId>org.apache.cayenne</groupId>
            <artifactId>cayenne-server</artifactId>
            <version>[3.0M6]</version>
        </dependency>
    </dependencies>
</dependencyManagement>

I am using Maven 2.2.0:
Apache Maven 2.2.0 (r788681; 2009-06-26 15:04:01+0200)
Java version: 1.6.0_16
Java home: C:\Java\jdk1.6.0_16\jre
Default locale: sl_SI, platform encoding: Cp1250
OS name: "windows xp" version: "5.1" arch: "x86" Family: "windows"

What am I missing? I want build to fail if some developer is trying to build
an artifact which has version conflict.

-Borut


2009/10/20 Nick Stolwijk <nick.stolw...@gmail.com>

> That is because you didn't enforce maven to fail the build. Take a look at
> the dependencies plugin [1]
>
> [1]
>
> http://maven.apache.org/plugins/maven-dependency-plugin/analyze-dep-mgt-mojo.html#failBuild
>
> Hth,
>
> Nick Stolwijk
> ~Java Developer~
>
> IPROFS BV.
> Claus Sluterweg 125
> 2012 WS Haarlem
> http://www.iprofs.nl
>
>
> On Tue, Oct 20, 2009 at 11:39 AM, Borut Bolčina <borut.bolc...@gmail.com
> >wrote:
>
> > Hi,
> >
> > if in parent pom (company POM for example):
> >
> > <dependencyManagement>
> >    <dependencies>
> >        <dependency>
> >            <groupId>com.acme</groupId>
> >            <artifactId>coyote-tornado-kit</artifactId>
> >            <version>[1.0.0]</version>
> >        </dependency>
> > </dependencyManagement>
> >
> > and in some project:
> >
> > <dependencies>
> >    <dependency>
> >        <groupId>com.acme</groupId>
> >        <artifactId>coyote-tornado-kit</artifactId>
> >        <version>[2.0.0]</version>
> >    </dependency>
> > </dependencies>
> >
> > then I would expect build to fail becouse hard versions are used. Why is
> > that not so?
> >
> > -Borut
> >
>

Reply via email to