使用maven 3.0.3执行wsgen任务时编译失败

时间:2011-06-13 21:33:31

标签: jax-ws maven-plugin wsgen

我正在努力让NHIN-Direct Secure电子邮件网关进行编译。其中一个项目出现以下错误。

[ERROR] Failed to execute goal org.codehaus.mojo:jaxws-maven-plugin:1.12:wsgen (default) on project config-service: Execution default of goal org.codehaus.mojo:jaxws-maven-plugin:1.12:wsgen failed: Plugin org.codehaus.mojo:jaxws-maven-plugi
n:1.12 or one of its dependencies could not be resolved: Failed to collect dependencies for org.codehaus.mojo:jaxws-maven-plugin:jar:1.12 (): Failed to read artifact descriptor for com.sun.xml.ws:jaxws-tools:jar:2.1.7: Could not transfer ar
tifact com.sun.xml.ws:jaxws-tools:pom:2.1.7 from/to java.net (http://download.java.net/maven/1/): No connector available to access repository java.net (http://download.java.net/maven/1/) of type legacy using the available factories WagonRep
ositoryConnectorFactory -> [Help 1]

我已经找到了无数的论坛,这些论坛告诉我,太阳在管理jaxws-maven-plugin版本1.12的修订版时主要搞砸了。但我没有遇到一个帮助我纠正我的pom文件的网站。这是pom文件。我做错了什么?

<?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/xsd/maven-4.0.0.xsd">

<modelVersion>4.0.0</modelVersion>
<groupId>org.nhind</groupId>
<artifactId>config-service</artifactId>
<version>1.2-SNAPSHOT</version>
<packaging>war</packaging>
<name>NHIN-Direct Configuration Service</name>
<description>NHIN-Direct Configuration Web Services</description>

<url>http://api.nhindirect.org/x/www/api.nhindirect.org/java/site/config/config-service/${project.version}</url>     

<scm>
    <url>https://nhin-d.googlecode.com/hg/java/config/config-service</url>
    <connection>scm:hg:https://nhin-d.googlecode.com/hg/nhin-d/java/config/config-service</connection>
</scm>

<developers>
    <developer>
        <name>Pat Pyette</name>
        <email>ppyette@inpriva.com</email>
        <roles>
            <role>owner</role>
        </roles>
    </developer> 
    <developer>
        <name>Greg Meyer</name>
        <id>GM2552</id>
        <email>gm2552@cerner.com</email>                                        
    </developer>  
    <developer>
        <name>Beau Grantham</name>
        <email>bgrantha@harris.com</email>                                        
    </developer>         
</developers>

<licenses>
   <license>
      <name>New BSD License</name>
      <url>http://nhindirect.org/BSDLicense</url>
   </license>
</licenses>

<issueManagement>
    <system>Google Code</system>
    <url>http://code.google.com/p/nhin-d/issues/list</url>
</issueManagement>
<dependencies>
    <dependency>
        <groupId>cglib</groupId>
        <artifactId>cglib-nodep</artifactId>
        <version>2.2</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-asm</artifactId>
        <version>3.0.4.RELEASE</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-frontend-jaxws</artifactId>
        <version>${cxf.maven.artifact.version}</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-activation_1.1_spec</artifactId>
            </exclusion>
        </exclusions>           
    </dependency>
    <dependency>
        <groupId>org.apache.cxf</groupId>
        <artifactId>cxf-rt-transports-http</artifactId>
        <version>${cxf.maven.artifact.version}</version>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-beans</artifactId>
        <version>3.0.4.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>com.springsource.org.apache.commons.logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-core</artifactId>
        <version>3.0.4.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>com.springsource.org.apache.commons.logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.springframework</groupId>
        <artifactId>spring-context</artifactId>
        <version>3.0.4.RELEASE</version>
        <exclusions>
            <exclusion>
                <groupId>org.apache.commons</groupId>
                <artifactId>com.springsource.org.apache.commons.logging</artifactId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>8.4-701.jdbc4</version>
        <type>jar</type>
    </dependency>
    <dependency>
        <groupId>org.apache.derby</groupId>
        <artifactId>derby</artifactId>
        <version>10.4.1.3</version>
    </dependency>   
    <dependency>
        <groupId>org.apache.geronimo.specs</groupId>
        <artifactId>geronimo-ws-metadata_2.0_spec</artifactId>
        <version>1.1.2</version>
    </dependency>
    <dependency>        
        <groupId>org.mortbay.jetty</groupId>
        <artifactId>maven-jetty-plugin</artifactId> 
        <version>6.1.14</version>
        <scope>test</scope>
        <exclusions>
            <exclusion>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
            </exclusion>
        </exclusions>           
    </dependency>               
    <dependency>
        <groupId>javax.xml.bind</groupId>
        <artifactId>jaxb-api</artifactId>
        <version>2.1</version>
        <exclusions>
            <exclusion>
                <groupId>javax.activation</groupId>
                <artifactId>activation</artifactId>
            </exclusion>
        </exclusions>               
    </dependency>
    <dependency>
        <groupId>javax.xml.ws</groupId>
        <artifactId>jaxws-api</artifactId>
        <version>2.1</version>
    </dependency>
    <dependency>
        <groupId>org.nhind</groupId>
        <artifactId>config-store</artifactId>
        <version>1.1</version>
        <type>jar</type>
        <scope>compile</scope>
        <exclusions>
            <exclusion>
                <artifactId>cglib</artifactId>
                <groupId>cglib</groupId>
            </exclusion>
        </exclusions>
    </dependency>
    <dependency>
        <groupId>org.nhind</groupId>
        <artifactId>config-service-jar</artifactId>
        <version>1.2-SNAPSHOT</version>
        <type>jar</type>
        <scope>compile</scope>
    </dependency>
    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.8.1</version>
        <type>jar</type>
        <scope>test</scope>
    </dependency>
    <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-simple</artifactId>
            <version>1.6.1</version>
            <type>jar</type>
            <scope>runtime</scope>
    </dependency>        
    <dependency>
        <groupId>log4j</groupId>
        <artifactId>log4j</artifactId>
        <version>1.2.16</version>
        <type>jar</type>
        <scope>runtime</scope>          
    </dependency>       
</dependencies>


<repositories>
        <repository>
            <id>java.net2</id>
            <name>Java.Net Maven2 Repository, hosts the javaee-api dependency</name>
            <url>http://download.java.net/maven/2</url>
        </repository>
    </repositories>
    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <configuration>
                        <source>1.6</source>
                        <target>1.6</target>
                    </configuration>
                </plugin>
                <plugin>
                    <artifactId>maven-eclipse-plugin</artifactId>
                    <configuration>
                        <projectNameTemplate>[artifactId]-[version]</projectNameTemplate>
                        <wtpmanifest>true</wtpmanifest>
                        <wtpapplicationxml>true</wtpapplicationxml>
                        <wtpversion>2.0</wtpversion>
                    </configuration>
                </plugin>
                <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-release-plugin</artifactId>
                   <version>2.0</version>
                   <configuration>
                      <tagBase>scm:hg:https://nhin-d.googlecode.com/hg/nhin-d/java/tags</tagBase>
                   </configuration>
                </plugin>               
            </plugins>
        </pluginManagement>
        <plugins>
              <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-source-plugin</artifactId>
                <version>2.0.3</version>
                <executions>
                  <execution>
                    <goals>
                      <goal>jar</goal>
                    </goals>
                  </execution>
                </executions>
              </plugin>         
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>jaxws-maven-plugin</artifactId>
                <version>1.12</version>
                <executions>
                    <execution>
                        <goals>
                            <goal>wsgen</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>


    <sei>org.nhindirect.config.service.impl.ConfigurationServiceImpl</sei>
                        <verbose>true</verbose>
                        <destDir>src/main/java</destDir>
                        <resourceDestDir>src/main/resources/wsdl</resourceDestDir>
                        <protocol>soap1.1</protocol>
                        <keep>true</keep>
                        <genWsdl>true</genWsdl>
                    </configuration>
                </plugin>
                <plugin>
                    <!-- JETTY 6 PLUGIN FOR IN PLACE TESTING WITH MAVEN
                         Execute the mvn clean jetty:run 
                         in a browser use http://localhost:8081/config-service/ to test the connection 
                         and web app-->
                    <groupId>org.mortbay.jetty</groupId>
                    <artifactId>maven-jetty-plugin</artifactId>
                    <version>6.1.14</version>
                    <configuration>
                        <scanIntervalSeconds>10</scanIntervalSeconds>
                        <contextPath>/config-service</contextPath>
                        <connectors>           
                            <connector implementation="org.mortbay.jetty.nio.SelectChannelConnector">
                                <port>8081</port> 
                                <maxIdleTime>60000</maxIdleTime>                
                            </connector> 
                        </connectors>
                        <webApp>${basedir}/target/config-service-1.1</webApp>
                        <requestLog implementation="org.mortbay.jetty.NCSARequestLog">
                            <filename>target/yyyy_mm_dd.request.log</filename>
                            <retainDays>90</retainDays>
                            <append>true</append>
                            <extended>true</extended>
                            <logTimeZone>GMT</logTimeZone>
                        </requestLog>
                    </configuration>
                </plugin>   
                <!--  for releases only 
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-javadoc-plugin</artifactId>
                    <version>2.6.1</version>
                    <configuration>
                        <charset>UTF-8</charset>
                        <docencoding>UTF-8</docencoding>
                        <docfilessubdirs>true</docfilessubdirs>
                        <detectJavaApiLink>true</detectJavaApiLink>
                        <detectLinks>true</detectLinks>
                        <source>1.6</source>
                        <show>protected</show>
                    </configuration>
                    <executions>
                      <execution>
                        <phase>package</phase>
                        <id>attach-javadocs</id>
                        <goals>
                          <goal>jar</goal>
                        </goals>
                      </execution>
                    </executions>                   
                </plugin>           
                <plugin>
                   <groupId>org.apache.maven.plugins</groupId>
                   <artifactId>maven-gpg-plugin</artifactId>
                   <executions>
                     <execution>
                        <id>sign-artifacts</id>
                        <phase>package</phase>
                        <goals>
                           <goal>sign</goal>
                        </goals>
                     </execution>
                   </executions>
                </plugin>
                --> 

            </plugins>
        </build>
        <dependencyManagement>
            <dependencies>
                <dependency>
                    <groupId>org.nhind</groupId>
                    <artifactId>config-store</artifactId>
                    <version>1.1</version>
                    <type>jar</type>
                    <scope>compile</scope>
                </dependency>
            </dependencies>
        </dependencyManagement>
        <pluginRepositories>
            <pluginRepository>
                <url>http://download.java.net/maven/2</url>
                <id>Java dot Net</id>
                <layout>default</layout>
                <name>Repository for JAX-WS commons</name>
            </pluginRepository>
        </pluginRepositories>
        <properties>
            <cxf.maven.artifact.version>2.2.9</cxf.maven.artifact.version>
        </properties>
        <distributionManagement>
            <site>
                <id>nhind-site</id>
                <name>NHIN Direct API publication site</name>
                <url>sftp://api.nhindirect.org/x/www/api.nhindirect.org/java/site/config/config-service/${project.version}</url>
            </site>
            <snapshotRepository>
                <id>sonatype-snapshot</id>
                <name>Sonatype OSS Maven SNAPSHOT Repository</name>
                <url>https://oss.sonatype.org/content/repositories/snapshots/</url>
                <uniqueVersion>false</uniqueVersion>
             </snapshotRepository>
             <repository>
                <id>sonatype-release</id>
                <name>Sonatype OSS Maven Release Repositor</name>
                <url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
                <uniqueVersion>false</uniqueVersion>
             </repository>      
        </distributionManagement>   
    </project>

2 个答案:

答案 0 :(得分:0)

我尝试将jaxws-maven-plugin 1.12的版本切换为1.10并且它已经过了这个错误。

答案 1 :(得分:0)

依赖 com.sun.xml.ws:jaxws-tools:jar:2.1.7 实际上位于http://download.java.net/maven/1,但基于您发布的POM,只定义了http://download.java.net/maven/2插件存储库,从版本 2.2 开始提供 jaxws-tools

因此,尝试在 pluginRepositories 中添加第二个 pluginRepository

    <pluginRepository>
        <url>http://download.java.net/maven/1</url>
        <id>Java dot Net 1</id>
        <layout>legacy</layout>
        <name>Repository for JAX-WS tools</name>
    </pluginRepository>