Uploaded image for project: 'Bamboo Data Center'
  1. Bamboo Data Center
  2. BAM-9455

Automatic Maven dependency processor fails to resolve parent project

    XMLWordPrintable

Details

    • Bug
    • Resolution: Handled by Support
    • Medium
    • None
    • 3.1
    • Dependencies
    • None
    • Standalone, Linux, JDK 1.6.0_24, Maven 3.0.3

    Description

      I've noticed that automatic build dependencies stopped working after somewhere along the way of upgrades from bamboo 2.6 (I must have missed relevant release notes entry). After a quick glance at the configuration panels I've figured out that I need to add a 'Maven Dependencies Processor' task to my build plan. Unfortunately the task fails, despite the fact that Maven 2.x task in the same job succeeds. Error message is

      03-Aug-2011 11:34:48	Automatic Maven plan dependencies processing failed: Cannot find parent: org.objectledge:ledge-common for project: null:ledge-components:jar:null for project null:ledge-components:jar:null
      

      It appears that Maven Dependency Processor task has trouble resolving the parent project from a remote repository. Here's how my setup looks like.

      ledege-components/pom.xml
      <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>
        <parent>
          <groupId>org.objectledge</groupId>
          <artifactId>ledge-common</artifactId>
          <relativePath>../ledge-common/pom.xml</relativePath>
          <version>1.0.11-SNAPSHOT</version>
        </parent>
        <artifactId>ledge-components</artifactId>
        <packaging>jar</packaging>
        <!-- ... -->
      </project>
      
      ledge-common/pom.xml
      <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.objectledge</groupId>
        <artifactId>ledge-common</artifactId>
        <packaging>pom</packaging>
        <version>1.0.11-SNAPSHOT</version>
        <!-- ... -->
        <repositories>
          <repository>
            <id>nexus</id>
            <name>Objectledge Nexus repository</name>
            <url>http://objectledge.org/nexus/content/groups/m2</url>      
            <releases>
              <enabled>true</enabled>
            </releases>
            <snapshots>
              <enabled>true</enabled>
              <updatePolicy>never</updatePolicy>
            </snapshots>
          </repository>
        </repositories>
        <pluginRepositories>
          <pluginRepository>
            <id>nexus</id>
            <name>Objectledge Nexus repository (plugins)</name>
            <url>http://objectledge.org/nexus/content/groups/m2</url>
            <releases>
              <enabled>true</enabled>
            </releases>
            <snapshots>
              <enabled>true</enabled>
              <updatePolicy>never</updatePolicy>
            </snapshots>
          </pluginRepository>
        </pluginRepositories>
        <distributionManagement>
          <repository>
            <id>nexus.objectledge.org</id>
            <name>ObjectLedge releases Nexus repository</name>
            <url>http://nexus.objectledge.org/nexus/content/repositories/m2releases</url>
          </repository>
          <snapshotRepository>
            <id>nexus.objectledge.org</id>
            <name>ObjectLedge snapshots Nexus repository</name>
            <url>http://nexus.objectledge.org/nexus/content/repositories/m2snapshots</url>
          </snapshotRepository>
        </distributionManagement>
      </project>
      
      settings.xml
      <settings xmlns="http://maven.apache.org/settings/1.0.0"
                xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
                xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
        <interactiveMode>false</interactiveMode>
        <servers>
          <server>
            <id>nexus.objectledge.org</id>
            <username>bamboo</username>
            <password>***********</password>
          </server>
        </servers>
        <profiles>
          <profile>
            <id>bamboo</id>
            <activation>
               <activeByDefault>true</activeByDefault>
            </activation>
            <repositories>
              <repository>
                <snapshots>
                  <enabled>true</enabled>
                </snapshots>
                <id>objectledge.snapshots</id>
                <name>ObjectLedge snapshots repository</name>
                <url>http://objectledge.org/nexus/content/repositories/m2snapshots</url>
              </repository>
            </repositories>
            <pluginRepositories>
              <pluginRepository>
                <snapshots>
                  <enabled>true</enabled>
                </snapshots>
                <id>objectledge.snapshots</id>
                <name>ObjectLedge snapshots repository</name>
                <url>http://objectledge.org/nexus/content/repositories/m2snapshots</url>
              </pluginRepository>
            </pluginRepositories>
          </profile>
        </profiles>
      </settings>
      

      As you see I am using Nexus repository manager. SNAPSHOT artifacts built by bamboo are deployed to a dedicated repository. Both Nexus and Bamboo have artifact retention policies, but Maven2 has not. Whatever goes into the local repository, stays there. In order to avoid SNAPSHOT artifact buildup, I have a Bamboo plan running on fixed schedule that removes SNAPSHOTs from bamboo users local repository. Because of this, in order to build ledge-components module (and others), the parent POM needs to be resolved from remote repository. There's a catch - remote repository location is defined in the parent POM itself. That's why bamboo user needs the to have the repository defined in it's default Maven profile in order to bootstrap the build after the local repository has been purged.

      This setup works the ordinary Bamboo builds, but Maven Dependency Processor fails resolve the parent project as indicated by error message above.

      I also did another test an executed sudo -u bamboo mvn dependency:list from the build-dir, which I imagine is quite similar to whatever the dependency processor is doing, and it worked without problems.

      Too bad I cannot set maven options for the decadency processor task, a -X could shed some light on the issue.

      Attachments

        Activity

          People

            rbattaglin Renan Battaglin
            7b4781c3305c rkrzewski
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: