У меня есть приложение, разработанное на java. Я не знаю, почему, когда я делаю mvn clean install deploy, я получаю jar-файлы, развернутые дважды в Nexus. Мое приложение является мультимодульным, и я хочу развернуть jar только один раз, потому что в репозиториях релизов я не могу развернуть jar дважды. моя версия java - 8, моя версия maven - 3.3.9. Я думаю, что один из плагинов развертывается дважды, но я не знаю, какой именно.
это мой pom:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>test.muppet</groupId>
<artifactId>muppet-master-pom</artifactId>
<packaging>pom</packaging>
<name>muppet-master-pom</name>
<version>2.9.0-Delivery</version>
<!-- Paramètres du build -->
<properties>
<project.build.sourceEncoding>windows-1252</project.build.sourceEncoding>
<project.reporting.outputEncoding>windows-1252</project.reporting.outputEncoding>
<timestamp>${maven.build.timestamp}</timestamp>
<maven.build.timestamp.format>yyyyMMdd_HHmm</maven.build.timestamp.format>
<!-- Le numéro de version est forgé dans le pom war à l'aide d'un appel externe à SVN -->
<muppet.master.build.version>${project.version}-R${muppet.buildnumber}-${timestamp}</muppet.master.build.version>
<muppet.subversion.uri>https://svn.dev.me.fr/muppet/trunk</muppet.subversion.uri>
</properties>
<!-- Meta informations concernant l'environnement du projet
SVN : permet la récupéation de la révision courante au build et les opérations automatiques depuis Jenkins
l'url peut être surchargée au moment du build (ligne de commande)
Distribution : Informations concernant les dépôts Nexus pour la récupération des livrables
-->
<scm>
<connection>scm:svn:${muppet.subversion.uri}</connection>
<developerConnection>scm:svn:${muppet.subversion.uri}</developerConnection>
<url>https://svn.dev.me.fr/muppet/</url>
</scm>
<distributionManagement>
<snapshotRepository>
<id>Snapshots</id>
<url>https://test.fr/repository/mpt-muppet-maven-snapshot/</url>
</snapshotRepository>
<repository>
<id>Releases</id>
<url>https://test.fr/repository/mpt-muppet-maven-release/</url>
</repository>
<site>
<id>muppet.website</id>
<name>Site de documentation MUPPET</name>
<url>scp://test.fr/home/webadm/apps/apache-tomcat-7.0.20/webapps/muppet-doc/</url>
</site>
</distributionManagement>
<!-- Définition des modules du projet -->
<modules>
<module>muppet-model-jar</module>
<module>muppet-processor-jar</module>
<module>muppet-core-jar</module>
<module>muppet-mock-jar</module>
<module>muppet-export-jar</module>
<module>muppet-web-war</module>
<module>muppet-main-ear</module>
<module>muppet-distribution</module>
</modules>
<!-- Dépendances communes à l'ensemble des modules -->
<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.8.1</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.thoughtworks.xstream</groupId>
<artifactId>xstream</artifactId>
<version>1.3.1</version>
<scope>test</scope>
</dependency>
</dependencies>
<!-- Description du build -->
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.5</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
<encoding>${project.build.sourceEncoding}</encoding>
</configuration>
</plugin>
<!-- Plugin maven-release-plugin : orchestre l'automatisation du process de release
Les releases sont effectuées depuis Jenkins (le type de release varie selon le job)
-->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-release-plugin</artifactId>
<version>2.5.3</version>
<configuration>
<!-- Le provider 'javasvn' permet de ne pas avoir de client SVN sur la machine hôte du build -->
<providerImplementations>
<svn>javasvn</svn>
</providerImplementations>
<branchBase>https://svn.dev.me.fr:6443/muppet/branches/</branchBase>
<tagBase>https://svn.dev.me.fr:6443/muppet/tags/deliveries/</tagBase>
<tagNameFormat>@{project.version}</tagNameFormat>
<username>hudsonNucThF</username>
<password>c43TA3xm</password>
<!-- Le build (y.c. tests) crée des fichier à ignorer au moment de la création d'une branche / d'un tag -->
<checkModificationExcludes>
<checkModificationExclude>**/rpcPolicyManifest</checkModificationExclude>
<checkModificationExclude>**/symbolMaps</checkModificationExclude>
<checkModificationExclude>**/traces.log</checkModificationExclude>
<checkModificationExclude>**/target</checkModificationExclude>
<checkModificationExclude>**/.sonar</checkModificationExclude>
<checkModificationExclude>**/muppet-data-test</checkModificationExclude>
</checkModificationExcludes>
<useReleaseProfile>false</useReleaseProfile>
<goals>deploy</goals>
</configuration>
<dependencies>
<dependency>
<groupId>com.google.code.maven-scm-provider-svnjava</groupId>
<artifactId>maven-scm-provider-svnjava</artifactId>
<version>2.1.1</version>
</dependency>
<dependency>
<groupId>org.tmatesoft.svnkit</groupId>
<artifactId>svnkit</artifactId>
<version>1.8.5</version>
</dependency>
</dependencies>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.1</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.12</version>
<executions>
<execution>
<id>add-integration-test-source</id>
<phase>generate-test-resources</phase>
<goals>
<goal>add-test-source</goal>
</goals>
<configuration>
<sources>src/it/java</sources>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.19.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.19.1</version>
</dependency>
</dependencies>
<configuration>
<redirectTestOutputToFile>false</redirectTestOutputToFile>
<argLine>-Dfile.encoding=windows-1252 @{surefireArgLine}</argLine>
<!--<excludedGroups>test.muppet.IntegrationTest</excludedGroups>-->
</configuration>
</plugin>
<!-- Gestion de la couverture de code pour les TU & TI
Les conventions précisées ici sont reprises dans la configuration des analyses SONAR (cf. Jenkins)
Par conséquent toute modification d'une partie doit être reportée dans l'autre
-->
<plugin>
<groupId>org.jacoco</groupId>
<artifactId>jacoco-maven-plugin</artifactId>
<version>0.7.5.201505241946</version>
<executions>
<!-- TU -->
<execution>
<id>pre-unit-test</id>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</destFile>
<propertyName>surefireArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-unit-test</id>
<phase>test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-reports/jacoco-ut.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-ut</outputDirectory>
</configuration>
</execution>
<!-- TI -->
<execution>
<id>pre-integration-test</id>
<phase>pre-integration-test</phase>
<goals>
<goal>prepare-agent</goal>
</goals>
<configuration>
<destFile>${project.build.directory}/coverage-reports/jacoco-it.exec</destFile>
<propertyName>failsafeArgLine</propertyName>
</configuration>
</execution>
<execution>
<id>post-integration-test</id>
<phase>post-integration-test</phase>
<goals>
<goal>report</goal>
</goals>
<configuration>
<dataFile>${project.build.directory}/coverage-reports/jacoco-it.exec</dataFile>
<outputDirectory>${project.reporting.outputDirectory}/jacoco-it</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.2</version>
</plugin>
</plugins>
<pluginManagement>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-source-plugin</artifactId>
<version>2.1.2</version>
<configuration>
<attach>false</attach>
</configuration>
<executions>
<execution>
<id>attach-sources</id>
<phase>verify</phase>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<!-- Ajout de SCP pour la publication de la documentation -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-site-plugin</artifactId>
<version>3.5.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh</artifactId>
<version>2.10</version>
</dependency>
<dependency>
<groupId>org.apache.maven.wagon</groupId>
<artifactId>wagon-ssh-common</artifactId>
<version>2.10</version>
</dependency>
</dependencies>
</plugin>
</plugins>
</pluginManagement>
</build>
<!-- Génération de la Javadoc (y.c. diagrammes de classes)
Nécessite la présence de graphviz sur le poste.
-->
<reporting>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<configuration>
<failOnError>false</failOnError>
<doclet>org.umlgraph.doclet.UmlGraphDoc</doclet>
<docletArtifact>
<groupId>org.umlgraph</groupId>
<artifactId>umlgraph</artifactId>
<version>5.6</version>
</docletArtifact>
<additionalparam>-views -all</additionalparam>
<useStandardDocletOptions>true</useStandardDocletOptions>
</configuration>
</plugin>
</plugins>
</reporting>
<profiles>
<!-- Profil TI : activation des tests d'intégration
les TI étant chronophages ils ne sont pas systématiquement lancés, leur activation se fait via le profil ti
-->
<profile>
<id>ti</id>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>2.19.1</version>
<dependencies>
<dependency>
<groupId>org.apache.maven.surefire</groupId>
<artifactId>surefire-junit47</artifactId>
<version>2.19.1</version>
</dependency>
</dependencies>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
<configuration>
<argLine>@{failsafeArgLine}</argLine>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>gwtSdm</id>
<dependencies>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-codeserver</artifactId>
<version>2.6.1</version>
</dependency>
<dependency>
<groupId>com.google.gwt</groupId>
<artifactId>gwt-dev</artifactId>
<version>2.6.1</version>
</dependency>
</dependencies>
</profile>
</profiles>
<repositories>
<repository>
<releases>
<enabled>true</enabled>
</releases>
<snapshots>
<enabled>false</enabled>
</snapshots>
<id>central</id>
<name>central</name>
<url>http://repo1.maven.org/maven2/</url>
</repository>
<repository>
<id>forge-Release</id>
<url>https://test.fr/nexus/content/repositories/test-release/</url>
</repository>
</repositories>
</project>