You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by RobJac <ro...@caritor.com> on 2006/04/12 17:56:59 UTC

Removing version when creating a jar

I have a project A which i have successfully compiled and packaged. Now when
i try to run mvn install, it tries to create a jar into my local repository.
But its appending the verion also to the jar file which i really want to
avoid. For example in the pom.xml of project A file i have given 
<project>
 <groupId>A</groupId>
  <artifactId>A</artifactId>
  <packaging>jar</packaging>
  <version>1.0</version>
</project>

So its creating a jar file as A-1.0.jar which i dont want to have I just
want it as A.jar. I believe version tag is mandatory as i tried removing it.
Please advice

Thanks in advance
Robin
--
View this message in context: http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a3884329
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Removing version when creating a jar

Posted by ruelloehr <ru...@jboss.com>.
No.  The version is always placed in the name when uploaded into the
repository.  There is not a way around this.
--
View this message in context: http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4068132
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Removing version when creating a jar

Posted by Nic Holbrook <ni...@tch.com>.
One of the reasons I do this now is because the new ejb3 spec allows for 
looking up objects based on a class.  These new jndi objects are scoped 
based on the name of the ear.  I remove the version so that I can keep 
the same code and reference the objects through jndi the same way each 
time.  I believe there is a mechanism to override these names and 
provide your own, but I'm just a lazy programmer... 

Nic

Arik Kfir wrote:

>sorry for butting in - but why would you want to do that?
>
>On 4/24/06, Nic Holbrook <ni...@tch.com> wrote:
>  
>
>>What I do to get around this is let maven do its thing then when I
>>deploy the jars, I use an ant task to copy the correct file out to my
>>server using the name minus the version.
>>
>>RobJac wrote:
>>
>>    
>>
>>>I can actually remove the version when i package, but when i execute mvn
>>>installl for the project it again places the project-version.jar in my
>>>localrepository under the following folder path
>>><localRepository>/{groupId}/{version}/project-version.jar. I am facing an
>>>issue when i am trying to create an EAR. Since all the projects are
>>>      
>>>
>>getting
>>    
>>
>>>created from the the local repository all the projects are getting
>>>      
>>>
>>appended
>>    
>>
>>>with version number which I want to avoid. Please let me know how i can
>>>avoid gettuing the version number appended when i execute  mvn install
>>>      
>>>
>>for a
>>    
>>
>>>project or Can i  over ride the name of the dependency project jars when
>>>they are fetched from the repository?
>>>--
>>>View this message in context:
>>>      
>>>
>>http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4012162
>>    
>>
>>>Sent from the Maven - Users forum at Nabble.com.
>>>
>>>
>>>---------------------------------------------------------------------
>>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>>For additional commands, e-mail: users-help@maven.apache.org
>>>
>>>
>>>[tch]
>>>
>>>
>>>
>>>      
>>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>>For additional commands, e-mail: users-help@maven.apache.org
>>
>>
>>    
>>
>
>
>--
>______________________________________
>Cheers,
>      Arik Kfir                                   arikkfir@gmail.com
>      Linux user, number 415067 - http://counter.li.org/
>      http://corleon.dnsalias.org
>
>[tch]
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Removing version when creating a jar

Posted by Wayne Fay <wa...@gmail.com>.
I've never understood this desire to remove version numbers from Jars
built by Maven... In fact, I can't stand it when I run across a jar
with no version number and have to dig into it to find a version
either in a manifest or other random file.

Wayne

On 4/24/06, Arik Kfir <ar...@gmail.com> wrote:
> sorry for butting in - but why would you want to do that?
>
> On 4/24/06, Nic Holbrook <ni...@tch.com> wrote:
> >
> > What I do to get around this is let maven do its thing then when I
> > deploy the jars, I use an ant task to copy the correct file out to my
> > server using the name minus the version.
> >
> > RobJac wrote:
> >
> > >I can actually remove the version when i package, but when i execute mvn
> > >installl for the project it again places the project-version.jar in my
> > >localrepository under the following folder path
> > ><localRepository>/{groupId}/{version}/project-version.jar. I am facing an
> > >issue when i am trying to create an EAR. Since all the projects are
> > getting
> > >created from the the local repository all the projects are getting
> > appended
> > >with version number which I want to avoid. Please let me know how i can
> > >avoid gettuing the version number appended when i execute  mvn install
> > for a
> > >project or Can i  over ride the name of the dependency project jars when
> > >they are fetched from the repository?
> > >--
> > >View this message in context:
> > http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4012162
> > >Sent from the Maven - Users forum at Nabble.com.
> > >
> > >
> > >---------------------------------------------------------------------
> > >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > >For additional commands, e-mail: users-help@maven.apache.org
> > >
> > >
> > >[tch]
> > >
> > >
> > >
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> > For additional commands, e-mail: users-help@maven.apache.org
> >
> >
>
>
> --
> ______________________________________
> Cheers,
>      Arik Kfir                                   arikkfir@gmail.com
>      Linux user, number 415067 - http://counter.li.org/
>      http://corleon.dnsalias.org
>

