This week's book giveaway is in the Design forum.
We're giving away four copies of Design for the Mind and have Victor S. Yocco on-line!
See this thread for details.
Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

war with dependencies but different names

 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator


and dependency in the repository is 1.x

How can i have the dependency and at the same time bundle it with a different name?
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there,

I'm not really sure what you mean by this question. Are you trying to bundle the commons-beanutils jar in the WAR file but using a different name?
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,

Apologies if i was not clear about the question

I actually have a dependency say spring-2.0.jar in my repository.

For the war, i want to have the dependecy and bundle it with the name spring.jar.

I tried all but it always is getting embedded as spring-2.0.jar

Thanks in advance

Regards
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That makes sense

Can I ask why you want to rename this? It's usually a very good idea to know exactly what versions you have in an archive and is definitely encouraged by Maven.
 
Tim Holloway
Saloon Keeper
Pie
Posts: 18094
48
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
It's not a good idea to rename the jar. The app doesn't care what the jar's name is, and if you remove the version number, you're discarding information that might be important to know someday.

Also, if there's a dependency on a certain version and you force a different version to be included, you may have problems. The reason dependencies carry version identifiers is that they want to make sure apps don't fail because an incompatible version was included.

Most importantly, there's no reason why you should be including beanutils manually. Beanutils is available as a Maven repository resource, so you should declare it as a dependency if you need to. If it's referenced by one of your other dependencies (such as Struts), you won't have to, since the dependencies cascade.

If you're customizing BeanUtils for some reason, make the custom BeanUtils a Maven project, use mvn install to install the custom version in your repository and use the dependency mechanism in the same way you would for one of the standard BeanUtils releases.
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have used spring or commons-xxxx.jar names as a reference.

We previously were building the applications using the IDE and then using ant. So this particular jar was a dependency for one of the war and is embedded within it.

Currenlty as part of maven migration,i have installed the same to the repository as x-1.0.jar.

Now as part of the war build,i want to embed it to the war as x.jar and not as x-1.0.jar


Regards
[ October 28, 2008: Message edited by: A Kumar ]
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Am not in the office to check this out....but would this help out.


file-name-mappingl
 
Martijn Verburg
author
Bartender
Posts: 3275
5
Eclipse IDE Java Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I believe that will do the trick yes, but I'll re-iterate what the others have said and say that I would personally keep the version numbers
 
A Kumar
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
unfortunately that didnt work out
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic