File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problems with Multi Module project

 
Matt Kurz
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hello.

Given is a multi module project. I could run mvn test from the base dir or one of it's sub projects. Everything was fine. Now I wrote a unit test which starts a servlet like container and some first tests. I started mvn test from the sub project. Now I run mvn test from the base dir and got errors. After some exploration with several code and mvn clean/ mvn test iterations from both dirs, it's seem's as mvn test behaves different, dependend on where I start it. Sometimes it causes an error in the subdir, but in the base dir not, sometimes the other way arround. What could be the reason? Do you have hints to investigate this?

Best regards.
mattk1
 
Matt Kurz
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found out, that some Modules are not loaded if I run mvn test in the basedir, but don't know why. Here are some more observations: I run the following from the basedir of the Multi Module project:
mvn clean package -> all ok
mvn clean install -> all ok
mvn clean test -> error

I'am wondering about this, because install and package come after test in the maven lifecycle, so the test run in these cases, too. But they cause no error. What could be the reason? What can I do to investigate this? Already run the stuff with -X, but difficult to see the relevant part?
 
Jayesh A Lalwani
Rancher
Pie
Posts: 2756
32
Eclipse IDE Spring Tomcat Server
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
When you say "Some modules not loaded", what do you mean? loaded where? Do you mean some modules are not built? or do you mean some modules aren;t able to find other module artifacts while running the test

What's your exact error?
 
Matt Kurz
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you for your attention. (-:
Jayesh A Lalwani wrote:When you say "Some modules not loaded", what do you mean? loaded where? Do you mean some modules are not built? or do you mean some modules aren;t able to find other module artifacts while running the test

What's your exact error?


It's a Tapestry app. I've added a test in a sub project, which uses PageTester, which starts a servlet like container. When it starts it normally should search in the Manifest files for entries which match a name convention. A match is a class which ends with "Module". Which Module-classes are found depends on how and where I start mvn, like I already described.

To be complete: The Module-classes start services. The error messages says, that some of them are missing. It's because the Module classes are not loaded.

Maybe I have to investigate the machanism how moduls are found in detail, and it has to do with the servlet like functionality. Or maybe it has to do with mvn. I'am unsure about what to investigate next. It's strange that mvn install works and mvn test not.
 
Matt Kurz
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The Manifest files are not available during mvn test. So the question is how I make them available during mvn test, considering that some of the sub projects use the surefire plugin.

Another hint is, that some of the modules are loaded when I run mvn test, although there is no jar and therefore no Manifest.

It's still unclear why mvn install or package runs ok, although test comes before in the maven build lifecycle.
 
Matt Kurz
Ranch Hand
Posts: 40
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Found a perfect solution. The container offers the posibility to add Modules explicit.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic