1 2 Previous Next 16 Replies Latest reply on Oct 29, 2010 11:40 AM by Wang Liyu

    How I loathe thee maven.

    John Ament Master
      So first let it be known, maven and I do not get along.  It never does things the way I want, and I never do things the way it wants.

      However, since jboss uses it heavily I have to use it to integrate jboss "stuffs" into my projects.  So I'm trying to throw weld 1.0 into my jboss 5.1 install (local machine)

      I get this:

      |c:\apps\jboss\weld-1.0.0.SP1\jboss-as>ant update
      Buildfile: build.xml

      install-weld.deployer:
           [echo] Installing Weld 1.0.0-SNAPSHOT to C:/apps/jboss/jboss-current
      [artifact:dependencies] [INFO] snapshot org.jboss.weld.integration:weld-jboss-int:5.2.0-SNAPSHOT: checking for updates from snapshots.jboss.org
      [artifact:dependencies] Downloading: org/jboss/weld/weld-core/1.0.0-SNAPSHOT/weld-core-1.0.0-SNAPSHOT.pom from repository.jboss.org
      [artifact:dependencies] Downloading: org/jboss/weld/weld-core/1.0.0-SNAPSHOT/weld-core-1.0.0-SNAPSHOT.pom from snapshots.jboss.org
      [artifact:dependencies] Downloading: org/jboss/weld/weld-core/1.0.0-SNAPSHOT/weld-core-1.0.0-SNAPSHOT.jar from repository.jboss.org
      [artifact:dependencies] Downloading: org/jboss/weld/weld-core/1.0.0-SNAPSHOT/weld-core-1.0.0-SNAPSHOT.jar from snapshots.jboss.org
      [artifact:dependencies] An error has occurred while processing the Maven artifact tasks.
      [artifact:dependencies]  Diagnosis:
      [artifact:dependencies]
      [artifact:dependencies] Unable to resolve artifact: Missing:
      [artifact:dependencies] ----------
      [artifact:dependencies] 1) org.jboss.weld:weld-core:jar:1.0.0-SNAPSHOT
      [artifact:dependencies]
      [artifact:dependencies]   Try downloading the file manually from the project website.
      [artifact:dependencies]
      [artifact:dependencies]   Then, install it using the command:
      [artifact:dependencies]       mvn install:install-file -DgroupId=org.jboss.weld -DartifactId=weld-core -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
      [artifact:dependencies]
      [artifact:dependencies]   Alternatively, if you host your own repository you can deploy the file there:
      [artifact:dependencies]       mvn deploy:deploy-file -DgroupId=org.jboss.weld -DartifactId=weld-core -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[
      ositoryId=[id]
      [artifact:dependencies]
      [artifact:dependencies]   Path to dependency:
      [artifact:dependencies]         1) org.apache.maven:super-pom:jar:2.0
      [artifact:dependencies]         2) org.jboss.weld:weld-core:jar:1.0.0-SNAPSHOT
      [artifact:dependencies]
      [artifact:dependencies] ----------
      [artifact:dependencies] 1 required artifact is missing.
      [artifact:dependencies]
      [artifact:dependencies] for artifact:
      [artifact:dependencies]   org.apache.maven:super-pom:jar:2.0
      [artifact:dependencies]
      [artifact:dependencies] from the specified remote repositories:
      [artifact:dependencies]   snapshots.jboss.org (http://snapshots.jboss.org/maven2),
      [artifact:dependencies]   central (http://downloads.planetmirror.com/pub/maven2),
      [artifact:dependencies]   repository.jboss.org (http://repository.jboss.org/maven2)
      [artifact:dependencies]
      [artifact:dependencies]

      BUILD FAILED
      c:\apps\jboss\weld-1.0.0.SP1\jboss-as\build.xml:26: Unable to resolve artifact: Missing:
      ----------
      1) org.jboss.weld:weld-core:jar:1.0.0-SNAPSHOT

        Try downloading the file manually from the project website.

        Then, install it using the command:
            mvn install:install-file -DgroupId=org.jboss.weld -DartifactId=weld-core -Dversion=1.0.0-SNAPSHOT -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.weld -DartifactId=weld-core -Dversion=1.0.0-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]

        Path to dependency:
              1) org.apache.maven:super-pom:jar:2.0
              2) org.jboss.weld:weld-core:jar:1.0.0-SNAPSHOT

      ----------
      1 required artifact is missing.

      for artifact:
        org.apache.maven:super-pom:jar:2.0

      from the specified remote repositories:
        snapshots.jboss.org (http://snapshots.jboss.org/maven2),
        central (http://downloads.planetmirror.com/pub/maven2),
        repository.jboss.org (http://repository.jboss.org/maven2)


      Total time: 2 seconds
      c:\apps\jboss\weld-1.0.0.SP1\jboss-as>
      |

      This is what my build.properties looks like:

      |
      # Container a number of properties associated with installing Weld into JBoss AS and running the TCK in JBoss AS
      jboss.home=C:/apps/jboss/jboss-current
      org.jboss.testharness.container.javaOpts=-Xms128m -Xmx512m -XX:MaxPermSize=192m -Dorg.jboss.resolver.warning=true -Dsun.rmi.dgc.client.gcInterval=3600000 -Dsun.rmi.dgc.server.gcInterval=3600000

      # time to allow before attempting to restart JBoss AS
      # org.jboss.testharness.container.shutdownDelay=15000

      # maximum number of TCK tests to deploy before restarting JBoss AS
      # jboss.deployments.restart = 25
      weld-deployer.version=5.2.0-SNAPSHOT
      weld.version=1.0.0-SNAPSHOT
      jboss-ejb3.version=1.0.0
      javassist.version=3.11.0.GA
      validation.version=1.0.CR3
      |

      I tried both weld.version=1.0.0.SP1 as well as SNAPSHOT.  Same result.
        • 1. Re: How I loathe thee maven.
          Nicklas Karlsson Master

          Could be broken repos, I didn't see it when I browsed around, either.

          • 2. Re: How I loathe thee maven.
            John Ament Master
            well then it looks like building the trunk is also broken.  either way, shouldn't this result in building the deployer at some point?  or is my setup just way messed up?

            c:\apps\weld>mvn install
            [INFO] Scanning for projects...
            [INFO] Reactor build order:
            [INFO]   Weld Core BOM
            [INFO]   Weld Core Parent
            [INFO]   Weld Core Implementation
            [INFO]   Weld Core Tests
            [INFO]   Weld Porting Package for the CDI TCK
            [INFO]   AtInject TCK runner for Weld
            [INFO]   CDI TCK runner for Weld
            [INFO]   Weld OSGi Bundle
            [INFO]   Weld Build Aggregator
            [INFO] ------------------------------------------------------------------------
            [INFO] Building Weld Core BOM
            [INFO]    task-segment: [install]
            [INFO] ------------------------------------------------------------------------
            Downloading: http://twdata-m2-repository.googlecode.com/svn/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
            [INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0.1' in repository twdata-m2-repository.googlecode.com (http://twdata-m2-repository.googlecode.com/
            svn)
            Downloading: http://repository.jboss.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
            [INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0.1' in repository repository.jboss.org (http://repository.jboss.org/maven2)
            Downloading: http://downloads.planetmirror.com/pub/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
            [WARNING] Unable to get resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0.1' from repository central (http://repo1.maven.org/maven2): Error transferring file: downloads.
            planetmirror.com
            Downloading: http://repository.jboss.org/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
            [INFO] Unable to find resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0.1' in repository repository.jboss.org (http://repository.jboss.org/maven2)
            Downloading: http://downloads.planetmirror.com/pub/maven2/org/apache/maven/plugins/maven-site-plugin/2.0.1/maven-site-plugin-2.0.1.pom
            [WARNING] Unable to get resource 'org.apache.maven.plugins:maven-site-plugin:pom:2.0.1' from repository central (http://repo1.maven.org/maven2): Error transferring file: downloads.
            planetmirror.com
            [INFO] ------------------------------------------------------------------------
            [ERROR] BUILD ERROR
            [INFO] ------------------------------------------------------------------------
            [INFO] Error building POM (may not be this project's POM).


            Project ID: org.apache.maven.plugins:maven-site-plugin

            Reason: POM 'org.apache.maven.plugins:maven-site-plugin' not found in repository: Unable to download the artifact from any repository

              org.apache.maven.plugins:maven-site-plugin:pom:2.0.1

            from the specified remote repositories:
              planetmirror.com (http://downloads.planetmirror.com/pub/maven2),
              repository.jboss.org (http://repository.jboss.org/maven2),
              snapshots.jboss.org (http://snapshots.jboss.org/maven2),
              twdata-m2-repository.googlecode.com (http://twdata-m2-repository.googlecode.com/svn),
              oss.sonatype.org/jboss-snapshots (http://oss.sonatype.org/content/repositories/jboss-snapshots)

            for project org.apache.maven.plugins:maven-site-plugin


            [INFO] ------------------------------------------------------------------------
            [INFO] For more information, run Maven with the -e switch
            [INFO] ------------------------------------------------------------------------
            [INFO] Total time: 1 second
            [INFO] Finished at: Sun Nov 29 15:09:42 EST 2009
            [INFO] Final Memory: 2M/5M
            [INFO] ------------------------------------------------------------------------
            • 3. Re: How I loathe thee maven.
              John Ament Master

              ok, so i fixed it.  looks like i had an error in my maven settings.xml.  fixed.


              however, after installing, i noticed that the javax.inject jar file doesn't get installed anywhere.  should this be copied to common/lib? 

              • 4. Re: How I loathe thee maven.
                Steven Boscarine Apprentice

                John Ament wrote on Nov 29, 2009 16:55:


                So first let it be known, maven and I do not get along.  It never does things the way I want, and I never do things the way it wants.



                Your complaint applies to any convention over configuration technology.  You could say the same about Grails, Rails, and CDI.  The agreement is you do things it's way and then you do less work.  I think Maven is not the only technology that'll give you disappointing results if you don't follow directions :)


                However, in this case, you are clearly following directions.  It seems like your issue is a transient network issue.  Maven's biggest weakness is that it depends on servers that are not under your control and I think that's what bit you today.  


                Hudson (http://hudson.jboss.org/hudson/job/Weld-nightly/) thinks the build is fine.  Also, I just built the trunk.  Can you please try again?

                • 5. Re: How I loathe thee maven.
                  John Ament Master

                  yep, posted right before you did.  had an error in my settings.xml that it wasn't happy about.


                  just to throw the question around, shouldn't the 1.0 weld be working on jboss as 5.1?  or does it in fact require AS 6?

                  • 6. Re: How I loathe thee maven.
                    Steven Boscarine Apprentice

                    Officially,  it is JBoss 6. the official documentation was written before JBoss 5.2 became 6.0 and the the download link is missing. 


                    Try this doc:
                    http://www.seamframework.org/Documentation/GettingStartedWithCDIInJBossAS60AndMaven for a current link. 


                    If you decide to use the JEE archetypes, as of this week, the trunk is more stable than 0.0.1.  The maven archetypes are being improved faster than releases can be pushed out. 

                    • 7. Re: How I loathe thee maven.
                      John Ament Master

                      so the thought is, build from trunk, deploy on 6?  man that hudson server is slow.  i started to pull it down before you responded and it said it would take an hour.  any one putting this on sourceforge as an alpha/beta?

                      • 8. Re: How I loathe thee maven.
                        John Ament Master
                        So I tried both the default deployment as well as rebuilding the trunk and updating... no luck. I keep getting hit on

                        java.lang.NoSuchMethodError: com.google.common.collect.ForwardingMap: method <init>()V not found
                                at org.jboss.weld.util.collections.ConcurrentCache.<init>(ConcurrentCache.java:43)
                                at org.jboss.weld.logging.WeldMessageConveyor.<init>(WeldMessageConveyor.java:24)
                                at org.jboss.weld.logging.WeldMessageConveyerFactory.getDefaultMessageConveyer(WeldMessageConveyerFactory.java:16)
                                at org.jboss.weld.logging.LoggerFactory.<init>(LoggerFactory.java:20)
                                at org.jboss.weld.logging.LoggerFactory.<clinit>(LoggerFactory.java:13)
                                at org.jboss.weld.bootstrap.WeldBootstrap.<clinit>(WeldBootstrap.java:108)
                                at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
                                at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
                                at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
                                at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
                                at org.jboss.reflect.plugins.introspection.ReflectionUtils.newInstance(ReflectionUtils.java:149)
                                at org.jboss.reflect.plugins.introspection.ReflectConstructorInfoImpl.newInstance(ReflectConstructorInfoImpl.java:106)
                                at org.jboss.joinpoint.plugins.BasicConstructorJoinPoint.dispatch(BasicConstructorJoinPoint.java:80)
                                at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.createTarget(AOPConstructorJoinpoint.java:295)
                                at org.jboss.aop.microcontainer.integration.AOPConstructorJoinpoint.dispatch(AOPConstructorJoinpoint.java:116)
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction$JoinpointDispatchWrapper.execute(KernelControllerContextAction.java:243)
                                at org.jboss.kernel.plugins.dependency.ExecutionWrapper.execute(ExecutionWrapper.java:47)
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchExecutionWrapper(KernelControllerContextAction.java:111)
                                at org.jboss.kernel.plugins.dependency.KernelControllerContextAction.dispatchJoinPoint(KernelControllerContextAction.java:72)
                                at org.jboss.kernel.plugins.dependency.InstantiateAction.installActionInternal(InstantiateAction.java:66)
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:54)
                                at org.jboss.kernel.plugins.dependency.InstallsAwareAction.installAction(InstallsAwareAction.java:42)
                                at org.jboss.dependency.plugins.action.SimpleControllerContextAction.simpleInstallAction(SimpleControllerContextAction.java:62)
                                at org.jboss.dependency.plugins.action.AccessControllerContextAction.install(AccessControllerContextAction.java:71)
                                at org.jboss.dependency.plugins.AbstractControllerContextActions.install(AbstractControllerContextActions.java:51)
                                at org.jboss.dependency.plugins.AbstractControllerContext.install(AbstractControllerContext.java:348)
                                at org.jboss.dependency.plugins.AbstractController.install(AbstractController.java:1633)


                        I attempted to add google-collections 1.0 r3 and google-collect 1.0 r4, neither seems to work.
                        • 9. Re: How I loathe thee maven.
                          Arbi Sookazian Master

                          welcome to the world of the guinea pig (life on the bleeding edge has its minuses)...

                          • 10. Re: How I loathe thee maven.
                            John Ament Master

                            well my problem ended up being that i forgot that dna (since my app uses jboss dna) also uses google collections.  looks like the jboss new fancy class loader (assuming it's even in now...) was not happy about dna needing 1 version of collections and weld needing a different version.  dna's version was way out of date (may 2008) so I made a patch for them and a jira to mark it.  https://jira.jboss.org/jira/browse/DNA-561


                            not really sure if the class loading makes much sense, it looked almost like weld joined into the same class loader as my app, rather than being a step above it (since the deployers should be at a higher classloader, iirc).

                            • 11. Re: How I loathe thee maven.
                              Francisco Jose Peredo Noguez Master

                              John Ament wrote on Nov 29, 2009 16:55:


                              So first let it be known, maven and I do not get along.


                              That is my case too! Your are not alone. IMO Maven is broken by design.



                              It never does things the way I want, and I never do things the way it wants.


                              Exactly, maven should do what I want, but no, with maven it is the maven way of the highway ;-)



                              However, since jboss uses it heavily I have to use it to integrate jboss stuffs into my projects. 


                              You do not have to use maven. You can use Ivy, or Gradle, or others that can do whatever maven does, but the way you want it to be done.


                              • 12. Re: How I loathe thee maven.
                                Steven Boscarine Apprentice


                                Exactly, maven should do what I want, but no, with maven it is the maven way of the highway ;-)



                                Tell me about it!  I feel the same way about my car.  Why do I have to fill it with gasoline!  Why won't it run on mountain dew?...that's what I run on.  Or better yet, vodka is combustible, why won't my Hyundai Elantra run on vodka.  :)   If your complaint is that you have to follow directions to get things to work your way, I don't know that you'll get too much sympathy. 


                                As far as being broken by design, the author's complaint was nothing more that Maven downloads things.  Sorry, that's the way the world works today.  If you don't want to deal with programs downloading dependencies, you'll have to give up on Debian Linux, Steam games (Left 4 Dead), Windows XP or greater, the XBox, and even Ivy. 


                                If you're concerned about the reliability of partner repos, you can easily force Maven to only download from a specific repo, such as one you control yourself.  If it becomes a repeatable problem, I am sure you can get some traction at JBoss to force downloads to go through a single proxy like Nexus. 



                                Give Maven a fair shake.  Conventions are important and the fact that everything has a uniform structure helps a lot of people get started with the project.  Since we're running Maven, I can instantly import the project into my IDE, navigate a familiar structure, and add useful plugins that you cannot do very easily in ANT.  I was skeptical at first and really warmed up to Maven after a few months of using it, especially once I saw all of the plugins you could use for the Maven site command. 


                                Maven has room for improvement, as does pretty much any technology in the Java world.  Many of its plugins have annoying flaws, but it simply is the best major build tool out there.  It's also pretty much the current standard and is well documented and well known in the development community.  Even if you can find some reason why you think Gradle or ANT is superior, a lot more people will be building Weld and potentially contribute to the project because the team adopted Maven instead of some proprietary ANT script.  JBoss using Maven is one of the biggest reasons I got involved in Weld as it made it much easier for me to step through their code and examples. 


                                I think your life will be a lot easier if just accept Maven as a requirement for building Weld rather than recreate someone else's build using another technology.  You can always use ANT for your own project. 

                                • 13. Re: How I loathe thee maven.
                                  Francisco Jose Peredo Noguez Master

                                  Steven Boscarine wrote on Nov 30, 2009 17:14:



                                  Tell me about it!  I feel the same way about my car.  Why do I have to fill it with gasoline!  Why won't it run on mountain dew?...that's what I run on.  Or better yet, vodka is combustible, why won't my Hyundai Elantra run on vodka.  :)   If your complaint is that you have to follow directions to get things to work your way, I don't know that you'll get too much sympathy. 



                                  I don't mind following directions, to reach the place I want to reach (not to reach the place the person I am asking directions to wants me to reach). Your cars running on alcohol is in interesting idea, that, BTW can be done with your car ;-), just as Ant can deal with a project with any project structure I want (instead of imposing its own) .




                                  As far as being broken by design, the author's complaint was nothing more that Maven downloads things.  Sorry, that's the way the world works today.  If you don't want to deal with programs downloading dependencies, you'll have to give up on Debian Linux, Steam games (Left 4 Dead), Windows XP or greater, the XBox, and even Ivy.



                                  The problem is not that it download things, the problems is that it dowload things when it wants to downloads them, not when I want it to do it. OTHOH I have read that the latest versions of Maven are more controllable (they can be told when to upgrade). But even then I still do not like that I have to follow the project structure the maven inventors arbitrarily decided to use... someone should write a JSR on this! we have one project structure en Eclipse WTP, one in Netbeans, one in JDeveloper, another in IntelliJ, a different one in Maven... and Ant is the only one that can deal with anything you throw to it!



                                  Give Maven a fair shake.  Conventions are important and the fact that everything has a uniform structure helps a lot of people get started with the project.


                                  Yes, conventions are important... why is it then that Maven and WTP do not follow a compatible project structure?



                                  Since we're running Maven, I can instantly import the project into my IDE, navigate a familiar structure, and add useful plugins that you cannot do very easily in ANT.


                                  What IDE do you use? Is there now a way to make Maven play well with Eclipse an WTP project structure?



                                  I was skeptical at first and really warmed up to Maven after a few months of using it, especially once I saw all of the plugins you could use for the Maven site command. 

                                  Maven has room for improvement, as does pretty much any technology in the Java world.  Many of its plugins have annoying flaws, but it simply is the best major build tool out there.  It's also pretty much the current standard and is well documented and well known in the development community.  Even if you can find some reason why you think Gradle or ANT is superior, a lot more people will be building Weld and potentially contribute to the project because the team adopted Maven instead of some proprietary ANT script.


                                  So far, there is only one reason for me to believe they are superior to Maven: I can make them do the things the way I want them to be  done.



                                  JBoss using Maven is one of the biggest reasons I got involved in Weld as it made it much easier for me to step through their code and examples. 


                                  Yeap, easy if you know Maven, try asking people without Maven experience how hard (or easy) it is to learn it. Specially when compared when creating an new project from Eclipse or Netbeans.



                                  I think your life will be a lot easier if just accept Maven as a requirement for building Weld rather than recreate someone else's build using another technology.  You can always use ANT for your own project. 


                                  Oh, of course, when I build a project created by someone else, I will use maven is that is the only option I am given, it is after all, not my project, but that does not mean I like it ;-).

                                  • 14. Re: How I loathe thee maven.
                                    Steven Boscarine Apprentice



                                    What IDE do you use? Is there now a way to make Maven play well with Eclipse an WTP project structure?



                                    Yes.  Install m2eclipse.  IntelliJ and NetBeans import it without any additions.  You have to use the maven structure, but I've been using WTP with maven for over 3 years now. 


                                    There are a few ways to get it done now.  The old way was to use the eclipse:eclipse command which is very fast and reliable.  An easier way is to import the project as an existing Maven project.  That option will be available when you install m2eclipse. 


                                    If you wanted to discuss further, post in another thread and I'll be happy to go into more detail.  The bottom line is that eclipse and maven do work well together.  There are hundreds of really useful plugins for maven, which make the initial learning curve very much worth it.  I have saved a lot of time by moving to maven. 

                                    1 2 Previous Next