8 Replies Latest reply on Jun 12, 2007 10:33 AM by Paul Gier

    What is this circular dependency issue in common-core?

    Scott Stark Master

      Why is common-core failing to release due to a dependency on itself?

      [starksm@succubus common-core]$ mvn release:prepare -DdryRun=true
      [INFO] Scanning for projects...
      [INFO] Searching repository for plugin with prefix: 'release'.
      [INFO] ----------------------------------------------------------------------------
      [INFO] Building JBoss Common Classes
      [INFO] task-segment: [release:prepare] (aggregator-style)
      [INFO] ----------------------------------------------------------------------------
      [INFO] [release:prepare]
      [INFO] Resuming release from phase 'check-dependency-snapshots'
      [INFO] Checking dependencies and plugins for snapshots ...
      [INFO] ------------------------------------------------------------------------
      [ERROR] BUILD FAILURE
      [INFO] ------------------------------------------------------------------------
      [INFO] Can't release project due to non released dependencies :
       jboss:jboss-common:pom:2.2.0-SNAPSHOT
      in project 'JBoss Common Classes' (jboss:jboss-common-core:jar:2.2.0-SNAPSHOT)
      [INFO] ------------------------------------------------------------------------
      [INFO] For more information, run Maven with the -e switch
      [INFO] ------------------------------------------------------------------------
      [INFO] Total time: 1 second
      [INFO] Finished at: Thu Jun 07 14:26:36 PDT 2007
      [INFO] Final Memory: 11M/170M
      [INFO] ------------------------------------------------------------------------
      



        • 1. Re: What is this circular dependency issue in common-core?
          Paul Gier Master

          Looks like it doesn't like the dependency on the snapshot version of the parent. You can try to release from the parent pom, but then you would have to release all the modules together.

          If it's ok, I'd like to remove the module list from the parent pom (under the build directory). Then the project parent can be released just as a pom . And the modules can be released individually.

          • 3. Re: What is this circular dependency issue in common-core?
            Paul Gier Master

            I released the common parent to 2.2.0. But there seems to still be a problem with dependency resolution, because of the purge local repository. I'll try to either get this one to work, or I can switch to a new parent version.

            • 4. Re: What is this circular dependency issue in common-core?
              Paul Gier Master

              Ok, I think it should be good to go now. If you grab the updates from svn, then the release should be ok. I removed the purge local repository step from the parent pom because that seemed to be causing the problem. So that part might have to be a manual step until I figure out how to better automate it.

              For the common project, I'd like to remove the common parent since each of the common modules have their own release schedule and are separate in svn. Most of the configuration is in the jboss-parent anyway, so I will probably just have the modules point directly to that one.

              • 5. Re: What is this circular dependency issue in common-core?
                Scott Stark Master

                It still was not building for me:

                [starksm@succubus common-core]$ mvn release:prepare -DdryRun=true
                [INFO] Scanning for projects...
                Downloading: http://repo1.maven.org/maven2/jboss/jboss-common/2.2.1/jboss-common-2.2.1.pom
                [WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
                [INFO] ------------------------------------------------------------------------
                [ERROR] FATAL ERROR
                [INFO] ------------------------------------------------------------------------
                [INFO] Failed to resolve artifact.
                
                GroupId: jboss
                ArtifactId: jboss-common
                Version: 2.2.1
                
                Reason: Unable to download the artifact from any repository
                
                 jboss:jboss-common:pom:2.2.1
                
                from the specified remote repositories:
                 central (http://repo1.maven.org/maven2)
                
                
                [INFO] ------------------------------------------------------------------------
                [INFO] Trace
                org.apache.maven.reactor.MavenExecutionException: Cannot find parent: jboss:jboss-common for project: null:jboss-common-core:jar:2.2.0-SNAPSHOT
                 at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:365)
                 at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:278)
                 at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:115)
                 at org.apache.maven.cli.MavenCli.main(MavenCli.java:256)
                 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:585)
                 at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
                 at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
                 at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
                 at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
                Caused by: org.apache.maven.project.ProjectBuildingException: Cannot find parent: jboss:jboss-common for project: null:jboss-common-core:jar:2.2.0-SNAPSHOT
                 at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1161)
                 at org.apache.maven.project.DefaultMavenProjectBuilder.buildInternal(DefaultMavenProjectBuilder.java:674)
                 at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:416)
                 at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:192)
                 at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:515)
                 at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:447) at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:351)
                 ... 11 more
                Caused by: org.apache.maven.project.ProjectBuildingException: POM 'jboss:jboss-common' not found in repository: Unable to download the artifact from any repository
                
                 jboss:jboss-common:pom:2.2.1
                
                from the specified remote repositories:
                 central (http://repo1.maven.org/maven2)
                
                 at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:513)
                 at org.apache.maven.project.DefaultMavenProjectBuilder.assembleLineage(DefaultMavenProjectBuilder.java:1157)
                 ... 17 more
                Caused by: org.apache.maven.artifact.resolver.ArtifactNotFoundException: Unable to download the artifact from any repository
                
                 jboss:jboss-common:pom:2.2.1
                
                from the specified remote repositories:
                 central (http://repo1.maven.org/maven2)
                
                 at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:136)
                 at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:63)
                 at org.apache.maven.project.DefaultMavenProjectBuilder.findModelFromRepository(DefaultMavenProjectBuilder.java:467)
                 ... 18 more
                Caused by: org.apache.maven.wagon.ResourceDoesNotExistException: Unable to download the artifact from any repository
                 at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifact(DefaultWagonManager.java:260)
                 at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:124)
                 ... 20 more
                [INFO] ------------------------------------------------------------------------
                [INFO] Total time: < 1 second
                [INFO] Finished at: Mon Jun 11 16:50:46 PDT 2007
                [INFO] Final Memory: 2M/74M
                [INFO] ------------------------------------------------------------------------
                


                until I updated my local repository maven2/jboss/jboss-common location to pull in the new parent pom.


                • 8. Re: What is this circular dependency issue in common-core?
                  Paul Gier Master

                   

                  "scott.stark@jboss.org" wrote:
                  It still was not building for me:

                  [starksm@succubus common-core]$ mvn release:prepare -DdryRun=true
                  etc...
                  


                  until I updated my local repository maven2/jboss/jboss-common location to pull in the new parent pom.


                  Sorry about that, I guess when it looked in the relative path, it only found the new snapshot version. And the common-core pom didn't have the jboss repository listed, so it didn't know to get it from there.

                  I changed the common projects so that they now extend directly from the jboss-parent. And they now have the appropriate repository configuration so that they can find the parent.

                  The common projects will also be getting a group ID of "org.jboss" now instead of just "jboss". This will follow the maven conventions a little better, and allow us to differentiate open source projects vs. commercial projects (com.jboss) in the future if we want to.