J'ai un projet maven qui comporte 2 modules ("monProjet" et "monProjet-Intégration-tests").
J'ai tenté (en vain) de faire la chose suivante:

Au lieu de jouer les tests (d'intégration) directement sur monProjet.jar (créé d'après la commande "mvn clean install"), je tente d'insérer les étapes suivantes dans le POM de mon projet:

1) Empaqueter monProjet.jar dans un fichier d'installation (monProjetSetup.exe par exemple)
2) Installer monProjet.jar en exécutant monProjetSetup.exe. (de préférence dans mon repository local)
3) Exécuter les tests (depuis le module "monProjet-Intégration-tests") sur monProjet.jar issu du setup

La 1ère étape ci-dessus fonctionne grâce à l'implémentation d'une version modifée du plugin assembly.
La 3ème étape est classique et ne pose pas de problème particulier (tant qu'un "monProjet.jar" se trouve au bon endroit).

C'est la 2ème étape qui pose problème. En fait elle est purement et simplement ignoré, du fait, à mon avis de l'invocation du plugin deploy en dehors du cycle de vie Maven.

Quelqu'un aurait-il une idée sur la manière de procéder pour que les étapes 1 et 2 que je viens de décrire s'exécutent à la suite d'une seule commande "mvn clean install"?

Merci d'avance


*** Extrait du POM de monProjet ***

Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
<project>
  <modelVersion>4.0.0</modelVersion>
  <groupId>myGroup</groupId>
  <artifactId>myArtifact</artifactId>
  <packaging>jar</packaging>
  <name>myProject</name>
    <version>2.0-SNAPSHOT</version>
  <build>
    <plugins>
      <!-- plugin customAssembly: create an setup exe file from the generated jar file and all its dependencies -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-customAssembly-plugin</artifactId>
        <configuration>
          <installerCompilerPath>
            C:/Program Files/Inno-Setup-5/ISCC.exe
          </installerCompilerPath>
          <installerScriptTemplate>
            src/assembly/scriptIIS.vm
          </installerScriptTemplate>
          <installerScriptTemplateProperties>
            <myKey>myValue</myKey>
          </installerScriptTemplateProperties>
          <descriptor>src/assembly/src.xml</descriptor>
          <finalName>${project.name}</finalName>
          <outputDirectory>
            ${project.build.directory}
          </outputDirectory>
        </configuration>
        <executions>
          <execution>
            <phase>install</phase>
            <goals>
              <goal>customAssembly</goal>
            </goals>
          </execution>
        </executions>
      </plugin>
      <!-- plugin exec: execute the setup in silent mode -->
      <plugin>
        <groupId>org.codehaus.mojo</groupId>
        <artifactId>exec-maven-plugin</artifactId>
        <executions>
          <execution>
            <phase>install</phase>
            <goals>
              <goal>exec</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <executable>${project.name}.exe</executable>
          <workingDirectory>
            ${project.build.directory}\installer
          </workingDirectory>
          <arguments>
            <argument>/VERYSILENT</argument>
            <argument>
              /DIR=${project.build.directory}\installer\temp"
            </argument>
          </arguments>
        </configuration>
      </plugin>
      <!-- plugin deploy: this stage is never performed. I think because it is out of the lifecycle? How to do? -->
      <plugin>
        <groupId>org.apache.maven.plugins</groupId>
        <artifactId>maven-deploy-plugin</artifactId>
        <executions>
          <execution>
            <phase>deploy</phase>
            <goals>
              <goal>deploy-file</goal>
            </goals>
          </execution>
        </executions>
        <configuration>
          <url>file://${localRepository}\myProject-exe</url>
          <file>${project.build.directory}\installer\${project.name}.exe</file>
          <version>${project.version}</version>
          <groupId>myGroup</groupId>
          <artifactId>myProject-exe</artifactId>
          <packaging>jar</packaging>
        </configuration>
      </plugin>      
    </plugins>
  </build>
</project>