0

尝试使用 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 part ...<jwsc destdir="target">...@ 12:26 in C:\Default\soaservices\workspace\AccountInqWeb\target\antrun\build-webservice.build.xml

4

1 回答 1

0

编辑maven_home/bin/mvn.bat 确保使用JDK_1.5 tools.jar 1.6版本有bug

@REM 启动 MAVEN2 :runm2 %MAVEN_JAVA_EXE% %MAVEN_OPTS% -classpath C:\u001\isuser\tesbea\jdk160_05\jre\lib\tools.jar;%CLASSWORLDS_JAR% "-Dclassworlds.conf=%M2_HOME%\bin\m2. conf" "-Dmaven.home=%M2_HOME%" org.codehaus.classworlds.Launcher %MAVEN_CMD_LINE_ARGS% if ERRORLEVEL 1 goto error goto end

于 2012-02-27T20:29:54.757 回答