2017-08-18 8 views
0

私はSOAPサービスを利用しようとしている春に基づいたWebアプリケーションを持っています。私はjaxb2-maven-plugin(org.codehaus.mojo)を使っています。しかし、私はターゲットの下にcrated空のjaxb2フォルダを参照してくださいと私はそれに任意のJavaクラスを参照してください。リソースフォルダ自体の下にwsdlが正しく配置されています。以下は codehaus.mojoを使用してJavaクラスを作成できませんjaxb2-maven-plugin

は、私はそれが解析を言うと、ログ内のスキーマのコンパイルが、私はいずれかを参照していけない "maven install"

[INFO] Building rap-web Maven Webapp 0.0.1-SNAPSHOT 
[INFO] ------------------------------------------------------------------------ 
[INFO] 
**[INFO] --- jaxb2-maven-plugin:1.6:xjc (xjc) @ rap-web --- 
[INFO] Generating source... 
[WARNING] No encoding specified; default platform encoding will be used for generated sources. 
[INFO] parsing a schema... 
[INFO] compiling a schema... 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ rap-web --- 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] Copying 15 resources 
[INFO] Copying 3 resources to wsdl 
[INFO] Copying 1 resource to config 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:compile (default-compile) @ rap-web --- 
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent! 
[INFO] Compiling 50 source files to C:\Users\xx67047\DSA-GIT-Projects\10.22.17-dsa-rap-services\rap-web\target\classes** 
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ rap-web --- 
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent! 
[INFO] skip non existing resourceDirectory C:\Users\xx67047\DSA-GIT-Projects\10.22.17-dsa-rap-services\rap-web\src\test\resources 
[INFO] 
[INFO] --- maven-compiler-plugin:2.5.1:testCompile (default-testCompile) @ rap-web --- 
[INFO] Nothing to compile - all classes are up to date 
[INFO] 
[INFO] --- maven-surefire-plugin:2.12.4:test (default-test) @ rap-web --- 

を実行すると、ログ以下

<build> 
     <finalName>${project.artifactId}</finalName> 
     <resources> 
      <resource> 
       <directory>src/main/resources</directory> 
      </resource> 
      <resource> 
       <directory>src/main/java/com/xyz/rap/service/impl/wsdl</directory> 
       <targetPath>wsdl</targetPath> 
      </resource> 
      <resource> 
       <directory>src/main/config</directory> 
       <targetPath>config</targetPath> 
      </resource> 
     </resources> 
     <plugins> 
     <plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>jaxb2-maven-plugin</artifactId> 
       <version>1.6</version> 
       <executions> 
        <execution> 
         <id>xjc</id> 
         <goals> 
          <goal>xjc</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <!-- Package to store the generated file --> 
        <packageName>com.xxx.gen.retail.abc</packageName> 
        <!-- Treat the input as WSDL --> 
        <wsdl>true</wsdl> 
        <!-- Input is not XML schema --> 
        <xmlschema>false</xmlschema> 
        <!-- The location of the WSDL file --> 
        <schemaDirectory>${project.basedir}/src/main/resources</schemaDirectory> 
        <!-- The WSDL file that you saved earlier --> 
        <schemaFiles>gene.wsdl</schemaFiles> 
        <!-- Don't clear output directory on each run --> 
        <clearOutputDir>false</clearOutputDir> 
       </configuration> 
      </plugin> 
      <plugin> 
       <groupId>org.apache.maven.plugins</groupId> 
       <artifactId>maven-compiler-plugin</artifactId> 
       <configuration> 
        <!-- or whatever version you use --> 
        <source>1.7</source> 
        <target>1.7</target> 
       </configuration> 
      </plugin> 
     </plugins> 
    </build> 
</project> 

のpom.xmlで作成したプラグインの設定されていますログにJavaクラスが作成され、空のjaxb2フォルダと空の生成されたソースフォルダが作成されています。そのため、画像の下に参照してください:

enter image description here

答えて

0

jaxb2-maven-plugintarget/generated-sources/jaxbにデフォルトでクラスを作成します。クラスをターゲットフォルダに入れない場合は、Eclipseを使用している場合は、プロジェクトを右クリックして[ビルドパス]> [ソースフォルダを使用する]を選択します。

mvn clean installを実行すると、ターゲットフォルダを消去または削除してすべてを再生成します

+0

私は試しましたが、target/generated-sources内にjaxbフォルダを作成しませんでした。問題がWSDL自体にあるのかどうかは疑問です。しかし、私はwsimportを使ってスタブを生成できますが、jaxb2-maven-pluginでは生成できません。 – RRN

0

codehausのバージョン2.2を試してください.xmlを変更する必要があることに留意してください。1.xと2.x。

私は同様の問題を抱えていると言いましたが、それは他の何かによって引き起こされる可能性があります。私はIntelliJを使用しており、空のjを生成しています/ target/generated-sources /の下のaxbフォルダに移動します。

<plugin> 
       <groupId>org.codehaus.mojo</groupId> 
       <artifactId>jaxb2-maven-plugin</artifactId> 
       <version>2.2</version> 
       <executions> 
        <execution> 
         <id>xjc</id> 
         <goals> 
          <goal>xjc</goal> 
         </goals> 
        </execution> 
       </executions> 
       <configuration> 
        <sources> 
         <source>/src/main/resources/xsd/</source> 
        </sources> 
        <outputDirectory>${project.basedir}/target/generated-sources/jaxb</outputDirectory> 
        <clearOutputDir>false</clearOutputDir> 
       </configuration> 
</plugin> 
関連する問題