Reputation: 3575
I have a maven project, project A depends on project B, A is a GWT web project, in project A's pom:
<dependency>
<groupId>com.mydomain</groupId>
<artifactId>b</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
and B project's packaging is jar. Everything works fine till now. But i need to add some integrated test on project B, which need to turn project B's packaging to war, so it can setup a web environment that i can run the integrated test cases.
Then when i run/debug project A using Google Eclipse plugin, project B's jar never copied to project A's target/A-0.0.1-SNAPSHOT/WEB-INF/lib, and runtime class not foundexception thrown. My questions is how to solve problem like this, i need the integrated testcases in B and i also would like to debug in project A. Any help are appreciated.
Upvotes: 0
Views: 598
Reputation: 3575
After reading more carefully about http://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html and http://maven.apache.org/plugins/maven-war-plugin/plugin-info.html I thought i have come up with a solution: leave project B as jar packaging as it should be, then bind maven-war-plugin's exploded goal to maven package lifecycle, then when installing project B, it create a exploded war directory just before running integrated tests even it is not a war project. And also thanks to the people who give solutions.
Upvotes: 0
Reputation: 6263
hmm, not sure I fully understand-- but I would suggest packaging B
into jar to be used by A
, and then independently package and deploy B
as a WAR
.
This separation will allow both A
and B.WAR
to depend on B.jar
as opposed to A
depending on B.WAR
.
Upvotes: 1