Hi,

I have a multi module build pom with 3 modules. Each module inherits
from the parent pom.

Parent
  ProjectA (dotnet-library)
  ProjectB (dotnet-library , depends on ProjectA)
  ProjectC (dotnet-library , depends on ProjectB and uses
maven-dependency-plugin plugin)

* All 3 child poms inherit group id and version from the parent pom
* the version-dependencies between the projects are declared using a
property: <version>${project.version}</version>

Using this minimal setup I can successfully compile the projects. As
soon as I add maven's maven-dependency-plugin plugin I get compile
errors. I was not sure if this behavior was related to npanday (1.4.0)
or is a general issue with maven (3.0.3), so I made a test. In plain
java there is no problem, so it seems to be related to npanday.

The error looks as follows:

[ERROR] Failed to execute goal on project ProjectC: Could not resolve
dependencies for project
MavenDependencies:ProjectC:dotnet-library:1.0-SNAPSHOT: Could not find
artifact MavenDependencies:ProjectA:dll:${project.version} in central
(http://artifactory:8081/artifactory/libs-releases) -> [Help 1]

I want to mention the following things:

* It's obvious that the expression ${project.version} failed to evaluate
to 1.0-SNAPSHOT
* in my local repository the following folder pops up:
ProjectA\${project.version} 
* This error only occurs if there are at least 3 projects (if project B
uses the dependency plugin, it works)
* if project dependencies are explicit (1.0-SNAPSHOT), then everything
works fine.
 

With the current version of npanday it does not seem possible to put the
information like the 'version' to the parent pom, as other unrelated
plugins will just fail. 


Best regards,
Sergio


PARENT POM:

<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/maven-v4_0_0.xsd";>
  <modelVersion>4.0.0</modelVersion>
  <groupId>MavenDependencies</groupId>
  <artifactId>Parent</artifactId>
  <packaging>pom</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>PARENT POM</name>
  <build>
    <sourceDirectory>src/main</sourceDirectory>
    <plugins>
      <plugin>
        <!-- Include npanday and configure it.-->
        <groupId>org.apache.npanday.plugins</groupId>
        <artifactId>maven-compile-plugin</artifactId>
        <version>1.4.0-incubating</version>
        <extensions>true</extensions>
      </plugin>
    </plugins>
  </build>
  <modules>
    <module>ProjectA</module>
    <module>ProjectB</module>
    <module>ProjectC</module>
  </modules>
</project>


PROJECT A:

<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/maven-v4_0_0.xsd";>
  <parent>
    <groupId>MavenDependencies</groupId>
    <artifactId>Parent</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <groupId>MavenDependencies</groupId>
  <artifactId>ProjectA</artifactId>
  <packaging>dotnet-library</packaging>
  <version>1.0-SNAPSHOT</version>
  <name>Project A</name>
</project>


PROJECT B:

<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/maven-v4_0_0.xsd";>
  <parent>
    <groupId>MavenDependencies</groupId>
    <artifactId>Parent</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <packaging>dotnet-library</packaging>
  <artifactId>ProjectB</artifactId>
  <name>Project B</name>

  <dependencies>
    <dependency>
      <groupId>MavenDependencies</groupId>
      <artifactId>ProjectA</artifactId>
      <version>${project.version}</version>
      <type>dotnet-library</type>
    </dependency>
  </dependencies>
</project>


PROJECT C:

<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/maven-v4_0_0.xsd";>
  <parent>
    <groupId>MavenDependencies</groupId>
    <artifactId>Parent</artifactId>
    <version>1.0-SNAPSHOT</version>
  </parent>
  <modelVersion>4.0.0</modelVersion>
  <packaging>dotnet-library</packaging>
  <artifactId>ProjectC</artifactId>
  <name>Project C</name>
  <build>
    <plugins>
      <!-- IF YOU REMOVE THIS PLUGIN, IT WILL COMPILE WITH NPANDAY-->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-dependency-plugin</artifactId>
        <extensions>true</extensions>
        <version>2.3</version>
        <executions>
          <execution>
            <id>copy-dependencies</id>
            <phase>validate</phase>
            <goals>
              <goal>copy-dependencies</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
    </plugins>
  </build>
  <dependencies>
    <dependency>
      <groupId>MavenDependencies</groupId>
      <artifactId>ProjectB</artifactId>
      <version>${project.version}</version>
      <type>dotnet-library</type>
    </dependency>
  </dependencies>
</project>

Reply via email to