9 Replies Latest reply on Mar 4, 2008 2:42 AM by Andrew Rubinger

    Eclipse project settings in the ejb3 trunk

    Scott Stark Master

      I just updated the ejb3 trunk projects, and all of the eclipse classpaths are empty. Why is that?

        • 1. Re: Eclipse project settings in the ejb3 trunk
          Andrew Rubinger Master

          I'd done a two-step update of the .classpath files in order to more easily track revisions in SVN. Looks like you got caught inbetween, update again?

          From Core .classpath, for example:
          http://anonsvn.jboss.org/repos/jbossas/projects/ejb3/trunk/core/.classpath

          All you should have to set is variable M2_REPO to point to your local Maven repository.

          S,
          ALR

          • 2. Re: Eclipse project settings in the ejb3 trunk
            Scott Stark Master

            The sandbox/ and socket-inflow/ project still don't have any classpath entries. After generating these with the eclipse plugin, I'm still seeing a missing dependency on the jca api being pulled in from jotm for the test target:

            [starksm@succubus sandbox]$ mvn test
            [INFO] Scanning for projects...
            WAGON_VERSION: 1.0-beta-2
            [INFO] ----------------------------------------------------------------------------
            [INFO] Building JBoss EJB 3 Sandbox
            [INFO] task-segment: [test]
            [INFO] ----------------------------------------------------------------------------
            [INFO] [resources:resources]
            [INFO] Using default encoding to copy filtered resources.
            [INFO] [compiler:compile]
            [INFO] Nothing to compile - all classes are up to date
            [INFO] [resources:testResources]
            [INFO] Using default encoding to copy filtered resources.
            Downloading: http://snapshots.jboss.org/maven2/javax/resource/connector/1.0/connector-1.0.jar
            Downloading: http://repository.jboss.org/maven2/javax/resource/connector/1.0/connector-1.0.jar
            Downloading: http://repository.jboss.org/maven2/javax/resource/connector/1.0/connector-1.0.jar
            Downloading: http://repo1.maven.org/maven2/javax/resource/connector/1.0/connector-1.0.jar
            [INFO] ------------------------------------------------------------------------
            [ERROR] BUILD ERROR
            [INFO] ------------------------------------------------------------------------
            [INFO] Failed to resolve artifact.
            
            Missing:
            ----------
            1) javax.resource:connector:jar:1.0
            
             Try downloading the file manually from:
             http://java.sun.com/j2ee/connector/download.html
            
             Then, install it using the command:
             mvn install:install-file -DgroupId=javax.resource -DartifactId=connector \ -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file
            Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=javax.resource -DartifactId=connector \
             -Dversion=1.0 -Dpackaging=jar -Dfile=/path/to/file \
             -Durl=[url] -DrepositoryId=[id]
            
             Path to dependency:
             1) org.jboss.ejb3:jboss-ejb3-sandbox:jar:0.12.0-SNAPSHOT
             2) jotm:jotm:jar:2.0.10
             3) javax.resource:connector:jar:1.0
            


            We should not be needing jotm. I'm going to deploy the org.jboss.javaee:jboss-jca-api as javax.resource:connector for now.


            • 3. Re: Eclipse project settings in the ejb3 trunk
              Scott Stark Master

              That won't work as its jca 1.5. I just uploaded the 1.0 jar from http://java.sun.com/j2ee/connector/index.jsp

              • 4. Re: Eclipse project settings in the ejb3 trunk
                Andrew Rubinger Master

                Socket inflow and Sandbox aren't really part of EJB3 now, and are not included in the Aggregator, so they can be ignored. Carlo has included the requisite JCA JAR under Sandbox/lib, along with a bash script to install locally.

                S,
                ALR

                • 5. Re: Eclipse project settings in the ejb3 trunk
                  Scott Stark Master

                  Well, I added it to the jboss repo and have fixed the sandbox and socket-inflow eclipse files

                  • 6. Re: Eclipse project settings in the ejb3 trunk
                    Carlo de Wolf Master

                    The .classpath files must not contain a reference to a workspace project, because a different version might be in use. So generating them with the aggregator is a no-go.

                    I somewhat like the idea of using M2 Eclipse plugin but there are two cons:
                    1. slow startup
                    2. dependency resolution is different versus Maven builds
                    Especially the second item makes it unusable.

                    • 7. Re: Eclipse project settings in the ejb3 trunk
                      Andrew Rubinger Master

                       

                      "wolfc" wrote:
                      The .classpath files must not contain a reference to a workspace project, because a different version might be in use. So generating them with the aggregator is a no-go.


                      Thanks for pointing this out; I hadn't noticed that. It's gotta be a simple fix to enhance this Mojo to add a property "-Dmaven.eclipse.noProjectRefs" and override this behavior, no?

                      "wolfc" wrote:
                      I somewhat like the idea of using M2 Eclipse plugin but ...
                      dependency resolution ... different versus Maven builds
                      ...makes it unusable.


                      It's still a good tool. Eclipse classpath has been different from compile or JUnit classpaths for a long time anyway. So we do what we always do...code in it, and run builds from the command-line before checking in.

                      I'd sent out licenses to the EJB3 team for IntelliJ, which is supposed to have better Maven support. I haven't found the energy to fight habits and give it a good try yet.

                      S,
                      ALR

                      • 8. Re: Eclipse project settings in the ejb3 trunk
                        Andrew Rubinger Master

                         

                        "ALRubinger" wrote:
                        It's gotta be a simple fix to enhance this Mojo to add a property "-Dmaven.eclipse.noProjectRefs" and override this behavior, no?


                        Turns out, easier than I thought; it's already supported:

                        mvn eclipse:clean eclipse:eclipse -Declipse.useProjectReferences=false


                        Problem is, now it's a PITA because any change you make to one project won't be reflected in others in your workspace until you run a build. I kinda prefer the other way.

                        S,
                        ALR

                        • 9. Re: Eclipse project settings in the ejb3 trunk
                          Andrew Rubinger Master

                          One more thought, a leftover from a discussion with Adrian/Ales the other day:

                          I believe that generated files don't belong in SVN, especially those that cater to developer preferences such as IDE integration. It's easy to get your environment set up by running the maven-eclipse-plugin and I think by committing .classpath we set ourselves up to have these easily fall out of sync.

                          S,
                          ALR