2017-08-29 3 views
1

Ich bin neu bei GWT und Maven und ich erstellte ein neues Maven Projekt und dann Anpassung es mit den Schritten in diesem Link erwähnt: Setting and Customizing your Project.Plugin org.codehaus.mojo: gwt-maven-plugin: 1.0-rc-6 oder eine seiner Abhängigkeiten konnte nicht aufgelöst werden

Ich habe alle Schritte im Abschnitt "Anpassen Ihres Projekts" auf dieser Seite befolgt, aber während ich das Projekt im SuperDevMode ausführte, habe ich viele Fehler in der Eingabeaufforderung erhalten und verstehe nicht, wie diese Fehler behoben werden können das Internet.

Hier ist meine pom.xml-Datei:

<?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"> 

    <!-- POM file generated with GWT webAppCreator --> 
    <modelVersion>4.0.0</modelVersion> 
    <groupId>org.gwtproject.tutorial</groupId> 
    <artifactId>TodoList</artifactId> 
    <packaging>war</packaging> 
    <version>1.0-SNAPSHOT</version> 
    <name>org.gwtproject.tutorial.TodoList</name> 

    <properties> 

    <!-- Setting maven.compiler.source to something different to 1.8 
     needs that you configure the sourceLevel in gwt-maven-plugin since 
     GWT compiler 2.8 requires 1.8 (see gwt-maven-plugin block below) --> 
    <maven.compiler.source>1.8</maven.compiler.source> 
    <maven.compiler.target>1.8</maven.compiler.target> 

    <!-- Don't let your Mac use a crazy non-standard encoding --> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> 
    </properties> 

    <dependencyManagement> 
    <dependencies> 
     <!-- ensure all GWT deps use the same version (unless overridden) --> 
     <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt</artifactId> 
     <version>2.8.1</version> 
     <type>pom</type> 
     <scope>import</scope> 
     </dependency> 
    </dependencies> 
    </dependencyManagement> 

    <dependencies> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-servlet</artifactId> 
     <scope>runtime</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-user</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.vaadin.polymer</groupId> 
     <artifactId>vaadin-gwt-polymer-elements</artifactId> 
     <version>1.7.0.0</version> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.google.gwt</groupId> 
     <artifactId>gwt-dev</artifactId> 
     <scope>provided</scope> 
    </dependency> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.11</version> 
     <scope>test</scope> 
    </dependency> 
    </dependencies> 

    <build> 
    <!-- Output classes directly into the webapp, so that IDEs and "mvn process-classes" update them in DevMode --> 
    <outputDirectory>${project.build.directory}/${project.build.finalName}/WEB-INF/classes</outputDirectory> 

    <plugins> 

     <!-- GWT Maven Plugin--> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>gwt-maven-plugin</artifactId> 
     <version>1.0-rc-6</version> 
     <executions> 
      <execution> 
      <goals> 
       <goal>import-sources</goal> 
       <goal>compile</goal> 
       <goal>import-test-sources</goal> 
       <goal>test</goal> 
      </goals> 
      </execution> 
     </executions> 
     <configuration> 
      <moduleName>org.gwtproject.tutorial.TodoList</moduleName> 
      <moduleShortName>TodoList</moduleShortName> 
      <failOnError>true</failOnError> 
      <jsInteropMode>JS</jsInteropMode> 
      <!-- GWT compiler 2.8 requires 1.8, hence define sourceLevel here if you use 
       a different source language for java compilation --> 
      <sourceLevel>1.8</sourceLevel> 
      <!-- Compiler configuration --> 
      <compilerArgs> 
      <!-- Ask GWT to create the Story of Your Compile (SOYC) (gwt:compile) --> 
      <arg>-compileReport</arg> 
      <arg>-XcompilerMetrics</arg> 
      </compilerArgs> 
      <!-- DevMode configuration --> 
      <warDir>${project.build.directory}/${project.build.finalName}</warDir> 
      <classpathScope>compile+runtime</classpathScope> 
      <!-- URL(s) that should be opened by DevMode (gwt:devmode). --> 
      <startupUrls> 
      <startupUrl>TodoList.html</startupUrl> 
      </startupUrls> 
     </configuration> 
     </plugin> 

     <!-- Skip normal test execution, we use gwt:test instead --> 
     <plugin> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.17</version> 
     <configuration> 
      <skip>true</skip> 
     </configuration> 
     </plugin> 

    </plugins> 
    </build> 
</project> 

Hier ist, was ich in Command Prompt bekam.

C:\Users\TEST>cd TodoListApp 
C:\Users\TEST\TodoListApp>mvn war:exploded 
[INFO] Scanning for projects... 
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/gwt-maven-plugin/1.0-rc-6/gwt-maven-plugin-1.0-rc-6.pom 
[WARNING] The POM for org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 is missing, no dependency information available 
Downloading: https://repo.maven.apache.org/maven2/org/codehaus/mojo/gwt-maven-plugin/1.0-rc-6/gwt-maven-plugin-1.0-rc-6.jar 
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6: Plugin org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6 or one of its dependencies could not be resolved: Could not find artifact org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 in central (https://repo.maven.apache.org/maven2) 
[INFO] 
[INFO] ------------------------------------------------------------------------ 
[INFO] Building org.gwtproject.tutorial.TodoList 1.0-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[WARNING] The POM for org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 is missing, no dependency information available 
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6: Plugin org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6 or one of its dependencies could not be resolved: Failure to find org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 
[INFO] 
[INFO] --- maven-war-plugin:2.2:exploded (default-cli) @ TodoList --- 
[INFO] Exploding webapp 
[INFO] Assembling webapp [TodoList] in [C:\Users\TEST\TodoListApp\target\TodoList-1.0-SNAPSHOT] 
[INFO] Processing war project 
[INFO] Copying webapp resources [C:\Users\TEST\TodoListApp\src\main\webapp] 
[INFO] Webapp assembled in [66 msecs] 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 3.198 s 
[INFO] Finished at: 2017-08-29T14:24:43+05:30 
[INFO] Final Memory: 14M/133M 
[INFO] ------------------------------------------------------------------------ 

C:\Users\TEST\TodoListApp>mvn gwt:devmode 
[INFO] Scanning for projects... 
[WARNING] The POM for org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 is missing, no dependency information available 
[WARNING] Failed to retrieve plugin descriptor for org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6: Plugin org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6 or one of its dependencies could not be resolved: Failure to find org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced 
[WARNING] The POM for org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 is missing, no dependency information available 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD FAILURE 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 0.316 s 
[INFO] Finished at: 2017-08-29T14:24:53+05:30 
[INFO] Final Memory: 7M/106M 
[INFO] ------------------------------------------------------------------------ 
[ERROR] Plugin org.codehaus.mojo:gwt-maven-plugin:1.0-rc-6 or one of its dependencies could not be resolved: Failure to find org.codehaus.mojo:gwt-maven-plugin:jar:1.0-rc-6 in https://repo.maven.apache.org/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of central has elapsed or updates are forced -> [Help 1] 
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. 
[ERROR] Re-run Maven using the -X switch to enable full debug logging. 
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles: 
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/PluginResolutionException 

Ich habe das groupId von GWT Maven Plugin als „org.codehaus.mojo“ durch die man in dieser GWT Seite geschrieben zu sehen, und ich erinnere mich nicht jetzt, was die groupId zunächst war. Bitte helfen Sie mir, diesen Fehler zu beheben.

Antwort

0

Die Version Ihres Plugins ist falsch; Bitte ersetzen Sie es durch 2.8.1. Wie folgt aus:

<dependency> 
    <groupId>org.codehaus.mojo</groupId> 
    <artifactId>gwt-maven-plugin</artifactId> 
    <version>2.8.1</version> 
</dependency> 
+1

Nun, statt dass ich versuchte, die groupId als „net.ltgt.gwt.maven“ zu ersetzen, die standardmäßig in der pom.xml-Datei geschrieben wurde. Ich habe diese groupId gefunden, indem ich ein neues Projekt erstellt und dann die Datei pom.xml beobachtet habe, und das Problem wurde behoben. – DG4

+1

Es gibt zwei Plugins mit zwei verschiedenen groupIds (aber ich denke, sie teilen die gleiche artifactId). Deine Lösung ist wahrscheinlich auch gut (ich habe deine noch nicht benutzt). – Andrei

Verwandte Themen