1 2 3 Previous Next 34 Replies Latest reply on Jul 14, 2006 4:56 PM by starksm64 Go to original post
      • 15. Re: Maven 2.0 - single module and minimal server build

        Currently, when you check out from subversion you will get more modules than are being built. As my work has proceeded, I have inlcuded each additionaly module into subversion for backup purposes. The current release version only builds a subset of these, the next release version will include them all. (This will be finished up this week).

        Now for some specifics.......

        The groupId is a unique identifier. Everything in maven will get two things, a groupId, and an artifact name. These 2 pieces of information are used for both placing and pulling items from the maven repository. The naming schema is user defined. For example, each module in our build will get a unique groupId, and each module will have 1 output artifact which can be placed in the repository (although we can still build as many output artifacts as we want).

        We have a notion of two repositories, a local and remote. On the first build dependencies are copied from the remote to the local repository. Some dependencies as you described are not present in the remote repository. They are created at build time and placed in the local repository.

        The next point is very important and concerns how inter-module classpath referencing takes place. When a module is built a jar artifact is created. This artifact is then copied into the LOCAL repository using the groupId , artifactId, and version as path descriptors. The local repository on a windows box by default is in your c:\documents_and_settings\user\.m2\repository directory. Linux users will find it in ~/.m2. When module b references a depenency from module a, what is placed on the compilation classpath is the path to the local repository/groupId/artifactId/version for module a.

        • 16. Re: Maven 2.0 - single module and minimal server build

          Ruel, where can we get documentation of the pom.xml? I tried looking on the maven site, and found a long listing of documentation that looks half-baked. Are there good docs for the POM yet?

          • 17. Re: Maven 2.0 - single module and minimal server build

             

            "scott.stark@jboss.org" wrote:
            As part of this we really need to cleanup the varia module as well.


            I think this is in-scope, but we should deploy the maven build before making changes like this. Once we do, such changes should be much easier to make.

            • 18. Re: Maven 2.0 - single module and minimal server build
              mdchesney

               

              "ryan.campbell@jboss.com" wrote:
              Ruel, where can we get documentation of the pom.xml? I tried looking on the maven site, and found a long listing of documentation that looks half-baked. Are there good docs for the POM yet?


              The Maven POM can be described by this XSD:
              http://maven.apache.org/maven-v4_0_0.xsd

              <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/maven-v4_0_0.xsd">
              ...


              It is fairly easy to associate pom.xml with the Eclipse XML Editor. At that point Eclipse uses the XSD for auto-completion and documentation purposes.

              Plugin configuration is plugin specific. See the documentation for existing plugins and for creating Java-based plugins:

              http://maven.apache.org/plugins/index.html
              http://maven.apache.org/guides/plugin/guide-java-plugin-development.html


              • 19. Re: Maven 2.0 - single module and minimal server build

                Hello,

                We are working on a project using jboss-cache and building the project with maven2.
                The latest release of jboss-cache, 1.2.3 or 1.2.4 are not under maven2 ibiblio repository but jboss-cache 1.2.2 is.
                Somebody can tell when a pom.xml with the right dependencies will be published on ibiblio or in some jboss repository ?
                (I've found nothinng under http://repository.jboss.com/maven2/)
                Thanks a lot.

                • 20. Re: Maven 2.0 - single module and minimal server build

                  The version you are looking at on ibiblio was possibly added by a thirdparty as releasing to cache to ibiblio is not currently part of the release process.

                  That being said, Cache is an excellent candidate for being released to ibiblio and I would like for that to become a standard part of the release process (this could later be extended to other jems projects). I'll engage the cache developers on this and work with them on getting it set up.

                  • 21. Re: Maven 2.0 - single module and minimal server build

                    The best source of pom documentation can be seen here:

                    http://maven.apache.org/maven-model/maven.html

                    It lists all possible tags for the pom and what the usage is. This is currently the best source of information regarding the pom. If there are any vague tags descriptions, I can fill in the blanks.

                    • 22. Re: Maven 2.0 - single module and minimal server build

                      If you don't have a SVN account, you can use the following URL to look at the maven2 work:

                      svn co http://anonsvn.labs.jboss.com/trunk/labs/jbossbuild/projects/jboss/


                      • 23. Re: Maven 2.0 - single module and minimal server build

                        I've just been reading the doco for Maven.
                        I hope we aren't going to have this tree structure.

                        Why do people get hung up on these artifical hierarchical tree structures?
                        No project (except the most trivial) is a tree.
                        You could see this if you tried to build all projects from source rather than downloading
                        shared components as binaries.

                        Things are naturally sets. Trees occur when you have parent/child relationships
                        which clearly isn't the case when you want to reuse components across projects.

                        Another example is java itself. The packages
                        java.lang
                        java.lang.reflect
                        are not a parent/child
                        they are siblings that happen to live in parent/child directories when stored
                        in a filesystem or jar.

                        • 24. Re: Maven 2.0 - single module and minimal server build
                          starksm64

                          What tree structure are you referring to? In looking at the getting-started the structure seems similar to what we already use. The only nested tree strucutre I see is in the archetypes guide. I can't say I understand its usage from the http://maven.apache.org/guides/mini/guide-creating-archetypes.html page.

                          • 25. Re: Maven 2.0 - single module and minimal server build

                            I was reading the eclipse related documentation where they were complaining
                            about the flat model and why it was bad.

                            Although the detailed arguments were on a page marked "TODO" :-)

                            The expectation/assumption is that jbossas would look like

                            jbossas -- jboss-common -- logging
                             -- jbossxb
                             -- jboss-j2ee
                            etc.
                            


                            Whereas we/eclipse allows more reuse by having components at the top level
                            jbossas (top level build project)
                            jboss-portal (top level build project)
                            logging
                            jbossxb
                            jboss-j2ee
                            etc.
                            



                            • 26. Re: Maven 2.0 - single module and minimal server build

                              Yes, the flat file structure argument is an ongoing one. It stems from the fact that Maven suggests a file system (one with nested projects) which eclipse does not yet support.

                              They handle it just as you describe. A normal checkout would take place, and then each project and subproject is imported as a top-level proj into eclipse.

                              • 27. Re: Maven 2.0 - single module and minimal server build

                                 

                                "rloehr@jboss.com" wrote:
                                Yes, the flat file structure argument is an ongoing one. It stems from the fact that Maven suggests a file system (one with nested projects) which eclipse does not yet support.


                                My point was that nested components (ones used solely to implement the containing
                                component) are far less frequent and less desirable than top level components
                                that can be reused.


                                They handle it just as you describe. A normal checkout would take place, and then each project and subproject is imported as a top-level proj into eclipse.


                                I had no problem using Maven with everything at the top level.
                                The only issue was with eclipse and the maven name not corresponding
                                with the directory/project name,
                                e.g. common != jboss-common

                                • 28. Re: Maven 2.0 - single module and minimal server build

                                  I agree 100%. IMO, it makes more sense to have all top level projects as this would correspond to the structure that eclipse handles. There are implications to this schema as well.

                                  This relates to something you posted over the weekend.

                                  -- from the dev list

                                  On the maven build in general, I don't like the kind of thing
                                  seen below. We might as well use ant than learn a new tool
                                  to do this???
                                  
                                  Good: Declarative information known to the build system
                                  Bad: Scripting or any other hack that breaks the information trail
                                  
                                  Is this just because our projects are hopelessly entangled?
                                  
                                   <artifactId>maven-antrun-plugin</artifactId>
                                   <version>1.0</version>
                                   <executions>
                                   <execution>
                                   <phase>package</phase>
                                   <configuration>
                                   <tasks>
                                   <mkdir dir="${basedir}/output/lib"/>
                                  
                                   <!-- Build jboss-common.jar -->
                                   <jar
                                  jarfile="${basedir}/output/lib/jboss-common.jar"
                                  manifest="${basedir}/src/etc/default.mf">
                                   <fileset dir="${basedir}/output/classes">
                                   <include name="org/jboss/**"/>
                                   <include name="org/apache/xerces/**"/>
                                   </fileset>
                                   </jar>
                                  snipped the rest
                                  


                                  I'm glad you brought this up. It's important.

                                  The maven project model handles only 1 output artifact for a given project. This rule is sometimes broken with the creation of src jars or client jars, but in general it holds.

                                  This is the fundamental discrepancy between how we operate and how they suggest to operate.

                                  You have a couple of options here on how to handle things (let's use common as an example):

                                  1) Refactor common so that it contains subprojects
                                  a) Each subproject would be a distinct entity which would correspond to 1 output
                                  b) PROS- follows maven convention, doesn't break the model, follows declarative approach
                                  c) CONS - someone has to refactor, code may be entagled and difficult to break up

                                  2) Refactor common into several top level projects
                                  a) PROS- satisfies IDE requirements, doesn't break the model, and is still declarative
                                  b) CONS - if we follow this for all projects, we are going to have a large number of top level projects (e.g. varia module builds a number of artifacts)

                                  3) Keep codebase the same, use scripting to create additional jars required for packaging
                                  a) PROS - easy and no real changes
                                  b) CONS - Breaks the project model, isn't declarative


                                  • 29. Re: Maven 2.0 - single module and minimal server build

                                    Point (2) is the preferred solution.

                                    Additionally, these sundry jars should be moved to standalone projects
                                    and then integrated as binaries as required to the projects that use them,
                                    rather than one big jboss-common.jar

                                    Much of varia should be in jboss-labs as optional addons, not a part of the main project.
                                    It can be re-integrated as binaries by the installer if necessary.

                                    The client/server distinction is artifical. It is just an effort to reduce the client footprint
                                    when everything is in one big jar.

                                    If the api was more correctly abstracted from the implementation this would be
                                    very nearly a none issue. Projects that differentiate interfaces and server (like jnp) or
                                    spi and plugins have less problems than those that don't (e.g. jca or transactions).
                                    The trick is to get Maven to understand the different between
                                    jboss-xxx-api.jar
                                    jboss-xxx-spi.jar
                                    jboss-xxx-impl.jar