1 2 Previous Next 24 Replies Latest reply: Nov 16, 2010 4:11 PM by Snjezana Peco RSS

broken jboss tools - generated maven seam project?

Lars Bohl Newbie

I've been trying to create a "maven seam project" using the "Generate Seam Web Project" wizard (see screenshots 01-09 (sorry for accidentally deleting screen06.png)). This actually generates 5 projects (called mavenprj, mavenprj-ejb, mavenprj-parent, mavenprj-ejb and mavenprj-test), none of which can be installed using [[ run --> mvn install ]] (screenshots 10-13).

 

Later I managed to build one of them (I think it was mavenprj) from the command line, resulting in a .ear file which did not launch in jboss 5.1 ("The content of element type "application" is incomplete", see screenshot 14, project name different there). The versions of eclipse (3.6.1), jboss tools (2.2.0beta1) and my other eclipse plugins can be seen in screenshots 20 and 21. Any help appreciated!

  • 1. Re: broken jboss tools - generated maven seam project?
    John Franey Novice

    I've been playing with this feature over the last few weeks.  I am not a seam developer; I'm an outsider.

     

    I see the same behavior and have a manual fix to work around.  I have not looked for or filed a bug against jboss tools.

     

    I see the behavior in jboss tools for seam 3.2.0.v20101020-1701-H111-Beta2. I use maven 3 on the command line.

     

    I think the normal way to build a maven project after generating by seam is to change dir to the parent directory and run maven there.

     

    My  fix is to edit the other pom's to provide a path to the parent pom.   The poms that declare the parent project as the pom parent should be edited to look something like this:

     

      <parent>
        <artifactId>try3-parent</artifactId>
        <groupId>org.jjflyboy</groupId>
        <version>0.0.1-SNAPSHOT</version>
        <relativePath>../try3-parent</relativePath>
      </parent>

    <project>

      ..

      <parent>

         <artifactId>your-artififact</artifactId>

         <groupId>your-group</groupId>

         <version>yyy.zzz</version>

         <relativePath>../xxxx-parent</relativePath>

      </parent>

      ...

    </project>

     

    I don't know if that is the 'Right thing' except it works.  The projects find the parent pom by the path given in the relativePath tag.  Once this is done, maven can build the project.

     

    Have fun.

  • 2. Re: broken jboss tools - generated maven seam project?
    Lars Bohl Newbie

    Thanks John, I can build the projects "xxxx-ejb" and "xxxx" now. However, mvn-install still fails for "xxxx-test",  "xxxx-ear" and  "xxxx-parent". Apparently, the root cause is that "xxxx-ear", which the other two depend on, doesn't compile, and that is because it has a dependency on "xxxx" with a packaging type of "war". Here's a snippet from the pom.xml of "xxxx-ear":

     

       <dependency>
          <groupId>de.xplace.myxplace</groupId>
          <artifactId>myxplace3.0</artifactId>
          <version>0.0.1-SNAPSHOT</version>
          <type>war</type>
          <scope>runtime</scope>
        </dependency>

       <dependency>

          <artifactId>xxxx</artifactId>

          <groupId>my.group</groupId>

          <version>0.0.1-SNAPSHOT</version>

          <type>war</type>

        </dependency>

     

    and here's a snippet from the pom of "xxxx":

     

    <project>

       ... 

      <artifactId>xxxx</artifactId>

      <groupId>my.group</groupId> 

      <version>0.0.1-SNAPSHOT</version>

      <packaging>ear</packaging>

        ...

    </project>

     

    I think the problem is that xxxx-ear depends on a project with <type>war</war>, but xxxx has <packaging>ear</packaging>. I tried changing the dependency declaration to <type>ear</type>, but get the following error message:

     

    "Failed to execute goal org.apache.maven.plugins:maven-ear-plugin:2.3.1:generate-application-xml

    Artifact[war:my.group:xxxx] is not a dependency of the project."

     

    I have done some Java SE maven projects, but I'm new to web development with maven, and I haven't got a clue how to fix that.

  • 3. Re: broken jboss tools - generated maven seam project?
    Snjezana Peco Expert

    The mentioned issues have been fixed within https://jira.jboss.org/browse/JBIDE-7011

  • 4. Re: broken jboss tools - generated maven seam project?
    Lars Bohl Newbie

    Hi Snjezana, I'm glad you found this thread. I think I'm already using the latest version of JBossAS Tools (2.2.0.v201016-0359-H111-Beta1) as you can see in one of the screenshots I uploaded in the original post ("screen20.png"). Or do I have to update another eclipse feature, apart from JBossAS Tools?

     

    update: I just realized that I need beta2 instead of beta1, sorry. Will update this again in case I get it working now.

  • 5. Re: broken jboss tools - generated maven seam project?
    Max Rydahl Andersen Master

    ...and all of this does not relate to JBoss AS tools afaics - so its the seam and maven integration you need updating.

  • 7. Re: broken jboss tools - generated maven seam project?
    Lars Bohl Newbie

     


    Hi all, I updated jbosstools and m2e from the update sites like snjezana said (the "m2eclipse-wtp" update site didn't work for me, eclipse didn't find any packages in there). Unfortunately, I still can't build all of the generated projects. I get an error after clicking "Finish" in the last window of the "create project"-wizard (screenshot01.png). Projects xxxx and xxxx-ejb can be build with "maven-install", but Eclipse doesn't know about the seam jars (see class Authenticator in screenshot02.png), and project xxxx-ear lacks a pom.xml (screenshot02.png), so that and the dependent projects xxxx-test and xxxx-parent cannot be built.

     

    screenshot01.png:
    screenshot01.png

     

    screenshot02.png (I hope this doesn't get scaled down too much, why can't there be a file upload like for the original post?)

    screenshot02.png

  • 8. Re: broken jboss tools - generated maven seam project?
    John Franey Novice

    Lars,

     

    The following applies to the maven issue.  Perhaps I should not post as this is a jboss ide forum, but jboss ide did not generate these errors, in my experience.

     

    The pom in the ear project should specify the dependency on the web component as a war, not an ear.  In other words, your original content of the ear pom is correct:

     

    <dependency>

          <artifactId>xxxx</artifactId>

          <groupId>my.group</groupId>

          <version>0.0.1-SNAPSHOT</version>

          <type>war</type>

    </dependency>

     

    The pom you posted for the war is not correct.  Its packaging should be 'war' not 'ear'.

     

    John

  • 9. Re: broken jboss tools - generated maven seam project?
    Snjezana Peco Expert

    > the "m2eclipse-wtp" update site didn't work for me, eclipse didn't find any packages in there

     

    You have to uncheck "Group items by category"

  • 10. Re: broken jboss tools - generated maven seam project?
    Lars Bohl Newbie

    Hi,

     

    I just installed a fresh copy of eclipse "helios" and then installed  m2e, m2eclipse-wtp, "JBoss Maven Seam Integration" and JBossAS Tools (in that order), all from the links snjezana posted. Result: Same problem as before: The xxxx-ear project can't be built with maven (missing dependency on the "war"-packaged project "xxxx", which has a declared packaging "ear"). Also, the application.xml in the target folder of project xxxx has no modules listed (might be a consequence of the other problem).

  • 11. Re: broken jboss tools - generated maven seam project?
    Snjezana Peco Expert

    m2eclipse doesn't support workspace resolution for a flat layot project.
    You can do the following:

     

    - call some maven action on *-parent project

     

    or

     

    - install *-ejb and *-war projects and then call some maven action on *-ear project

  • 12. Re: broken jboss tools - generated maven seam project?
    Lars Bohl Newbie

    > call some maven action on *-parent project

     

    you mean command line maven?

     

    > install *-ejb and *-war projects and then call some maven action on *-ear project

     

    There is no "*-war" project. There are 5 projects called "xxxx", "xxxx-ear", "xxxx-ejb", "xxxx-parent" and "xxxx-test". Also, as mentioned before, the "xxxx-ear" project is broken (no "pom.xml").

  • 13. Re: broken jboss tools - generated maven seam project?
    Snjezana Peco Expert

    > you mean command line maven?

     

    You can use command line maven or right-click the project and call Run As>Maven clean/package/build/install ...

     

    > There is no "*-war" project. There are 5 projects called "xxxx", "xxxx-ear", "xxxx-ejb", "xxxx-parent" and "xxxx-test". Also, as mentioned before, the
    > "xxxx-ear" project is broken (no "pom.xml").

     

    war (web) project is a project without a suffix (xxxx).

     

    There is also a problem with generating the application.xml file. See https://jira.jboss.org/browse/JBIDE-4809. Will fix it today. As a workaround, you can change the line:

     

    <generateApplicationXml>false</generateApplicationXml>

     

    to

     

    <generateApplicationXml>true</generateApplicationXml>
    <earSourceExcludes>**/application.xml, **/jboss-app.xml</earSourceExcludes>

     

    in the pom.xml of the EAR project.

  • 14. Re: broken jboss tools - generated maven seam project?
    Lars Bohl Newbie

    Snjezana,

     

    here's the full tree of the generated EAR project. It has only 3 files and lacks a pom.xml.

     

    nopom.png

     

    update: I just uploaded the tarred project.

1 2 Previous Next