• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

war with dependencies but different names

 
Ranch Hand
Posts: 980
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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?
 
author
Posts: 3285
13
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
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
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.
 
Saloon Keeper
Posts: 27764
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
    Number of slices to send:
    Optional 'thank-you' note:
  • 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
Posts: 3285
13
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
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
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
unfortunately that didnt work out
 
reply
    Bookmark Topic Watch Topic
  • New Topic