Java 未能解析工件。缺少:------------1)org.codehaus.mojo:gwt-maven插件:jar:1.3-SNAPSHOT

Java 未能解析工件。缺少:------------1)org.codehaus.mojo:gwt-maven插件:jar:1.3-SNAPSHOT,java,vaadin,maven-plugin,Java,Vaadin,Maven Plugin,我想使用addon vaadin时间表,因此我必须制作gwt maven插件3.1,我的pom.xml如下所示: <?xml version="1.0"?> <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 ht

我想使用addon vaadin时间表,因此我必须制作
gwt maven插件3.1
,我的pom.xml如下所示:

<?xml version="1.0"?>

<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>life</groupId>
<artifactId>life</artifactId>
<packaging>war</packaging>
<name>life Portlet</name>
<version>0.0.1-SNAPSHOT</version>
<url>http://maven.apache.org</url>
<properties>
    <vaadin-widgets-dir>src/main/webapp/VAADIN/widgetsets</vaadin-widgets-dir>
</properties>
<build>
    <plugins>
        <plugin>
            <groupId>com.liferay.maven.plugins</groupId>
            <artifactId>liferay-maven-plugin</artifactId>
            <version>6.1.0</version>
            <configuration>
                <autoDeployDir>${liferay.auto.deploy.dir}</autoDeployDir>
                <liferayVersion>6.1.0</liferayVersion>
                <pluginType>portlet</pluginType>
            </configuration>
        </plugin>

        <plugin>
            <artifactId>maven-compiler-plugin</artifactId>
            <configuration>
                <encoding>UTF-8</encoding>
                <source>1.5</source>
                <target>1.5</target>
            </configuration>
        </plugin>
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>1.0.1</version>
        </plugin>
        <!-- Compiles your custom GWT components with the GWT compiler -->
        <plugin>
            <groupId>org.codehaus.mojo</groupId>
            <artifactId>gwt-maven-plugin</artifactId>
            <version>2.1.0-1</version>
            <configuration>
                <!-- if you don't specify any modules, the plugin will find them -->
                <!--modules> .. </modules -->
                <webappDirectory>${project.build.directory}/${project.build.finalName}/VAADIN/widgetsets</webappDirectory>
                <extraJvmArgs>-Xmx512M -Xss1024k</extraJvmArgs>
                <runTarget>clean</runTarget>
                <hostedWebapp>${project.build.directory}/${project.build.finalName}</hostedWebapp>
                <noServer>true</noServer>
                <port>8080</port>
                <soyc>false</soyc>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>resources</goal>
                        <goal>compile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>
        <!-- Updates Vaadin 6.2+ widgetset definitions based on project dependencies -->
        <plugin>
            <groupId>com.vaadin</groupId>
            <artifactId>vaadin-maven-plugin</artifactId>
            <version>1.0.1</version>
            <executions>
                <execution>
                    <configuration>
                        <!-- if you don't specify any modules, the plugin will find them -->
                        <!-- <modules> <module>${package}.gwt.MyWidgetSet</module> </modules> -->
                    </configuration>
                    <goals>
                        <goal>update-widgetset</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

    </plugins>

    <pluginManagement>
        <plugins>
            <!--This plugin's configuration is used to store Eclipse m2e settings 
                only. It has no influence on the Maven build itself. -->
            <plugin>
                <groupId>org.eclipse.m2e</groupId>
                <artifactId>lifecycle-mapping</artifactId>
                <version>1.0.0</version>
                <configuration>
                    <lifecycleMappingMetadata>
                        <pluginExecutions>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>
                                        org.codehaus.mojo
                                    </groupId>
                                    <artifactId>
                                        gwt-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [2.1.0-1,)
                                    </versionRange>
                                    <goals>
                                        <goal>resources</goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                            <pluginExecution>
                                <pluginExecutionFilter>
                                    <groupId>com.vaadin</groupId>
                                    <artifactId>
                                        vaadin-maven-plugin
                                    </artifactId>
                                    <versionRange>
                                        [1.0.1,)
                                    </versionRange>
                                    <goals>
                                        <goal>
                                            update-widgetset
                                        </goal>
                                    </goals>
                                </pluginExecutionFilter>
                                <action>
                                    <ignore></ignore>
                                </action>
                            </pluginExecution>
                        </pluginExecutions>
                    </lifecycleMappingMetadata>
                </configuration>
            </plugin>
        </plugins>
    </pluginManagement>
</build>
<dependencies>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>portal-service</artifactId>
        <version>6.1.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-bridges</artifactId>
        <version>6.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>org.vaadin.addons</groupId>
        <artifactId>vaadin-timeline-agpl-3.0</artifactId>
        <version>1.2.4</version>
    </dependency>

    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-taglib</artifactId>
        <version>6.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>com.liferay.portal</groupId>
        <artifactId>util-java</artifactId>
        <version>6.1.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.portlet</groupId>
        <artifactId>portlet-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet</groupId>
        <artifactId>servlet-api</artifactId>
        <version>2.4</version>
        <scope>provided</scope>
    </dependency>
    <dependency>
        <groupId>javax.servlet.jsp</groupId>
        <artifactId>jsp-api</artifactId>
        <version>2.0</version>
        <scope>provided</scope>
    </dependency>

    <!-- sqx -->

    <dependency>
        <groupId>javax.activation</groupId>
        <artifactId>activation</artifactId>
        <version>1.1.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>antlr</groupId>
        <artifactId>antlr</artifactId>
        <version>2.7.6</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>aopalliance</groupId>
        <artifactId>aopalliance</artifactId>
        <version>1.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>asm</groupId>
        <artifactId>asm</artifactId>
        <version>1.5.3</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>asm</groupId>
        <artifactId>asm-attrs</artifactId>
        <version>1.5.3</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjrt</artifactId>
        <version>1.6.8</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.aspectj</groupId>
        <artifactId>aspectjweaver</artifactId>
        <version>1.6.8</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>bsh</groupId>
        <artifactId>bsh</artifactId>
        <version>1.3.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib</artifactId>
        <version>2.1_3</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>commons-collections</groupId>
        <artifactId>commons-collections</artifactId>
        <version>3.1</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>commons-dbcp</groupId>
        <artifactId>commons-dbcp</artifactId>
        <version>1.3</version>
    </dependency>

    <dependency>
        <groupId>commons-logging</groupId>
        <artifactId>commons-logging</artifactId>
        <version>1.1</version>
    </dependency>

    <dependency>
        <groupId>commons-pool</groupId>
        <artifactId>commons-pool</artifactId>
        <version>1.5.3</version>
    </dependency>

    <dependency>
        <groupId>dom4j</groupId>
        <artifactId>dom4j</artifactId>
        <version>1.6.1</version>
    </dependency>

    <dependency>
        <groupId>net.sf.ehcache</groupId>
        <artifactId>ehcache</artifactId>
        <version>1.2.3</version>
    </dependency>

    <dependency>
        <groupId>org.hibernate</groupId>
        <artifactId>hibernate-core</artifactId>
        <version>3.3.1.GA</version>
    </dependency>

    <dependency>
        <groupId>hsqldb</groupId>
        <artifactId>hsqldb</artifactId>
        <version>1.8.0.10</version>
    </dependency>


    <!-- <dependency> <groupId>jboss</groupId> <artifactId>jboss-backport-concurrent</artifactId> 
        <version>2.1.0.GA</version> </dependency> -->

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-parent</artifactId>
        <version>1.5.0</version>
    </dependency>


    <dependency>
        <groupId>javax.jcr</groupId>
        <artifactId>jcr</artifactId>
        <version>1.0</version>
    </dependency>

    <!-- <dependency> <groupId>javax.sql</groupId> <artifactId>jdbc-stdext</artifactId> 
        <version>2.0</version> </dependency> -->


    <dependency>
        <groupId>jdom</groupId>
        <artifactId>jdom</artifactId>
        <version>1.0</version>
    </dependency>


    <dependency>
        <groupId>javax.transaction</groupId>
        <artifactId>jta</artifactId>
        <version>1.1</version>
    </dependency>


    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.14</version>
    </dependency>


    <dependency>
        <groupId>javax.mail</groupId>
        <artifactId>mail</artifactId>
        <version>1.4.3</version>
    </dependency>


    <dependency>
        <groupId>com.sun.portal.portletcontainer</groupId>
        <artifactId>container</artifactId>
        <version>1.1-m4</version>
    </dependency>

    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>8.4-702.jdbc3</version>
    </dependency>



    <!-- sl4j-api-1.5.0 manquante -->

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-parent</artifactId>
        <version>1.5.0</version>
    </dependency>


    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.5.0</version>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aop</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-aspects</artifactId>
        <version>3.0.3.RELEASE</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>2.5.6</version>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>2.5.6</version>
    </dependency>


    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context-support</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jdbc</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-jms</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>javax.jms</groupId>
        <artifactId>jms</artifactId>
        <version>1.1</version>
        <scope>compile</scope>
    </dependency>

    <!-- <dependency> <groupId>org.springmodules</groupId> <artifactId>spring-modules-jbpm31</artifactId> 
        <version>0.9</version> <scope>provided</scope> </dependency> -->

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-orm</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework.ws</groupId>
        <artifactId>spring-oxm</artifactId>
        <version>1.5.0</version>
        <scope>provided</scope>
    </dependency>

    <dependency>
        <groupId>org.springframework.security</groupId>
        <artifactId>spring-security-core</artifactId>
        <version>2.0.4</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-tx</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-web</artifactId>
        <version>2.5.6</version>
    </dependency>

    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-webmvc-portlet</artifactId>
        <version>2.5</version>
    </dependency>

    <dependency>
        <groupId>com.atomikos</groupId>
        <artifactId>transactions-hibernate3</artifactId>
        <version>3.6.4</version>
    </dependency>

    <dependency>
        <groupId>com.atomikos</groupId>
        <artifactId>transactions-osgi</artifactId>
        <version>3.7.0</version>
    </dependency>

    <dependency>
        <groupId>com.vaadin</groupId>
        <artifactId>vaadin</artifactId>
        <version>6.7.0</version>
    </dependency>

    <dependency>
        <groupId>com.thoughtworks.xstream</groupId>
        <artifactId>xstream</artifactId>
        <version>1.3.1</version>
    </dependency>




    <!-- this is the dependency to the "jar"-subproject -->


    <dependency>
      <groupId>org.codehaus.plexus</groupId>
      <artifactId>plexus-utils</artifactId>
      <version>1.5.9</version>
    </dependency>

    <dependency>
        <groupId>com.google.gwt</groupId>
        <artifactId>gwt-user</artifactId>
        <version>2.1.1</version>
        <scope>provided</scope>
    </dependency>

</dependencies>



<!-- Define our plugin repositories -->
<pluginRepositories>
    <pluginRepository>
        <id>Codehaus</id>
        <name>Codehaus Maven Plugin Repository</name>
        <url>http://repository.codehaus.org/org/codehaus/mojo</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>

    <pluginRepository>
        <id>codehaus-snapshots</id>
        <url>[http://nexus.codehaus.org/snapshots]</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
        <releases>
            <enabled>false</enabled>
        </releases>
    </pluginRepository>

</pluginRepositories>

<repositories>
    <repository>
        <id>vaadin-addons</id>
        <url>http://maven.vaadin.com/vaadin-addons</url>
    </repository>

    <repository>
        <id>demoiselle.sourceforge.net</id>
        <name>Demoiselle Maven Repository</name>
        <url>http://demoiselle.sourceforge.net/repository/release</url>
    </repository>

</repositories>

如何解决此问题?

由于gwt maven插件已升级到2.4.0版,因此很可能此特定快照不再存在

尝试将依赖项版本锁定为类似的版本,即1.3.1:

<dependencyManagement>
  <dependency>
      <artifactId>gwt-maven-plugin</artifactId>
      <groupId>org.codehaus.mojo</groupId>
      <version>1.3.1</version>
  </dependency>
</dependencyManagement> 

GWTMaven插件
org.codehaus.mojo
1.3.1

您应该在pluginManagement块中定义gwt maven插件,而不是在build区域中定义。据我所知,gwt maven插件将被其他插件使用,否则我无法理解您的输出。此外,永远不要依赖于插件的快照版本。修复插件的版本,以在构建中获得可实现的结果。最后但并非最不重要的一点是,开始使用存储库管理器(Artifactory、Archive、Nexus)来消除pom中的存储库定义。让生活更美好。

关于前面的答案:我不认为有理由将
gwt maven插件
依赖项放在
pluginManagement
中,除非它是在您的父POM中定义的。即使在这篇文章中也没有所谓的
pluginManagement

很明显,您使用的是最新版本的Vaadin(6.7.0),因此旧插件无法与之配合使用。试试这些:

  • 最重要的是:将vaadin maven插件更改为1.0.2
  • 将gwt maven插件的版本更改为2.3.0-1
  • 将gwt用户的依赖项版本更改为2.3.0
如果上述修复无法工作,请尝试通过调用以下命令创建新的Vaadin项目:

mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-clean -DarchetypeVersion=LATEST -DgroupId=com.example -DartifactId=exampleArtifact -Dversion=1.0 -Dpackaging=war

并将POM结构和插件版本与您自己的进行比较。

只是想指出,我遇到了这个问题,使用的是
vaadin maven plugin
1.0.1,它指的是不再存在的其他插件的快照版本。将版本号更改为1.0.2修复了我的问题。
mvn archetype:generate -DarchetypeGroupId=com.vaadin -DarchetypeArtifactId=vaadin-archetype-clean -DarchetypeVersion=LATEST -DgroupId=com.example -DartifactId=exampleArtifact -Dversion=1.0 -Dpackaging=war