• 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
  • Ron McLeod
  • Paul Clapham
  • Jeanne Boyarsky
  • Liutauras Vilda
Sheriffs:
  • Rob Spoor
  • Bear Bibeault
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • Frits Walraven
  • Himai Minh

Is Version tag compulsory in dependency tag?

 
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I have following tag in pom.xml , since the jstl.jar does not have any version, I have not used version tag, but the build fails and asks for version.
how to handle this situtation? shall i rename the jstl.jar to jstl-someversion.jar and add version tag? or there is better option?

 
Sheriff
Posts: 10445
227
IntelliJ IDE Ubuntu
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, Maven requires that you specify the version of the dependency.

shall i rename the jstl.jar to jstl-someversion.jar and add version tag?



You need not rename it. It can continue to be jstl.jar. But to use it in your project that jar needs to be available as a Maven artifact in some repository. Maven internally will scan the artifact for metadata to check for the version of the jar.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I tried with jar file having no vesions, following is my complete tag where maven.jstl.version has value 1.0.6



and my repository has folder structure as

Root\jstl
Root\jstl\jdbc2_0-stdext\1.0.6 etc


and i get following error message with maven

Downloading: file:\\1.1.1.1\repository/jstl/xml-apis/1.0.6/xml-apis-1.0.6.jar
[WARNING] Unable to get resource from repository lis-repository (file:\\1.1.1.1\repository)
Downloading: http://repo1.maven.org/maven2/jstl/xml-apis/1.0.6/xml-apis-1.0.6.jar
[WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
Downloading: file:\\1.1.1.1\repository/jstl/jdbc2_0-stdext/1.0.6/jdbc2_0-stdext-1.0.6.jar
[WARNING] Unable to get resource from repository lis-repository (file:\\1.1.1.1\repository)
Downloading: http://repo1.maven.org/maven2/jstl/jdbc2_0-stdext/1.0.6/jdbc2_0-stdext-1.0.6.jar
[WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)
Downloading: file:\\1.1.1.1\repository/jstl/jaxen-full/1.0.6/jaxen-full-1.0.6.jar
[WARNING] Unable to get resource from repository lis-repository (file:\\1.1.1.1\repository)
Downloading: http://repo1.maven.org/maven2/jstl/jaxen-full/1.0.6/jaxen-full-1.0.6.jar
[WARNING] Unable to get resource from repository central (http://repo1.maven.org/maven2)




any idea whats wrong? also it does not try to download jstl.jar ...
 
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
It looks like you're point maven central repo at:

file:\\1.1.1.1\repository

Is that a valid URL for your version of central? I suspect not...
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i am pointing to valid url, just replaced the original ip address with 1.1.1.1
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Yes, but that's where it's trying to get the files from, if 1.1.1.1 doesn't exist (it seems like a really weird IP address to me) then it's not going to find it.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I mean, my pom.xml has valid ,reachable ip address, I replaced it with 1.1.1.1 to post on this forum.

 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Ah I see now

OK, can you navigate to:

file:\\<The real ip address>\repository/jstl/jdbc2_0-stdext/1.0.6/

In your web browser/File Browser, that will double check you have permissions and that the folder structure is correct (notice that you are using '/' and '\')
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
yes i have the permission and it works if i append -1.0.6 to the name of jar file, but if i remove the vesion then it fails since maven tries to download it with version as shown in following error message

[WARNING] Unable to get resource from repository lis-repository (file:\\1.1.1.1\repository)
Downloading: http://repo1.maven.org/maven2/jstl/jdbc2_0-stdext/1.0.6/jdbc2_0-stdext-1.0.6.jar

 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Just to be clear, if you _add_ the '-1.0.6' to the name of the jar file it works? In thatr case, that is correct maven behaviour, it expects to find a dfile with the version number in the file name.
 
Praful Thakare
Ranch Hand
Posts: 645
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
all right, Thanks a ton .
 
Martijn Verburg
author
Posts: 3281
8
Mac OS X Eclipse IDE Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You're welcome, I should've paid attention to that earlier
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic