Bonjour à tous :)
Je voulais savoir si il était possible via Maven de générer un dossier qui contiendra en outre le Jar et la différente documentation.
Je vous remercie de votre aide. :ccool:
Leniouns
Version imprimable
Bonjour à tous :)
Je voulais savoir si il était possible via Maven de générer un dossier qui contiendra en outre le Jar et la différente documentation.
Je vous remercie de votre aide. :ccool:
Leniouns
Tu peux regarder du côté des assemblies Maven :
http://maven.apache.org/plugins/maven-assembly-plugin/
Si c'est vraiment un répertoire que tu souhaites, tu n'auras qu'à spécifier dir sur le format.
Merci pour ton aide :ccool:
Cependant comment faire pour que grâce à Maven, je puisse générer un fichier jar et que j'intègre ce dernier dans un fichier (lui même généré par maven) avec d'autres éléments. En gros je voudrais générer un jar et un répertoire dans lequel je mettrais le jar. :D
Pour vous aider voici mon POM et mon Assembly :
Code:
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124 <?xml version="1.0" encoding="UTF-8"?> <project> <modelVersion>4.0.0</modelVersion> <groupId>OUATE</groupId> <artifactId>jAriane</artifactId> <packaging>jar</packaging> <version>2.3.0</version> <reporting> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-javadoc-plugin</artifactId> <version>2.7</version> <configuration> </configuration> </plugin> </plugins> </reporting> <build> <!-- Définition de l'arborescence "OUATE" --> <sourceDirectory>src</sourceDirectory> <testSourceDirectory>test</testSourceDirectory> <defaultGoal>clean install</defaultGoal> <!-- Inclusion des fichiers ressources pour les tests automatiques --> <testResources> <testResource> <directory>test/com/tas/ouate/jariane/common/util/resources</directory> </testResource> </testResources> <plugins> <!-- Plugin pour la compilation --> <plugin> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.6</source> <target>1.6</target> </configuration> </plugin> <!-- Plugin pour la création d'un JAR exécutable --> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.1</version> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <descriptor>assembly.xml</descriptor> <archive> <manifest> <mainClass>fr.thales.ouate.jAriane.Main.Ariane</mainClass> </manifest> </archive> </configuration> </plugin> </plugins> </build> <!-- Dépendances --> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>4.8.2</version> <scope>test</scope> </dependency> <dependency> <groupId>OUATE</groupId> <artifactId>OUATE</artifactId> <version>1.15.0-SNAPSHOT</version> </dependency> <dependency> <groupId>OUATE</groupId> <artifactId>jCosy</artifactId> <version>1.4.0-SNAPSHOT</version> </dependency> <dependency> <groupId>log4j</groupId> <artifactId>log4j</artifactId> <version>1.2.13</version> </dependency> <dependency> <groupId>org.jdom</groupId> <artifactId>jdom</artifactId> <version>1.1</version> </dependency> <dependency> <groupId>net.sourceforge.jexcelapi</groupId> <artifactId>jxl</artifactId> <version>2.6.10</version> </dependency> <dependency> <groupId>jgoodies</groupId> <artifactId>looks</artifactId> <version>1.2.2</version> </dependency> </dependencies> </project>
Code:
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21 <assembly> <id>with-dep</id> <formats> <format>jar</format> </formats> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets> <dependencySet> <outputDirectory>/</outputDirectory> <unpack>true</unpack> <scope>runtime</scope> </dependencySet> </dependencySets> <files> <file> <source>target/jAriane-2.3.0-with-dep.jar</source> <outputDirectory>TestLOL</outputDirectory> </file> </files> </assembly>