• 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:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

dependencies of modules for a project

 
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
develops a multi-tier ticket project composed of 5 modules:
- ticket-batch
- ticket-business
- ticker-consumer
- ticker-model
- ticket-webapp

Here is the picture of my architecture:



for the parent pom.xml I have the following code:


but for pom.xml modules I do not quite understand the parent relationship, and maven returns errors to me:

pom.xml of ticker-business :




in the pom.xml of the ticket-model I did not define parent dependencies but just junit

Regards
Philippe
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
what dependencies for

- ticket-batch
- ticket-business
- ticker-consumer
- ticker-model
- ticket-webapp
 
Saloon Keeper
Posts: 13396
296
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You haven't actually said why ticket-model failed building. What error message does Maven give?
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Stephan van Hulst wrote:You haven't actually said why ticket-model failed building. What error message does Maven give?



sorry Stephan van,
here you found the output of maven :

 
Sheriff
Posts: 7111
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It seems that ticket-batch points to ticket-consumer, which introduces a loop.  According to your graph, there should be no such dependency.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I corrected some reference but I have a longer error message:



Even in translating I have trouble understanding what is happening!
do you have an idea?

Regards
Philippe
 
Stephan van Hulst
Saloon Keeper
Posts: 13396
296
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
On line 8 it says exactly what's wrong. ticket-model points to ticket-consumer, and ticket-consumer points to ticket-model. You can't have cycles in your dependency graph. Remove the dependency on ticket-consumer from ticket-model.

It appears to me though that you don't completely understand the POM. Can you show me the full POMs of all your projects?
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
thanks you Stephan van,
I do not have a loop but I have an error when I make a "mvn clean" it can not destroy the target directory of ticket-batch.
the shema:


here are the respective poms :
- ticket-batch


- ticket-business


- ticker-consumer



- ticker-model


- ticket-webapp


the root directory ticket


here is what the "mvn clean package" command returns from the VT320 terminal



Regards
Philippe
 
Marshal
Posts: 3720
533
Android Eclipse IDE TypeScript Redhat MicroProfile Quarkus Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

Philippe Ponceblanc wrote: ...I have an error when I make a "mvn clean" it can not destroy the target directory of ticket-batch.


It that the same problem mentioned in this thread?
 
Knute Snortum
Sheriff
Posts: 7111
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You could also try deleting the directory manually:

   rmdir /home/phipo/maven-projets/ticket/ticket-batch/target/test-classes

...if the directory is empty, or

   rm -f /home/phipo/maven-projets/ticket/ticket-batch/target/test-classes

...if it isn't.  
 
Stephan van Hulst
Saloon Keeper
Posts: 13396
296
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Your projects declares a lot of dependencies that aren't in your schema. For instance, the ticket-model project doesn't have any dependencies in your schema, but in the POM file you declare dependencies on ticket-batch, ticket-business and ticket-webapp. You need to fix this for all your POMs.

You don't need to declare groupId and version if your module uses the same group ID and version number as the parent POM. You only declare name if your project name is different from its artifact ID. Declare url when you want to point to the site that hosts your project.

You don't need to declare properties that are already inherited from the parent POM.

Don't depend directly on transitive dependencies. For instance, ticket-model is already a dependency of ticket-consumer, so ticket-business doesn't need to depend on it directly.

If some dependency is used by many of your modules, using the same version and configuration, you can configure it in the dependencyManagement section of your parent POM. JUnit is a good example of this.

I cleaned up your POMs. See if this is what you want:
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hello Stephan van Hulst,
I applied all the changes of the POMs and the parent POM, but there is a small default on ticket-business because it tells me that it is duplicated.
here is my output VT320 after a "mvn clean":

I do not see where the error comes from lack of experience on maven, so where does the redundancy come from?

Regards
Philippe
 
Stephan van Hulst
Saloon Keeper
Posts: 13396
296
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You probably made a mistake while copying XML. There are two projects with the same artifactId. They need to be unique.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I do not know if I succeeded or not, because since eclipse everything works very well with success, but from a terminal in the ticket directory I have build errors,
how can I interpret that.
Eclipse == ok
Terminal VT == nok

here output console eclipse :



here output of terminal


Who should I trust, at the console of eclipse or the terminal?

Regards
Philippe
 
Knute Snortum
Sheriff
Posts: 7111
184
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It's not a matter of trust; it's a matter of environment.  What's different between your Eclipse environment and the command line?  

One thought: which directory are you in when you issue the mvn clean command?  What user are you?  What permissions are different?
 
Stephan van Hulst
Saloon Keeper
Posts: 13396
296
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Eclipse probably has more permissions than your command line. Do your run it as an administrator? If you've built the project once in administrator mode, tools that don't have administrator permissions will not be able to delete the built files.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
eclipse has root rights so I use "mvn clean package" in a terminal VT320 everything went well,
I do not know if it's ok to use the super user?

See you
Philippe
 
Stephan van Hulst
Saloon Keeper
Posts: 13396
296
  • Likes 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Well, in general it's a good idea to not give applications more permissions than they need, but unless you're a system administrator you probably don't really need to worry about it.

Most importantly, do you understand why the POMs work the way they do?
 
You showed up just in time for the waffles! And this tiny ad:
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
reply
    Bookmark Topic Watch Topic
  • New Topic