2017-08-29 5 views
1

私はGWTとMavenを初めて使っていて、新しいMavenプロジェクトを作成していましたこのリンクに記載されている手順を使用してカスタマイズしてください:Setting and Customizing your Projectプラグインorg.codehaus.mojo:gwt-maven-plugin:1.0-rc-6またはその依存関係のいずれかを解決できませんでした

私はそのページの[プロジェクトのカスタマイズ]セクションに記載されているすべての手順を実行しましたが、プロジェクトをSuperDevModeで実行しているときにコマンドプロンプトで多くのエラーが発生しました。インターネット。ここで

は私のpom.xmlファイルです:

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

ここで私は、コマンドプロンプトで得たものです。

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 

私はGWTのページに書かれたものを見て、「org.codehaus.mojo」としてGWTのMavenプラグインのgroupIdを編集し、私はのgroupIdが最初に何をした今、覚えていません。このエラーを修正するのを手伝ってください。

答えて

0

プラグインのバージョンが間違っています。 2.8.1と交換してください。

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

まあ、その代わりに、私は "net.ltgt.gwt.maven"としてgroupIdを置き換えようとしました。これはデフォルトでpom.xmlファイルに書き込まれました。私は新しいプロジェクトを作成し、そのpom.xmlファイルを観察してgroupIdを見つけ、問題を修正しました。 – DG4

+1

2つの異なるgroupIdsを持つ2つのプラグインがあります(ただし、同じartifactIdを共有していると思います)。あなたのソリューションはおそらく上手くいく(私はまだあなたのものを使っていない)。 – Andrei

関連する問題