Bonjour à tous,

Je cherche à produire un war avec maven qui doit contenir un jar construit lui aussi par maven et qui sera déposé dans {war-file}/applets/ au lieu d'être mis dans {war-file}/WEB-INF/lib/.

Elle une solution à ce problème et elle fonctionne bien en ce qui concerne la production du war. J'utilise le goal copy du plugin maven-dependency-plugin afin de placer mon jar où je veux dans le war. Voivi le pom correspondant :
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
<?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>
 
	<parent>
		<groupId>jkt.centralisateur</groupId>
		<artifactId>centralisateur</artifactId>
		<version>1.0-SNAPSHOT</version>
	</parent>
 
 
	<artifactId>centralisateur-war</artifactId>
	<name>centralisateur-war</name>
	<packaging>war</packaging>
 
	<properties>
		<centralisateur-war-name>centralisateur-war</centralisateur-war-name>
	</properties>
 
	<dependencies>
		<dependency>
			<groupId>jkt.centralisateur</groupId>
			<artifactId>centralisateur-applet</artifactId>
		</dependency>
		...
		<dependency>
			<groupId>jkt.centralisateur</groupId>
			<artifactId>centralisateur-presentation
			</artifactId>
		</dependency>
		<dependency>
			<groupId>javax.servlet</groupId>
			<artifactId>jstl</artifactId>
		</dependency>
		<dependency>
			<groupId>org.springframework</groupId>
			<artifactId>spring-webmvc</artifactId>
		</dependency>
		<dependency>
			<groupId>commons-lang</groupId>
			<artifactId>commons-lang</artifactId>
		</dependency>
	</dependencies>
 
	<build>
		<finalName>${centralisateur-war-name}</finalName>
 
        <plugins>
 
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <version>2.1</version>
                <executions>
                    <execution>
                        <id>copy</id>
                        <phase>compile</phase>
                        <goals>
                            <goal>copy</goal>
                        </goals>
                        <configuration>
                            <artifactItems>
                                <artifactItem>
                                    <groupId>jkt.centralisateur</groupId>
                                    <artifactId>centralisateur-applet</artifactId>
                                    <overWrite>true</overWrite>
                                    <destFileName>centralisateur-applet.jar</destFileName>
                                </artifactItem>
                            </artifactItems>
                            <outputDirectory>${project.build.directory}/${centralisateur-war-name}/applets</outputDirectory>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
 
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-war-plugin</artifactId>
				<version>2.1-beta-1</version>
				<configuration>
				    <warName>${centralisateur-war-name}</warName>
				</configuration>
			</plugin>
		</plugins>
	</build>
</project>
Le problème avec cette solution c'est que je lance mon appli dans un tomcat 6 directement depuis Eclipse (plugin Eclipse Maven integration et Maven integration pour WTP) et Eclipse ne semble par interpréter maven-dependency-plugin avec déploiement. Résultat mon jar n'est pas déployé dans {war-file}/applets quand je passe par Eclipse.

Est-ce que quelqu'un voit une solution à ce problème ?

Autre question : Comment se fait-il que j'obtienne un résultat différent entre le war produit et le déploiement d'Eclipse, est-ce que le plugin Eclipse pour WTP n'interprête pas complètement le pom de mon war ?

PS : le jar applet ne doit pas être dans WEB-INF/lib car il doit être consultable directement par le navigateur client, hors seul le serveur d'applications a la visibilité sur WEB-INF