13 Replies Latest reply on Apr 2, 2008 10:57 AM by pgier

    Dependency conflicts lost during AS mavenization

    heiko.braun

      I am currently looking at two projects sharing a dependency, with each specifying a different version. During the AS build this conflict is not recognized anymore.

      I.e. the metadata project refers to jbossws-spi 1.0.0.GA, but the latest AS 5 build ships with jbossws-spi 1.0.2.GA. Event though these versions are compatible, lack of an explicit compatibility statement should cause a dependency error when building the AS.

        • 1. Re: Dependency conflicts lost during AS mavenization
          dimitris

          In the legacy build, jbossws-spi is only referenced by jbossws modules.

          In the maven thirdparty build, jbossws-spi is imported from 2 different places (jboss.jbossws-spi vs org.jboss)

          Both seem wrong. Shouldn't be org.jboss.jbossws:jbossws-spi or org.jboss.jbossws-spi:jbossws-spi ?

          ...
           +- jboss.jbossws-spi:jbossws-spi:jar:1.0.3-SNAPSHOT:compile
          ...
           +- org.jboss:jboss-metadata:jar:1.0.0-SNAPSHOT:compile
           | +- org.jboss:jbossws-spi:jar:1.0.0.GA:compile
          


          • 2. Re: Dependency conflicts lost during AS mavenization
            heiko.braun

            Which module is referring to ' jboss.jbossws-spi:jbossws-spi:jar' ?

            • 3. Re: Dependency conflicts lost during AS mavenization
              heiko.braun

              OK, we stick to this name:

              org.jboss:jbossws-spi:jar:
              


              • 4. Re: Dependency conflicts lost during AS mavenization
                wolfc

                Another caveat:

                [carlo@nymph interceptors]$ mvn dependency:tree
                [INFO] Scanning for projects...
                [INFO] Searching repository for plugin with prefix: 'dependency'.
                WAGON_VERSION: 1.0-beta-2
                [INFO] ------------------------------------------------------------------------
                [INFO] Building JBoss EJB 3.0 Interceptors
                [INFO] task-segment: [dependency:tree]
                [INFO] ------------------------------------------------------------------------
                Downloading: http://repository.jboss.org/maven2/org/jboss/jbossws-spi/1.0.2.GA/jbossws-spi-1.0.2.GA.pom
                Downloading: http://repo1.maven.org/maven2/org/jboss/jbossws-spi/1.0.2.GA/jbossws-spi-1.0.2.GA.pom
                Downloading: http://repository.jboss.org/maven2/org/jboss/jbossws-spi/1.0.2.GA/jbossws-spi-1.0.2.GA.jar
                Downloading: http://repository.jboss.org/maven2/org/jboss/jbossws-spi/1.0.2.GA/jbossws-spi-1.0.2.GA.jar
                Downloading: http://repo1.maven.org/maven2/org/jboss/jbossws-spi/1.0.2.GA/jbossws-spi-1.0.2.GA.jar
                [INFO] ------------------------------------------------------------------------
                [ERROR] BUILD ERROR
                [INFO] ------------------------------------------------------------------------
                [INFO] Failed to resolve artifact.
                
                Missing:
                ----------
                1) org.jboss:jbossws-spi:jar:1.0.2.GA
                
                 Try downloading the file manually from the project website.
                
                 Then, install it using the command:
                 mvn install:install-file -DgroupId=org.jboss -DartifactId=jbossws-spi -Dversion=1.0.2.GA -Dpackaging=jar -Dfile=/path/to/file
                
                 Alternatively, if you host your own repository you can deploy the file there:
                 mvn deploy:deploy-file -DgroupId=org.jboss -DartifactId=jbossws-spi -Dversion=1.0.2.GA -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
                
                 Path to dependency:
                 1) org.jboss.ejb3:jboss-ejb3-interceptors:jar:0.12.0-SNAPSHOT
                 2) org.jboss:jboss-metadata:jar:1.0.0-SNAPSHOT
                 3) org.jboss:jbossws-spi:jar:1.0.2.GA
                
                ----------
                1 required artifact is missing.
                
                for artifact:
                 org.jboss.ejb3:jboss-ejb3-interceptors:jar:0.12.0-SNAPSHOT
                
                from the specified remote repositories:
                 central (http://repo1.maven.org/maven2),
                 jboss-snapshots (http://snapshots.jboss.org/maven2),
                 repository.jboss.com (http://repository.jboss.org/maven2)
                
                
                [INFO] ------------------------------------------------------------------------
                [INFO] For more information, run Maven with the -e switch
                [INFO] ------------------------------------------------------------------------
                [INFO] Total time: 3 seconds
                [INFO] Finished at: Wed Apr 02 09:10:05 CEST 2008
                [INFO] Final Memory: 8M/102M
                [INFO] ------------------------------------------------------------------------


                r4111 | heiko.braun@jboss.com | 2008-04-02 09:08:49 +0200 (Wed, 02 Apr 2008) | 1
                 line
                
                jbossws spi 1.0.2 artifacts added


                A snapshot artificat (jboss-metadata) arrives at the final repository before a released artifact (jbossws-spi).

                I'm going to need strong coffee today.

                • 5. Re: Dependency conflicts lost during AS mavenization
                  heiko.braun

                  Could you explain what's going on to me? I simply added the new spi to the repo...

                  • 6. Re: Dependency conflicts lost during AS mavenization
                    heiko.braun

                    BTW, I don't see this error...

                    • 7. Re: Dependency conflicts lost during AS mavenization
                      dimitris

                       

                      "heiko.braun@jboss.com" wrote:
                      OK, we stick to this name:
                      org.jboss:jbossws-spi:jar:
                      

                      'org.jboss' as groupId is wrong:
                      http://wiki.jboss.org/wiki/Wiki.jsp?page=MavenProjectNaming

                      You should be using whatever is your base package name.



                      • 8. Re: Dependency conflicts lost during AS mavenization
                        heiko.braun

                        ok, I am going to change that.

                        • 9. Re: Dependency conflicts lost during AS mavenization
                          heiko.braun

                          I'd like to remove all legacy artifacts (wrong group-id) from the repo. This would force anyone to update (because the build breaks). But I am not sure about the implications.

                          Does this require any dependent project to republish it's artifacts and pom or can an existing repo artifacts simply be updated?

                          • 10. Re: Dependency conflicts lost during AS mavenization
                            alrubinger

                            Probably should copy this to jboss-dev :)

                            S,
                            ALR

                            • 11. Re: Dependency conflicts lost during AS mavenization
                              dimitris

                              I guess you can only move the latest stuff you are currently working on, for which no tagged release of another project depends upon.

                              • 12. Re: Dependency conflicts lost during AS mavenization
                                pgier

                                 

                                "heiko.braun@jboss.com" wrote:
                                I'd like to remove all legacy artifacts (wrong group-id) from the repo. This would force anyone to update (because the build breaks). But I am not sure about the implications.

                                Does this require any dependent project to republish it's artifacts and pom or can an existing repo artifacts simply be updated?


                                The risk of doing this is that it can break old builds that depend on the old groupId. The official maven way to move artifacts around in a repository is to add a relocation configuration to the pom (http://maven.apache.org/ref/2.0.4/maven-model/maven.html#class_relocation).

                                What would you think if we create a new location in the repository for stuff that is in the repository but should have been in a different place?

                                So maybe something like http://repository.jboss.org/maven2_legacy.
                                This way we can remove stuff from the main repository to make it cleaner, and if we want to build older releases that depend on some of these things, this legacy repo location just needs to be added to settings.xml.



                                • 13. Re: Dependency conflicts lost during AS mavenization
                                  pgier

                                  Another benefit to having a separate location for legacy stuff is that it will be very easy to see if a build is depending on something that it shouldn't be depending on. With the legacy repo off, the build will fail when it can't find the old artifact.