Bonjour à tous,
j'ai crée un projet web, et je souhaite uniquement compiler des .java (que je place donc dans src/main/java.) et générer un jar.
Lorsque je lance la commande: mvn compile jar:jar
Voici les insultes que j'obtiens:
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 mvn -e compile jar:jar + Error stacktraces are turned on. [INFO] Scanning for projects... [INFO] Searching repository for plugin with prefix: 'jar'. [INFO] ------------------------------------------------------------------------- --- [INFO] Building NomProjet Maven Webapp [INFO] task-segment: [compile, jar:jar] [INFO] ------------------------------------------------------------------------- --- [INFO] [resources:resources] [INFO] Using default encoding to copy filtered resources. [INFO] [compiler:compile] [INFO] Compiling 5 source files to /tessst/NomProjet/target/classe s [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Fatal error compiling Embedded error: Error while executing the compiler. [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Fatal error compiling at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:564) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLi fecycle(DefaultLifecycleExecutor.java:480) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(Defau ltLifecycleExecutor.java:459) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHan dleFailures(DefaultLifecycleExecutor.java:311) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegmen ts(DefaultLifecycleExecutor.java:278) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLi fecycleExecutor.java:143) at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:330) at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:123) at org.apache.maven.cli.MavenCli.main(MavenCli.java:272) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl. java:61) at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces sorImpl.java:40) at java.lang.reflect.Method.invoke(Method.java:335) at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315) at org.codehaus.classworlds.Launcher.launch(Launcher.java:255) at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430) at org.codehaus.classworlds.Launcher.main(Launcher.java:375) Caused by: org.apache.maven.plugin.MojoExecutionException: Fatal error compiling at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler Mojo.java:498) at org.apache.maven.plugin.CompilerMojo.execute(CompilerMojo.java:114) at org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPlugi nManager.java:420) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Defa ultLifecycleExecutor.java:539) ... 16 more Caused by: org.codehaus.plexus.compiler.CompilerException: Error while executing the compiler. at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(Jav acCompiler.java:426) at org.codehaus.plexus.compiler.javac.JavacCompiler.compile(JavacCompile r.java:141) at org.apache.maven.plugin.AbstractCompilerMojo.execute(AbstractCompiler Mojo.java:493) ... 19 more Caused by: java.lang.NoSuchMethodException: compile at java.lang.Class.getMethod0(Class.java:1807) at java.lang.Class.getMethod(Class.java:1012) at org.codehaus.plexus.compiler.javac.JavacCompiler.compileInProcess(Jav acCompiler.java:418) ... 21 more [INFO] ------------------------------------------------------------------------ [INFO] Total time: 14 seconds [INFO] Finished at: Wed Aug 01 13:17:59 GMT+01:00 2007 [INFO] Final Memory: 4M/16M [INFO] ------------------------------------------------------------------------
et voici mon pom.xml:
Le problème est que la compilation fonctionne sur Windows mais pas sur mon serv AIX.
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 <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>monupId</groupId> <artifactId>Nomprojet</artifactId> <packaging>jar</packaging> <version>1.0-SNAPSHOT</version> <name>Noojet Maven Webapp</name> <url>http://maven.apache.org</url> <dependencies> <dependency> <groupId>junit</groupId> <artifactId>junit</artifactId> <version>3.8.1</version> <scope>test</scope> </dependency> </dependencies> <build> <sourceDirectory>src/main/java</sourceDirectory> <outputDirectory>bin</outputDirectory> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <configuration> <source>1.4</source> <target>1.4</target> <includes> <include>**/*.java</include> </includes> </configuration> </plugin> </plugins> <finalName>Nomprojet</finalName> </build> </project>
Merci pour vos réponses.
Partager