我正在尝试使用axis2和maven生成webservice客户端 所以我按照一些教程并在我的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 install”或“mvn clean compile”编译时,我收到了消息:
[INFO]插件中的内部错误 经理执行目标 “org.apache.axis2:AXI S2-wsdl2code - Maven的插件:1.5.1:wsdl2code“: 无法加载mojo'org.apache。 Axis2的:Axis2的-wsdl2code - Maven的插件:1.5.1:wsdl2code” 在插件'org.apache.ax中 IS2:Axis2的-wsdl2code - Maven的插件。一个 缺少所需的课程: 组织/阿帕奇/ Axis2的 / WSDL /代码生成/ CodeGenerationException org.apache.axis2.wsdl.codegen.CodeGenerationException
有人能帮助我吗?
答案 0 :(得分:0)
我的猜测是你错过了这种依赖:
<dependency>
<groupId>org.apache.axis2</groupId>
<artifactId>axis2-codegen</artifactId>
<version>1.5.1</version>
</dependency>
scope =提供或插件依赖可能就足够了。您可以在the plugin's dependencies
上看到mvnrepository.com