1

axis2 と maven を使用して Web サービス クライアントを生成しようとしているので、いくつかのチュートリアルに従い、いくつかのコード行を pom.xml に入れました。

<plugin>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-wsdl2code-maven-plugin</artifactId>
    <version>1.5.1</version>
    <executions>
        <execution>
            <goals>
                <goal>wsdl2code</goal>
            </goals>
            <configuration>
                <packageName>my.packageName</packageName>
                <wsdlFile>src/main/resources/wsdl/service.wsdl</wsdlFile>
                <databindingName>xmlbeans</databindingName>
                <generateAllClasses>true</generateAllClasses>
                <generateServerSide>true</generateServerSide>
                <generateServerSideInterface>true</generateServerSideInterface>
                <generateServicesXml>true</generateServicesXml>
                <serviceName>service</serviceName>
            </configuration>
        </execution>
    </executions>
</plugin>

依存関係を追加しました:

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2</artifactId>
    <version>1.5.1</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-api</artifactId>
    <version>1.2.6</version>
</dependency>
<dependency>
    <groupId>org.apache.ws.commons.axiom</groupId>
    <artifactId>axiom-impl</artifactId>
    <version>1.2.6</version>
</dependency>
<dependency>
    <groupId>axis</groupId>
    <artifactId>axis-wsdl4j</artifactId>
    <version>1.5.1</version>
</dependency>
<dependency>
    <groupId>org.apache.xmlbeans</groupId>
    <artifactId>xmlbeans</artifactId>
    <version>2.3.0</version>
</dependency>

実際、mvn clean installormvn clean compileでコンパイルすると、次のメッセージが表示されました。

[情報] 目標 'org.apache.axis2:axi s2-wsdl2code-maven-plugin:1.5.1:wsdl2code' を実行しているプラ​​グイン マネージャーの内部エラー: mojo 'org.apache を読み込めません。プラグイン 'org.apache.ax is2:axis2-wsdl2code-maven-plugin' の axis2:axis2-wsdl2code-maven-plugin:1.5.1:wsdl2code'。必要なクラスがありません: org/apache/axis2 /wsdl/codegen/CodeGenerationException org.apache.axis2.wsdl.codegen.CodeGenerationException

誰か助けてくれませんか?

4

1 に答える 1

0

私の推測では、この依存関係が欠落していると思われます:

<dependency>
    <groupId>org.apache.axis2</groupId>
    <artifactId>axis2-codegen</artifactId>
    <version>1.5.1</version>
</dependency>

scope=Provide またはプラグインの依存関係でおそらく十分です。mvnrepository.comでプラグインの依存関係を確認できます。

于 2010-10-11T14:57:48.953 に答える