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

Automatic Maven dependency processor fails to resolve parent project

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

      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.

          Form Name

            [BAM-9455] Automatic Maven dependency processor fails to resolve parent project

            Monique Khairuliana (Inactive) made changes -
            Workflow Original: Bamboo Workflow 2016 v1 - Restricted [ 1433228 ] New: JAC Bug Workflow v3 [ 3378034 ]
            Status Original: Resolved [ 5 ] New: Closed [ 6 ]
            Owen made changes -
            Workflow Original: Bamboo Workflow 2016 v1 [ 1406546 ] New: Bamboo Workflow 2016 v1 - Restricted [ 1433228 ]
            Marek Went (Inactive) made changes -
            Workflow Original: Bamboo Workflow 2014 v2 [ 606573 ] New: Bamboo Workflow 2016 v1 [ 1406546 ]
            James Dumay made changes -
            Workflow Original: Bamboo Workflow 2014 [ 593934 ] New: Bamboo Workflow 2014 v2 [ 606573 ]
            James Dumay made changes -
            Workflow Original: Bamboo Workflow 2010 [ 340045 ] New: Bamboo Workflow 2014 [ 593934 ]
            Renan Battaglin made changes -
            Resolution New: Handled by Support [ 8 ]
            Status Original: Open [ 1 ] New: Resolved [ 5 ]

            Rafal,

            If you have more problems with the patched file in the newer Bamboo versions, please create a ticket at https://support.atlassian.com. It will allow us to exchange log files and other instance details, keeping your data private (https://jira.atlassian.com/ is a public instance).

            Thanks in advance,
            Renan

            Renan Battaglin added a comment - Rafal, If you have more problems with the patched file in the newer Bamboo versions, please create a ticket at https://support.atlassian.com . It will allow us to exchange log files and other instance details, keeping your data private ( https://jira.atlassian.com/ is a public instance). Thanks in advance, Renan

            Hi Rafal,

            It seems that Bamboo 3.1.1 is bottom limit for the patched file. Would you be able to upgrade the instance to 3.1.1 or newer versions?

            Also, I've noticed that you are using Maven 3.0.3. Maven dependency processor used in Bamboo 3.1 and 3.2 uses maven-embedder-2.0.4 library which cannot parse maven-3 formatted files. We are tacking the problem at BAM-9342 and planning to have it fixed in our next release.

            Thanks,
            Renan

            Renan Battaglin added a comment - Hi Rafal, It seems that Bamboo 3.1.1 is bottom limit for the patched file. Would you be able to upgrade the instance to 3.1.1 or newer versions? Also, I've noticed that you are using Maven 3.0.3. Maven dependency processor used in Bamboo 3.1 and 3.2 uses maven-embedder-2.0.4 library which cannot parse maven-3 formatted files. We are tacking the problem at BAM-9342 and planning to have it fixed in our next release. Thanks, Renan

            rkrzewski added a comment -

            I got the following NoClassDefFoundError. It seems I need to upgrade to Bamboo 3.2 first, correct?

            java.lang.NoClassDefFoundError: com/atlassian/bamboo/process/CommandlineStringUtils
            	at com.atlassian.bamboo.plugins.maven.task.AbstractMavenConfig.<init>(AbstractMavenConfig.java:59)
            	at com.atlassian.bamboo.plugins.maven.task.Maven2Config.<init>(Maven2Config.java:24)
            	at com.atlassian.bamboo.plugins.maven.task.Maven2BuildTask.execute(Maven2BuildTask.java:63)
            	at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:117)
            	at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:69)
            	at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87)
            	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
            	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
            	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
            	at java.lang.reflect.Method.invoke(Method.java:597)
            	at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149)
            	at org.springframework.orm.hibernate.HibernateInterceptor.invoke(HibernateInterceptor.java:117)
            	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171)
            	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204)
            	at $Proxy421.call(Unknown Source)
            	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:192)
            	at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:99)
            	at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:106)
            	at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50)
            	at java.lang.Thread.run(Thread.java:662)
            Caused by: java.lang.ClassNotFoundException: com.atlassian.bamboo.process.CommandlineStringUtils
            	at java.net.URLClassLoader$1.run(URLClassLoader.java:202)
            	at java.security.AccessController.doPrivileged(Native Method)
            	at java.net.URLClassLoader.findClass(URLClassLoader.java:190)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:307)
            	at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301)
            	at java.lang.ClassLoader.loadClass(ClassLoader.java:248)
            	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:417)
            	at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:370)
            	... 22 more
            

            rkrzewski added a comment - I got the following NoClassDefFoundError. It seems I need to upgrade to Bamboo 3.2 first, correct? java.lang.NoClassDefFoundError: com/atlassian/bamboo/process/CommandlineStringUtils at com.atlassian.bamboo.plugins.maven.task.AbstractMavenConfig.<init>(AbstractMavenConfig.java:59) at com.atlassian.bamboo.plugins.maven.task.Maven2Config.<init>(Maven2Config.java:24) at com.atlassian.bamboo.plugins.maven.task.Maven2BuildTask.execute(Maven2BuildTask.java:63) at com.atlassian.bamboo.task.TaskExecutorImpl.executeTasks(TaskExecutorImpl.java:117) at com.atlassian.bamboo.task.TaskExecutorImpl.execute(TaskExecutorImpl.java:69) at com.atlassian.bamboo.build.pipeline.tasks.ExecuteBuildTask.call(ExecuteBuildTask.java:87) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) at java.lang.reflect.Method.invoke(Method.java:597) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:304) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:182) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:149) at org.springframework.orm.hibernate.HibernateInterceptor.invoke(HibernateInterceptor.java:117) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:171) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at $Proxy421.call(Unknown Source) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent.build(DefaultBuildAgent.java:192) at com.atlassian.bamboo.v2.build.agent.BuildAgentControllerImpl.waitAndPerformBuild(BuildAgentControllerImpl.java:99) at com.atlassian.bamboo.v2.build.agent.DefaultBuildAgent$1.run(DefaultBuildAgent.java:106) at com.atlassian.bamboo.build.pipeline.concurrent.NamedThreadFactory$2.run(NamedThreadFactory.java:50) at java.lang. Thread .run( Thread .java:662) Caused by: java.lang.ClassNotFoundException: com.atlassian.bamboo.process.CommandlineStringUtils at java.net.URLClassLoader$1.run(URLClassLoader.java:202) at java.security.AccessController.doPrivileged(Native Method) at java.net.URLClassLoader.findClass(URLClassLoader.java:190) at java.lang. ClassLoader .loadClass( ClassLoader .java:307) at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:301) at java.lang. ClassLoader .loadClass( ClassLoader .java:248) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:417) at org.eclipse.jetty.webapp.WebAppClassLoader.loadClass(WebAppClassLoader.java:370) ... 22 more

            Hi Rafal,

            It seems that you are having the same issue reported at BAM-9331 (Maven Dependencies Processor not working as it could not save the "Alternate location of settings.xml" and "Path to Maven local repository" values). Would you confirm if applying the patch provided at BAM-9331 and then setting the fields correctly help to fix the problem?

            Regards,
            Renan

            Renan Battaglin added a comment - Hi Rafal, It seems that you are having the same issue reported at BAM-9331 (Maven Dependencies Processor not working as it could not save the "Alternate location of settings.xml" and "Path to Maven local repository" values). Would you confirm if applying the patch provided at BAM-9331 and then setting the fields correctly help to fix the problem? Regards, Renan

              rbattaglin Renan Battaglin
              7b4781c3305c rkrzewski
              Affected customers:
              0 This affects my team
              Watchers:
              1 Start watching this issue

                Created:
                Updated:
                Resolved: