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!
all_screenshots.tgz 2.1 MB
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>
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.
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>
and here's a snippet from the pom of "xxxx":
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.
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.
The changes are included in the nightly build (http://download.jboss.org/jbosstools/updates/nightly/trunk/),
You would also have to update m2eclipse to the latest version using https://repository.sonatype.org/content/repositories/forge-sites/m2e/0.12.0/S/0.12.0.20101102-1505/ and https://repository.sonatype.org/content/repositories/forge-sites/m2eclipse-wtp/0.12.0/N/0.12.0.201011031615/ update sites.
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.
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?)
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:
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).
> 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").
> 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:
in the pom.xml of the EAR project.