1 2 3 Previous Next 44 Replies Latest reply on Apr 3, 2007 6:46 AM by adrian.brock

    Migration to maven

    pgier

      I'd like to switch microcontainer completely over to maven builds as soon as possible. For anyone who is new to maven, some information can be found on the jboss wiki here, and more info can be found on maven site: maven.apache.org.

      To get started, you will have to install maven from the above site, if you don't already have it. From the command line, just type "mvn". This will call the default build phase "install" which will compile the main code and test code, run unit tests, package the files into jars, and copy them to your local repository.

      Some other commands that might be useful:
      "mvn compile" - This will only compile the main code.
      "mvn -Dmaven.test.skip=true" - This will skip the unit tests
      "mvn -Dtest=org/jboss/project/MyTest" - This will run a single unit test.
      "mvn deploy" - This will copy the artifacts to a local checkout of the jboss repository.

      What other functionality is required in the maven scripts before we can remove the build.xml scripts?

        • 1. Re: Migration to maven
          alesj

           

          "pgier" wrote:

          What other functionality is required in the maven scripts before we can remove the build.xml scripts?


          I wouldn't remove the build.xml - I like/use the IDE integration with Ant.

          • 2. Re: Migration to maven
            starksm64

            The build.xml as it exists cannot stay as it relies on the jbossbuild tasks. What is the state of ide mvn support?

            • 3. Re: Migration to maven
              alesj

               

              "scott.stark@jboss.org" wrote:
              What is the state of ide mvn support?

              Uf, no IDEA. :-)
              I'll have a look.

              But what's the problem with relaying on jbossbuild?
              At least for running the tests?

              • 4. Re: Migration to maven
                pgier

                 

                "scott.stark@jboss.org" wrote:
                What is the state of ide mvn support?

                This eclipse plugin is available: http://m2eclipse.codehaus.org/
                I have been using it, and it's not great, but it does build my classpath based on the dependencies in the pom. So that is helpful.

                There is also this maven plugin that can generate IDEA files:
                http://maven.apache.org/plugins/maven-idea-plugin/
                You could either manually run this for a project, or you could probably set up your local settings to have this plugin run automatically.
                I don't have IDEA, so I haven't tried it out though.

                And there is a netbeans plugin for maven too:
                http://mevenide.codehaus.org/m2-site/
                but I haven't tried this one either.

                • 5. Re: Migration to maven
                  kconner
                  • 6. Re: Migration to maven
                    pgier

                     

                    "alesj" wrote:

                    But what's the problem with relaying on jbossbuild?


                    In the long run maven will be easier to maintain, and we get several features that we don't have now (better dependency management, automated releases, project inheritance, etc). If we have them both side by side it will be difficult to keep them in sync.

                    What are the features that you have with ant? Maybe we can come up with something similar in maven.

                    Generating a build.xml from the maven pom (using the plugin that Kevin mentioned) can be done with "mvn ant:ant". We can do this for now if needed, but my goal is that eventually it won't be necessary.


                    • 7. Re: Migration to maven
                      alesj

                       

                      "pgier" wrote:

                      What are the features that you have with ant? Maybe we can come up with something similar in maven.

                      Eh, don't bother.
                      I think that IDEA plugin will do.
                      In the worst case I can extend it, and add some own features.
                      But thanks for the offer. :-)

                      • 8. Re: Migration to maven
                        pgier

                        I moved the parent pom.xml (the one that was in the build directory) to the root directory of the project. The eclipse plugin seems to work a little better this way. Also this is the default path for maven parent poms, so I was able to remove the parent path config from each of the sub-project poms.

                        • 9. Re: Migration to maven
                          alesj

                           

                          "alesj" wrote:

                          I think that IDEA plugin will do.

                          This looks promising:
                          - http://plugins.intellij.net/plugin/?id=1166

                          • 10. Re: Migration to maven

                            I've fixed the eclipse build for the new maven build.

                            It's got that annoying bug where maven's eclipse plugin thinks a project
                            should be called "jboss-container" rather than "container".

                            I also fixed some problems with the maven build:

                            * spring-int wasn't being built
                            * osgi-int wasn't being built, the parent in its pom was wrong and the javacc wasn't generating the classes in the correct package

                            I don't think we need thirdparty and tools in the svn trunk anymore do we?

                            • 11. Re: Migration to maven
                              pgier

                               

                              "adrian@jboss.org" wrote:
                              I've fixed the eclipse build for the new maven build.

                              Thanks!

                              "adrian@jboss.org" wrote:

                              I also fixed some problems with the maven build:

                              * spring-int wasn't being built
                              * osgi-int wasn't being built, the parent in its pom was wrong and the javacc wasn't generating the classes in the correct package

                              spring-int and osgi-int weren't in the ant parent build, that's why I had taken them out of the maven build.

                              "adrian@jboss.org" wrote:

                              I don't think we need thirdparty and tools in the svn trunk anymore do we?

                              You're right we don't need these folders anymore. I removed them from svn.

                              • 12. Re: Migration to maven
                                kconner

                                I have just tried to build the microcontainer from source and had a few issues.

                                There appears to be a missing dependency in deployers/pom.xml as it requires jboss-dependency (BeanMetaDataDeployer used it).

                                The second issue is the javacc configuraiton in osgi-int/pom.xml. It currently includes the package name as part of the outputDirectory instead of using the packageName. This has an impact on classpath/project generation using eclipse:eclipse.

                                The third issue is the location of the test resources in aop-mc-int. If you generate classpath/project files then eclipse will complain about one resource directory being included in another.

                                I would like to fix the two issue, any objections?

                                • 13. Re: Migration to maven
                                  kconner

                                  Now that the build is based on maven there should be no need to keep classpath/project files in maven. Could we remove these and rely on generating them?

                                  • 14. Re: Migration to maven
                                    kconner

                                    My test runs appear to contain a number of failures/errors at present. Is this expected?

                                    1 2 3 Previous Next