GWT-Maven的插件:插件需要Maven的2.1版(gwt-maven-plugin: Plug

2019-09-22 05:27发布

我想使用GWT-Maven的插件来编译我的项目。 我的Maven 3.0.3安装在我的春天工具套件4.2黯然失色。

然而,该插件嘎嘎叫着,它希望使用Maven 2.1。 我相信它应该有使用maven 3.x中,右没有问题?

[伪影:MVN] [INFO]错误解析为版本 'org.codehaus.mojo:GWT-行家-插件':插件需要Maven的版本2.1

我的插件DEFN:

<plugin>
  <groupId>org.codehaus.mojo</groupId>
  <artifactId>gwt-maven-plugin</artifactId>
  <version>2.4.0</version>
  <executions>
    <execution>
      <configuration>
        <module>ally.mc.beal</module>
        <gen>gwt-generated</gen>
      </configuration>
      <goals>
        <goal>compile</goal>
      </goals>
    </execution>
  </executions>
</plugin>

我的ant目标我用来触发GWT编译:

<project name="AllyMcBeal"
  xmlns:artifact="antlib:org.apache.maven.artifact.ant">

  <path id="maven-ant-tasks.classpath" path="maven/maven-ant-tasks-2.1.3.jar" />
...
  <target name="gwt.compile">
    <artifact:mvn>
      <arg value="gwt:compile" />
    </artifact:mvn>
  </target>
...
</project>
  • 我一定要安装Maven 2.1?
  • 或者,有没有办法迫使它使用Maven 3.X?
  • 或者,我错过了在配置了一块信息的?

Answer 1:

您需要设置mavenVersion的属性artifact:mvn Ant任务。 如果没有这个任务默认为2.0.10一个Maven的版本,使你所看到的错误消息。

仅供参考我的任务是这样的:

<artifact:mvn pom="mypomfilepath.xml" mavenVersion="3.0.4">
    <arg value="install"/>
</artifact:mvn>


文章来源: gwt-maven-plugin: Plugin requires Maven version 2.1
标签: java gwt maven ant