2

I am using Maven 3 for build xxx-common module

After building my application i get my jar file as xxx-common-0.0.1.jar

this is getting deployed into my artifactory as

http://localhost:8800/artifactory/core-release/com/xxx/xxx-common/0.0.1/xxx-common-0.0.1.jar

That deployment is good,

Here, how can I eliminate version number getting appended " xxx-common-0.0.1.jar " and need it just as " xxx-common.jar "

Kindly help out to overcome this problem guys...


Sorry it didn't worked out

Below is what i gave....

<plugins>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>2.3.2</version>
                <configuration>
                    <finalName>${project.artifactId}</finalName>
                </configuration>
            </plugin>


            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.1</version>
                <configuration>
                    <source>1.6</source>
                    <target>1.6</target>
                </configuration>
            </plugin> 

        </plugins>

executed using

mvn package

and

Installing /home/xxx/build-deploy-tools/.jenkins/jobs/workspace/xxx-common/target/xxx-common.jar to /home/xxx/.m2/repository/com/xxx/xxx-common/0.0.1/xxx-common-0.0.1.jar

Still it pushes as xxx-common-0.0.1.jar

Adam Lear
  • 38,111
  • 12
  • 81
  • 101
BalaB
  • 3,687
  • 9
  • 36
  • 58
  • 2
    This is the maven convention. Why would you want it to be different? – Raghuram Jan 03 '12 at 11:19
  • 1
    This is very similar to http://stackoverflow.com/questions/2225142/removing-version-number-from-file-name-with-maven. (It actually answers the question as well...) – Jaco Van Niekerk Jan 03 '12 at 11:20

2 Answers2

6

In your repository, you cannot ever get rid of the numbers. In your target directory, you can use a finalName element in the configuration of the Maven JAR Plugin.

bmargulies
  • 97,814
  • 39
  • 186
  • 310
0

You can define it at the outputFileNameMapping config option for you project.

This option defaults to

${module.artifactId}-${module.version}${dashClassifier?}.${module.extension}

So, in your case, you could change it to

${module.artifactId}.${module.extension}

Reference: http://maven.apache.org/plugins/maven-assembly-plugin/assembly.html

Tomas Narros
  • 13,390
  • 2
  • 40
  • 56