Bonjour,
J'upgrade actuellement un projet Maven GWT et je souhaite simplifier mon pom.xml au niveau de la compilation grâce au plugin gwt-maven-plugin.
J'ai hélas une erreur à la compilation à cause des nombreuses dépendances de mon projet.
En fouillant sur le web, j'ai compris qu'il y avait un conflit entre 2 librairies, la lib gwt-dev embarque directement des librairies dans son jar (pas terrible au passage). Hors on remarque que dans le classpath le jar gwt-dev est placé en dernière position.
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 [INFO] [ERROR] Unexpected [INFO] java.lang.NoSuchMethodError: org.eclipse.jdt.internal.compiler.lookup.ParameterizedTypeBinding.genericType()Lorg/eclipse/jd t/internal/compiler/lookup/ReferenceBinding; [INFO] at com.google.gwt.dev.jdt.TypeRefVisitor.maybeDispatch(TypeRefVisitor.java:178) [INFO] at com.google.gwt.dev.jdt.TypeRefVisitor.endVisit(TypeRefVisitor.java:101) [INFO] at org.eclipse.jdt.internal.compiler.ast.ParameterizedSingleTypeReference.traverse(ParameterizedSingleTypeReference.java:2 31) [INFO] at org.eclipse.jdt.internal.compiler.ast.TypeDeclaration.traverse(TypeDeclaration.java:1118) [INFO] at org.eclipse.jdt.internal.compiler.ast.CompilationUnitDeclaration.traverse(CompilationUnitDeclaration.java:487) [INFO] at com.google.gwt.dev.javac.BinaryTypeReferenceRestrictionsChecker.findAllBinaryTypeReferenceSites(BinaryTypeReferenceRest rictionsChecker.java:144) [INFO] at com.google.gwt.dev.javac.BinaryTypeReferenceRestrictionsChecker.check(BinaryTypeReferenceRestrictionsChecker.java:114) [INFO] at com.google.gwt.dev.javac.CompilationUnitInvalidator.validateCompilationUnits(CompilationUnitInvalidator.java:160) [INFO] at com.google.gwt.dev.javac.CompilationState.compile(CompilationState.java:198) [INFO] at com.google.gwt.dev.javac.CompilationState.refresh(CompilationState.java:178) [INFO] at com.google.gwt.dev.javac.CompilationState.<init>(CompilationState.java:93) [INFO] at com.google.gwt.dev.cfg.ModuleDef.getCompilationState(ModuleDef.java:264) [INFO] at com.google.gwt.dev.Precompile.precompile(Precompile.java:283) [INFO] at com.google.gwt.dev.Compiler.run(Compiler.java:170) [INFO] at com.google.gwt.dev.Compiler$1.run(Compiler.java:124) [INFO] at com.google.gwt.dev.CompileTaskRunner.doRun(CompileTaskRunner.java:88) [INFO] at com.google.gwt.dev.CompileTaskRunner.runWithAppropriateLogger(CompileTaskRunner.java:82) [INFO] at com.google.gwt.dev.Compiler.main(Compiler.java:131) [INFO] ------------------------------------------------------------------------ [ERROR] BUILD ERROR [INFO] ------------------------------------------------------------------------ [INFO] Command [[ C:\Program Files\Java\jdk1.5.0_06\jre\bin\java -Xmx512m -classpath "E:\xxx\src\main\java\webapp";"E:\xxx\src\main\resources\webapp"; "E:\xxx\webapp\target\classes";"C:\Java\maven\repository\com\google\gwt\gwt-user\1.7.1\gwt-user-1.7.1.jar";"C:\Java\maven\repositor y\com\google\gwt\gwt-servlet\1.7.1\gwt-servlet-1.7.1.jar";"C:\Java\maven\repository\net\sf\gwt-widget\gwt-widgets\0.2.0\gwt-widgets -0.2.0.jar";"C:\Java\maven\repository\net\sf\gwt-widget\gwt-widgets-server\0.1.4\gwt-widgets-server-0.1.4.jar";"C:\Java\maven\repos itory\com\google\code\gwt-log\2.6.2\[...];"C:\Java\maven\repository\com\google\gwt\gwt-dev\1.7.1\gwt-dev-1.7.1-windows.jar" com.goog le.gwt.dev.Compiler -gen "E:\xxx\webapp\target\.generated" -logLevel INFO -style OBF -war "E:\xxx\webapp\target\isee-webapp-5.1.0b1" -localWorkers 1 nc.gouv.pac.xxx.web.Application
La solution préconisée est de mettre le jar gwt-dev-xxx.jar dans les 1ères position du classpath, ça fonctionne effectivement quand je modifie puis lance manuellement la ligne de commande.
Mais comment faire lorsque ce classpath est généré automatiquement par le plugin (ou maven) ?
gwt-maven-plugin déconseille fortement d'ajouter gwt-dev dans les dependencies du projet (de toute façon j'ai un autre message d'erreur quand je le tente).
Merci par avance![]()
Partager