• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Problems with Multi Module project

 
Ranch Hand
Posts: 40
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
Rancher
Posts: 2759
32
Eclipse IDE Spring Tomcat Server
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Found a perfect solution. The container offers the posibility to add Modules explicit.
 
Time is mother nature's way of keeping everything from happening at once. And this is a tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic