Hi,

I tried to run the Tuscany "WSDL2Java" tool in command line and found it's so 
painful to set the classpath. Do we have a script for that?

I did some investigation and found that maven has a plugin for this purpose: 
http://maven.apache.org/plugins/maven-assembly-plugin/

1) Adding the following section to the pom.xml

  <build>
    <plugins>
      <plugin>
        <artifactId>maven-assembly-plugin</artifactId>
        <configuration>
              <descriptorId>jar-with-dependencies</descriptorId> 
        </configuration>
      </plugin>
    </plugins>
  </build>

Please note "jar-with-dependencies" is predefined assembly descriptor. You can 
further customize it and reference it in the pom.xml using 
<descriptor>path/to/descriptor.xml</descriptor>

<assembly>
  <id>jar-with-dependencies</id>
  <formats>
    <format>jar</format>
  </formats>
  <includeBaseDirectory>false</includeBaseDirectory>
  <fileSets>
    <fileSet>
      <directory>target/classes</directory>
      <outputDirectory>/</outputDirectory>
    </fileSet>
  </fileSets>
  <dependencySets>
    <dependencySet>
      <outputDirectory>/</outputDirectory>
      <unpack>true</unpack>
      <scope>runtime</scope>
    </dependencySet>
  </dependencySets>
</assembly>
2) Run the mvn assembly:assembly and you'll get a FAT jar containing everything 
you need to run the given project.In my case, 
tuscany-sca-tools-SNAPSHOT-jar-with-dependencies.jar is created and you can use 
it as the classpath to run the WSDL2Java.

Reply via email to