wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes Is Version tag compulsory in dependency tag? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "Is Version tag compulsory in dependency tag?" Watch "Is Version tag compulsory in dependency tag?" New topic
Author

Is Version tag compulsory in dependency tag?

Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 631
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?



All desirable things in life are either illegal, banned, expensive or married to someone else !!!
Jaikiran Pai
Marshal

Joined: Jul 20, 2005
Posts: 10067
    
163

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.


[My Blog] [JavaRanch Journal]
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 631
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 ...
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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...


Cheers, Martijn - Blog,
Twitter, PCGen, Ikasan, My The Well-Grounded Java Developer book!,
My start-up.
Praful Thakare
Ranch Hand

Joined: Feb 10, 2001
Posts: 631
yes i am pointing to valid url, just replaced the original ip address with 1.1.1.1
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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

Joined: Feb 10, 2001
Posts: 631
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
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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

Joined: Feb 10, 2001
Posts: 631
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
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

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

Joined: Feb 10, 2001
Posts: 631
all right, Thanks a ton .
Martijn Verburg
author
Bartender

Joined: Jun 24, 2003
Posts: 3274
    
    5

You're welcome, I should've paid attention to that earlier
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Is Version tag compulsory in dependency tag?