Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

maven deploy: how to restrict to deploy only the artifacts? (multi-module environment)

I have a project with two modules: client and server. In the parent pom.xml I added info for the deployment phase, so as to deploy to a local directory:

<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>org.my</groupId>
  <artifactId>myTest</artifactId>
  <version>0.1</version>
  <packaging>pom</packaging>
  <name>myTest</name>
  <modules>
    <module>server</module>
    <module>client</module>
  </modules>

<!-- for: mvn deploy -->
<distributionManagement>
    <repository> 
        <id> myRepo </id>
        <url> file:myDeployDir </url>
    </repository>
</distributionManagement>

</project>

When I run mvn deploy not only server-0.1.jar and client-0.1.jar get copied to myDeploy but a sum of 33 (!) files: *pom *sha1 *md5 *xml for pom, metadata and jar.

How can I set that only server-0.1.jar and client-0.1.jar should be copied?

Thanks!

like image 522
cibercitizen1 Avatar asked Jan 22 '13 11:01

cibercitizen1


1 Answers

Use maven deploy-file

deploy:deploy-file is used to install a single artifact along with its pom. In that case the artifact information can be taken from an optionally specified pomFile, but can be completed/overriden using the command line.

like image 68
gammay Avatar answered Oct 04 '22 12:10

gammay