This week's book giveaway is in the Java in General forum.
We're giving away four copies of Event Streams in Action and have Alexander Dean & Valentin Crettaz on-line!
See this thread for details.
Win a copy of Event Streams in Action this week in the Java in General forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Devaka Cooray
  • Liutauras Vilda
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Paul Clapham
  • Knute Snortum
  • Rob Spoor
Saloon Keepers:
  • Tim Moores
  • Ron McLeod
  • Piet Souris
  • Stephan van Hulst
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Frits Walraven
  • Ganesh Patekar

The version cannot be empty and spring-web:jar is missing.

 
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi,
I write a ticket WEB application with several modules, so several pom.xml. In ticket-webapp my pom.xml returns an error that I can not get around.
here is an excerpt from my pom.xml:




error >>

and



error >>

I introduced the JARs corresponding to the version of the spring 4.3.11 framework
 
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It seems to be complaining that you didn't include a <version> element on your spring-web dependency. Which is interesting, since I thought that version was optional.

But optional or not, it's not good practice to omit a version indicator. One of Maven's strengths is that it can build exactly the same module years after the components that went into it have gone through multiple version upgrades. Specifying explicit version dependencies assures that the component being requested is going to be known to work in that module. So always provide a version.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:It seems to be complaining that you didn't include a <version> element on your spring-web dependency. Which is interesting, since I thought that version was optional.

But optional or not, it's not good practice to omit a version indicator. One of Maven's strengths is that it can build exactly the same module years after the components that went into it have gone through multiple version upgrades. Specifying explicit version dependencies assures that the component being requested is going to be known to work in that module. So always provide a version.




at the beginning of my pom.xml I have included the version

 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator



integral of my pom.xml , i have 2 errors

 
Tim Holloway
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Modelversion is the Maven version, which Maven can use to tell if your POM should be able to build under a specific version of Maven.

The version numbers you need are on each dependency. You are using variable definition, which is good, since you can ensure that when you move to a new version of Spring, you can cause all dependencies to move at the same time without individually editing them:

<version>${spring.version}</version>
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:Modelversion is the Maven version, which Maven can use to tell if your POM should be able to build under a specific version of Maven.

The version numbers you need are on each dependency. You are using variable definition, which is good, since you can ensure that when you move to a new version of Spring, you can cause all dependencies to move at the same time without individually editing them:

<version>${spring.version}</version>



thanks Tim,

now i have new errors of my pom.xml




pom.xml ticket-technical

 
Tim Holloway
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
What are the errors?
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:What are the errors?





error 1 >>>


error 2 >>>
 
Tim Holloway
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
And you still haven't added a version element to that dependency.

Which is why it's still annoyed.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:And you still haven't added a version element to that dependency.

Which is why it's still annoyed.



after add spring of version, i have a  new error
 
Tim Holloway
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Why did you delete this?



That's where "spring.version" is defined.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks you Tim,

I have 3 errors on pom.xml module ticket-webapp !



here this is the integral of same pom.xml


this the lasted errors
 
Tim Holloway
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You are still missing version elements for most of your dependencies. But the more immediate problem would appear to be that the three items indicated have not been stored in your Maven repository.
 
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is that perhaps what the parent pom is supposed to do?
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Tim Holloway wrote:But the more immediate problem would appear to be that the three items indicated have not been stored in your Maven repository.




where is my Maven repository? what pom.xml to implement?
and what dependencies do I have to add?
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Is that perhaps what the parent pom is supposed to do?



packager the application into war in ticket-webapp, but I did not locate the parent pom that can be in ticket-webapp or ticket.
here is my project achitecure:

ticket
ticket-batch
ticket-business
ticket-consumer
ticket-model
tcket-technical
ticket-web-app

it is on the pom ticket-webapp that I have errors cited on previous messages.
 
Knute Snortum
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
So what is the directory structure?  My understanding is it need to look like this:

|--child-directory
|  `--pom.xml (child)
|
`--pom.xml (parent)

And is the child pom creating its package in a place where the parent pom can see it?
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:So what is the directory structure?  My understanding is it need to look like this:

|--child-directory
|  `--pom.xml (child)
|
`--pom.xml (parent)

And is the child pom creating its package in a place where the parent pom can see it?



the parent pom.xml is in ticket-webapp,  it's this one !
 
Knute Snortum
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Philippe Ponceblanc wrote:the parent pom.xml is in ticket-webapp,  it's this one !


Not sure what you mean by this.

Another thing you can do is run the child poms one by one and see if they're all creating output and that this output can be see by the parent.  The usual place for dependent jars to be is in the .m2 directory in your home directory.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:

Philippe Ponceblanc wrote:the parent pom.xml is in ticket-webapp,  it's this one !


Not sure what you mean by this.

Another thing you can do is run the child poms one by one and see if they're all creating output and that this output can be see by the parent.  The usual place for dependent jars to be is in the .m2 directory in your home directory.



Hello,
my parent pom is in ticket.
here is the code :


I compile independently each module only 2 modules have no error: ticket-technical and ticket-model.
all the other modules are in error with maven.

I did a project maven / update

are there any errors in my parent?
 
Knute Snortum
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Likes 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Whenever you say, "There were errors," be sure to also post the error message.  If you are having multiple errors, let's look at them one at a time, starting with the child poms.  Execute one of them, post the pom and the error message.  The parent error is almost certainly that it can't find the jar the child pom was supposed to create.
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

Knute Snortum wrote:Whenever you say, "There were errors," be sure to also post the error message.  If you are having multiple errors, let's look at them one at a time, starting with the child poms.  Execute one of them, post the pom and the error message.  The parent error is almost certainly that it can't find the jar the child pom was supposed to create.




i have this modules :





ticket-model >> build success














ticket-technical >> build success
 
Philippe Ponceblanc
Ranch Hand
Posts: 210
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I do not continue this project in multi modules, I prefer working with a single pom.xml

Thank you for your help
 
Knute Snortum
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
For what it's worth, you may have circular dependencies in the child poms.
 
Knute Snortum
Sheriff
Posts: 6108
157
Eclipse IDE Postgres Database VI Editor Chrome Java Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It looks like model was the only successful build.  Did it post a jar in "user directory"/.m2 directory?  Just a thought if you want to keep looking.
 
Tim Holloway
Bartender
Posts: 20924
127
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
In short, is there a file named something like HOME_DIR/.m2/repository/org/example/demo/ticket-business/4.3.11.RELEASE/ticket-business-4.3.11.RELEASE.jar?
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!