Java 不是由 axistools-maven-plugin 生成

Java not generated by axistools-maven-plugin

我正在从事 Web 服务项目,但在使 Maven 构建正常工作时遇到问题。实际上,插件 运行 没有任何错误,它正在生成 jar,但 没有源代码

我用的pom。

<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>com.test.affi</groupId>
    <artifactId>tradetracker-ws</artifactId>
    <packaging>jar</packaging>
    <version>0.0.1-SNAPSHOT</version>
    <name>TradeTracker ws library</name>


    <organization>
        <name>testorgani</name>
        <url>www.testorgani.com</url>
    </organization>

    <distributionManagement>
        <repository>
            <id>internal.repos.release</id>
            <name>Internal Maven2 Release Repository</name>
            <url>file:///Users/User/Dropbox/Public/maven/release</url>
        </repository>
        <snapshotRepository>
            <id>internal.repos.snapshot</id>
            <name>Internal Maven2 Snapshot Repository</name>
            <url>file:///Users/User/Dropbox/Public/maven/snapshot</url>
        </snapshotRepository>
    </distributionManagement>

    <repositories>
        <repository>
            <id>maven2-repository.dev.java.net</id>
            <name>Java.net Repository for Maven 2</name>
            <url>http://download.java.net/maven/2</url>
        </repository>
    </repositories>

    <pluginRepositories>
        <pluginRepository>
            <id>maven2-repository.dev.java.net</id>
            <url>http://download.java.net/maven/2</url>
        </pluginRepository>
    </pluginRepositories>

    <dependencies>
        <dependency>
            <groupId>javax.xml.ws</groupId>
            <artifactId>jaxws-api</artifactId>
            <version>2.2.11</version>
        </dependency>

        <dependency>
            <groupId>org.apache.xmlbeans</groupId>
            <artifactId>xmlbeans</artifactId>
            <version>2.6.0</version>
        </dependency>   
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>axistools-maven-plugin</artifactId>
                <version>1.4</version>

                <executions>
                    <execution>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>wsdl2java</goal>
                        </goals>
                        <configuration>

                            <sourceRoot>${project.build.directory}/generated/tradetracker</sourceRoot>
                            <wsdlOptions>
                                <wsdlOption>
                                    <wsdl>http://ws.tradetracker.com/soap/affiliate?wsdl</wsdl>
                                    <!-- <wsdl>${basedir}/affiliate_wsdl.xml</wsdl> -->
                                    <bindingFiles>
                                        <bindingFile>${basedir}/src/main/resources/bindings.xml</bindingFile>
                                    </bindingFiles>
                                </wsdlOption>
                            </wsdlOptions>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>    
</project>

这就是我从 maven 得到的结果。

Uerss-MBP:test-affi-tradetracker-ws User$ mvn deploy
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building TradeTracker webservices library 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO] 
[INFO] --- axistools-maven-plugin:1.4:wsdl2java (default) @ tradetracker-ws ---
[INFO] about to add compile source root
[INFO] Nothing to generate. All WSDL files are up to date.
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ tradetracker-ws ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 1 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) @ tradetracker-ws ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ tradetracker-ws ---
[WARNING] Using platform encoding (MacRoman actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 0 resource
[INFO] 
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) @ tradetracker-ws ---
[INFO] Nothing to compile - all classes are up to date
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ tradetracker-ws ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ tradetracker-ws ---
[INFO] Building jar: /Users/User/test-affi-tradetracker-ws/target/tradetracker-ws-0.0.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-install-plugin:2.4:install (default-install) @ tradetracker-ws ---
[INFO] Installing /Users/User/test-affi-tradetracker-ws/target/tradetracker-ws-0.0.1-SNAPSHOT.jar to /Users/User/.m2/repository/affi/tradetracker-ws/0.0.1-SNAPSHOT/tradetracker-ws-0.0.1-SNAPSHOT.jar
[INFO] Installing /Users/User/test-affi-tradetracker-ws/pom.xml to /Users/User/.m2/repository/affi/tradetracker-ws/0.0.1-SNAPSHOT/tradetracker-ws-0.0.1-SNAPSHOT.pom
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ tradetracker-ws ---
Downloading: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/maven-metadata.xml
Downloaded: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/maven-metadata.xml (790 B at 128.6 KB/sec)
Uploading: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/tradetracker-ws-0.0.1-20150607.151342-15.jar
Uploaded: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/tradetracker-ws-0.0.1-20150607.151342-15.jar (3 KB at 1241.2 KB/sec)
Uploading: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/tradetracker-ws-0.0.1-20150607.151342-15.pom
Uploaded: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/tradetracker-ws-0.0.1-20150607.151342-15.pom (3 KB at 1274.9 KB/sec)
Downloading: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/maven-metadata.xml
Downloaded: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/maven-metadata.xml (297 B at 145.0 KB/sec)
Uploading: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/maven-metadata.xml
Uploaded: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/0.0.1-SNAPSHOT/maven-metadata.xml (790 B)
Uploading: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/maven-metadata.xml
Uploaded: file:///Users/User/Dropbox/Public/maven/snapshot/affi/tradetracker-ws/maven-metadata.xml (297 B)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.704 s
[INFO] Finished at: 2015-06-07T17:13:42+02:00
[INFO] Final Memory: 7M/81M
[INFO] ------------------------------------------------------------------------

我错过了什么???请给我指个光!

经过数小时尝试各种配置后,我终于找到了正确的配置。

我将 WSDL 位置移动到 urls 标记内。

<configuration>
    <urls>
        <url>http://ws.tradetracker.com/soap/affiliate?wsdl</url>
    </urls>
</configuration>

而不是

<configuration>
    <wsdlOptions>
        <wsdlOption>
            <wsdl>http://ws.tradetracker.com/soap/affiliate?wsdl</wsdl>
        </wsdlOption>
    </wsdlOptions>
</configuration>

这对我有用。