Re: Removing version when creating a jar

Posted by Arik Kfir <ar...@gmail.com>.
sorry for butting in - but why would you want to do that?

On 4/24/06, Nic Holbrook <ni...@tch.com> wrote:
>
> What I do to get around this is let maven do its thing then when I
> deploy the jars, I use an ant task to copy the correct file out to my
> server using the name minus the version.
>
> RobJac wrote:
>
> >I can actually remove the version when i package, but when i execute mvn
> >installl for the project it again places the project-version.jar in my
> >localrepository under the following folder path
> ><localRepository>/{groupId}/{version}/project-version.jar. I am facing an
> >issue when i am trying to create an EAR. Since all the projects are
> getting
> >created from the the local repository all the projects are getting
> appended
> >with version number which I want to avoid. Please let me know how i can
> >avoid gettuing the version number appended when i execute  mvn install
> for a
> >project or Can i  over ride the name of the dependency project jars when
> >they are fetched from the repository?
> >--
> >View this message in context:
> http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4012162
> >Sent from the Maven - Users forum at Nabble.com.
> >
> >
> >---------------------------------------------------------------------
> >To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> >For additional commands, e-mail: users-help@maven.apache.org
> >
> >
> >[tch]
> >
> >
> >
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>


--
______________________________________
Cheers,
      Arik Kfir                                   arikkfir@gmail.com
      Linux user, number 415067 - http://counter.li.org/
      http://corleon.dnsalias.org

Re: Removing version when creating a jar

Posted by RobJac <ro...@caritor.com>.
I have found a way to remove the version, in my ear pom xml i am using under
the configuration of my ear-plugin

				<javaModule> 
				<groupId>Test</groupId> 
				<artifactId>Test</artifactId> 
                                                               
<bundleFileName>Test.jar</bundleFileName> 
				</javaModule>
				<webModule> 
				<groupId>Test_WEB</groupId> 
				<artifactId>Test_WEB</artifactId> 
				<bundleFileName>Test_WEB.war</bundleFileName> 
				</webModule>
--
View this message in context: http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4069067
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Removing version when creating a jar

Posted by Nic Holbrook <ni...@tch.com>.
What I do to get around this is let maven do its thing then when I 
deploy the jars, I use an ant task to copy the correct file out to my 
server using the name minus the version. 

RobJac wrote:

>I can actually remove the version when i package, but when i execute mvn
>installl for the project it again places the project-version.jar in my
>localrepository under the following folder path 
><localRepository>/{groupId}/{version}/project-version.jar. I am facing an
>issue when i am trying to create an EAR. Since all the projects are getting
>created from the the local repository all the projects are getting appended
>with version number which I want to avoid. Please let me know how i can
>avoid gettuing the version number appended when i execute  mvn install for a
>project or Can i  over ride the name of the dependency project jars when
>they are fetched from the repository?
>--
>View this message in context: http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4012162
>Sent from the Maven - Users forum at Nabble.com.
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
>For additional commands, e-mail: users-help@maven.apache.org
>
>
>[tch]
>
>  
>


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Removing version when creating a jar

Posted by RobJac <ro...@caritor.com>.
I can actually remove the version when i package, but when i execute mvn
installl for the project it again places the project-version.jar in my
localrepository under the following folder path 
<localRepository>/{groupId}/{version}/project-version.jar. I am facing an
issue when i am trying to create an EAR. Since all the projects are getting
created from the the local repository all the projects are getting appended
with version number which I want to avoid. Please let me know how i can
avoid gettuing the version number appended when i execute  mvn install for a
project or Can i  over ride the name of the dependency project jars when
they are fetched from the repository?
--
View this message in context: http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a4012162
Sent from the Maven - Users forum at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org


Re: Removing version when creating a jar

Posted by Wayne Fay <wa...@gmail.com>.
You can remove the version number from your artifact by using the
following tag in your pom:

<build>
 <finalName>${project.artifactId}</finalName>
</build>

Wayne

On 4/12/06, RobJac <ro...@caritor.com> wrote:
>
> I have a project A which i have successfully compiled and packaged. Now when
> i try to run mvn install, it tries to create a jar into my local repository.
> But its appending the verion also to the jar file which i really want to
> avoid. For example in the pom.xml of project A file i have given
> <project>
>  <groupId>A</groupId>
>  <artifactId>A</artifactId>
>  <packaging>jar</packaging>
>  <version>1.0</version>
> </project>
>
> So its creating a jar file as A-1.0.jar which i dont want to have I just
> want it as A.jar. I believe version tag is mandatory as i tried removing it.
> Please advice
>
> Thanks in advance
> Robin
> --
> View this message in context: http://www.nabble.com/Removing-version-when-creating-a-jar-t1438924.html#a3884329
> Sent from the Maven - Users forum at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>