2013-08-31 104 views
0

iam使用maven java2wsdl生成從java類生成wsdl。另外我沒有得到任何異常。下面是pom.xml。請任何人都可以建議如何解決它。wsdl沒有從java類生成

<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>com.facial</groupId> 
    <artifactId>facedetections</artifactId> 
    <packaging>war</packaging> 
    <version>0.0.1-SNAPSHOT</version> 
    <name>facedetections Maven Webapp</name> 
    <url>http://maven.apache.org</url> 
    <dependencies> 
    <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>3.8.1</version> 
     <scope>test</scope> 
    </dependency> 
    <dependency> 
     <groupId>com.sun.xml.ws</groupId> 
     <artifactId>jaxws-rt</artifactId> 
     <version>2.1.3</version> 
    </dependency> 
    <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>5.1.6</version> 
    </dependency>   
    <dependency> 
     <groupId>gov.nist.math</groupId> 
     <artifactId>jama</artifactId> 
     <version>1.0.3</version> 
    </dependency> 
    <dependency> 
     <groupId>javax.media</groupId> 
     <artifactId>jmf</artifactId> 
     <version>2.1.1e</version> 
    </dependency> 
    </dependencies> 

    <build> 
    <finalName>facedetections</finalName> 
    <pluginManagement> 
    <plugins> 
     <plugin> 
     <artifactId>maven-antrun-plugin</artifactId> 
     <executions> 
      <execution> 
      <phase>deploy</phase> 
      <configuration> 
       <tasks> 
       <target name="-post-compile"> 
        <copy file="C:\Program Files\JMF2.1.1e\lib\jmf.properties" todir="E:\path\to\local\repo\javax\media\jmf\2.1.1e\"/> 
       </target> 
       <!-- 
        Place any Ant task here. You can add anything 
        you can add between <target> and </target> in a 
        build.xml. 
       --> 

       </tasks> 
      </configuration> 
      <goals> 
       <goal>run</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>2.3.1</version> 
      <configuration> 
       <source>1.6</source> 
       <target>1.6</target> 
      </configuration> 
     </plugin> 


     <plugin> 
      <groupId>org.codehaus.mojo</groupId> 
      <artifactId>jaxws-maven-plugin</artifactId> 
      <executions> 
       <execution> 
        <id>generate-wsdl</id> 
        <phase>process-classes</phase> 
        <goals> 
         <goal>wsgen</goal> 
        </goals> 
        <configuration> 
         <sei>com.facial.facedetection.ws.FaceDetectionV001<!-- fully qualified class name goes here --></sei> 
         <genWsdl>true</genWsdl> 
        </configuration> 
       </execution> 
       <execution> 
        <id>generate-stubs</id> 
        <phase>process-classes</phase> 
        <goals> 
         <goal>wsimport</goal> 
        </goals> 
        <configuration> 
         <wsdlDirectory>target/jaxws/wsgen/wsdl</wsdlDirectory> 
         <wsdlFiles>     
          <wsdlFile><!-- class name goes here -->Service.wsdl</wsdlFile> 
         </wsdlFiles> 
         <!-- *** you need the next line to set the wsdlLocation in the generated stubs *** --> 
         <wsdlLocation>http://localhost:8080/test</wsdlLocation> 
        </configuration> 
       </execution> 
      </executions> 
     </plugin> 

    </plugins> 
    </pluginManagement> 
    </build> 
</project> 

另外在構建控制檯中,沒有任何jslog的日誌來生成wsdl。以下是控制檯日誌。

[INFO] Scanning for projects... 
[INFO]                   
[INFO] ------------------------------------------------------------------------ 
[INFO] Building facedetections Maven Webapp 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:resources (default-resources) @ facedetections --- 
[debug] execute contextualize 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 2 resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.1:compile (default-compile) @ facedetections --- 
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! 
[INFO] Compiling 26 source files to C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\target\classes 
[INFO] 
[INFO] --- maven-resources-plugin:2.5:testResources (default-testResources) @ facedetections --- 
[debug] execute contextualize 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\src\test\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.3.1:testCompile (default-testCompile) @ facedetections --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.10:test (default-test) @ facedetections --- 
[INFO] No tests to run. 
[INFO] Surefire report directory: C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\target\surefire-reports 

------------------------------------------------------- 
T E S T S 
------------------------------------------------------- 

Results : 

Tests run: 0, Failures: 0, Errors: 0, Skipped: 0 

[INFO] 
[INFO] --- maven-war-plugin:2.1.1:war (default-war) @ facedetections --- 
[INFO] Packaging webapp 
[INFO] Assembling webapp [facedetections] in [C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\target\facedetections] 
[INFO] Processing war project 
[INFO] Copying webapp resources [C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\src\main\webapp] 
[INFO] Webapp assembled in [1998 msecs] 
[INFO] Building war: C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\target\facedetections.war 
[WARNING] Warning: selected war files include a WEB-INF/web.xml which will be ignored 
(webxml attribute is missing from war task, or ignoreWebxml attribute is specified as 'true') 
[INFO] 
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ facedetections --- 
[INFO] Installing C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\target\facedetections.war to C:\path\to\local\repo\com\facial\facedetections\0.0.1-SNAPSHOT\facedetections-0.0.1-SNAPSHOT.war 
[INFO] Installing C:\Users\LENOVO\workspace\JavaCV-Harr\face-detection\facedetections\pom.xml to C:\path\to\local\repo\com\facial\facedetections\0.0.1-SNAPSHOT\facedetections-0.0.1-SNAPSHOT.pom 
[INFO] ------------------------------------------------------------------------ 
[INFO] BUILD SUCCESS 
[INFO] ------------------------------------------------------------------------ 
[INFO] Total time: 20.676s 
[INFO] Finished at: Sat Aug 31 22:13:53 IST 2013 
[INFO] Final Memory: 10M/25M 
[INFO] ------------------------------------------------------------------------ 

回答

0

您需要添加插件調用:

<plugins> 
    <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>jaxws-maven-plugin</artifactId> 
    </plugin> 
</plugins> 

pluginManagement

PluginManagement在pomfile是插件運行(兒童模塊以及)的配置,但這個插件將不會在當前構建實際運行,如果它不是在主插件元素聲明還

+0

對不起,請能你肯定地解釋清楚 – developer

+0

;無論您在'中放入的插件定義是否爲該特定插件(可以在子項目中繼承)的配置。其執行實際附加到構建的插件是''元素中列出的插件。 –

+0

因此,您可以選擇1.將'jaxws插件聲明移到''之外或者2.將它留在那裏並在''內添加一個新聲明(只有artifactId和groupId,所有其他屬性將從pluginManagement中讀取) –