使用maven antrun插件的jwsc任务

时间:2012-02-27 05:35:36

标签: maven-2 maven-plugin maven-3 weblogic-10.x maven-ant-tasks

尝试使用maven antrun插件执行jwsc任务

<plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>1.7</version>
                    <executions>
                        <execution>
                            <phase>compile</phase>
                            <goals>
                              <goal>run</goal>
                            </goals>
                            <configuration>
                                <target name="webservice.build">

                                    <path id="weblogic.jar.classpath">

                                        <path location="${weblogic.home}/server/lib/weblogic.jar"/>
                                    </path>


                                    <taskdef name="jwsc" classname="weblogic.wsee.tools.anttasks.JwscTask" classpathref="weblogic.jar.classpath" >
                                        <classpath>
                                            <path refid="weblogic.jar.classpath" />
                                        </classpath>
                                    </taskdef>


                                    <jwsc destdir="target">
                                    <module name="AccountInqWeb" explode="true" contextPath="AccountInqWeb">

                                        <jwsFileSet srcdir="src/com/services/accountinquiry/ws">
                                            <include name="**/*.java"/>
                                        </jwsFileSet>
                                        <descriptor file="WebContent/WEB-INF/web.xml"/>
                                        <descriptor file="WebContent/WEB-INF/weblogic.xml"/>
                                    </module>
                                    </jwsc>
                                </target>
                             </configuration>
                          </execution>
                        </executions>
                      </plugin>
<dependency>
          <groupId>com.sun</groupId>
          <artifactId>tools</artifactId>
          <version>1.6</version>
          <scope>system</scope>
          <systemPath>${java.home}/../lib/tools.jar</systemPath>
       </dependency>

发生了Ant BuildException:java.lang.NoClassDefFoundError:com / sun / javadoc / Type  Ant部分...<jwsc destdir="target">... @ 12:26在C:\ Default \ soaservices \ workspace \ AccountInqWeb \ target \ antrun \ build-webservice.build.xml

1 个答案:

答案 0 :(得分:0)

编辑maven_home / bin / mvn.bat 确保使用JDK_1.5 tools.jar 1.6版本中存在错误

@REM启动MAVEN2 :runm2 %MAVEN_JAVA_EXE %% MAVEN_OPTS%-classpath C:\ u001 \ isuser \ tesbea \ jdk160_05 \ jre \ lib \ tools.jar;%CLASSWORLDS_JAR%&#34; -Dclassworlds.conf =%M2_HOME%\ bin \ m2.conf&#34 ; &#34; -Dmaven.home =%M2_HOME%&#34; org.codehaus.classworlds.Launcher%MAVEN_CMD_LINE_ARGS% 如果ERRORLEVEL 1转到错误 转到最后

相关问题