Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to create two separate jars with wsdl2java?
    primarykey
    data
    text
    <p>I’m very new to maven. I’m using wsdl2java to get the Java files and then create the jar file I need. The problem is that my urls come from different sources and eventually I need to have 4 different jar files.</p> <p>So far, I tried to create the first two jar files and deal with the next two later... So I created two different "execution" blocks in the "build" block; each "execution" block downloads each own wsdl files, so far so good. The following plugin:</p> <p>org.codehaus.mojo axistools-maven-plugin</p> <p>Works this way: it first compiles all the generated Java files and then generates the jar file out of all the files, meaning it creates only one jar file.</p> <p>Is there anyway, I ask wsdl2java to compile and then create the jar files right after each "execution" block? That I can get two different jar file each relating only to the wsdl files I downloaded in that "execution" block?</p> <p>Following is pom.xml. At this point the generated jar file consists of the Java files generated from: file1, file2, file3, file4 and file5.</p> <p>Where I want one jar from: file1, file2 and file3 and the other from: file4 and file5.</p> <p>Any help would be greatly appreciated.</p> <pre><code>&lt;build&gt; &lt;plugins&gt; &lt;plugin&gt; &lt;groupId&gt;org.codehaus.mojo&lt;/groupId&gt; &lt;artifactId&gt;axistools-maven-plugin&lt;/artifactId&gt; &lt;version&gt;1.4&lt;/version&gt; &lt;dependencies&gt; &lt;dependency&gt; &lt;groupId&gt;javax.mail&lt;/groupId&gt; &lt;artifactId&gt;mail&lt;/artifactId&gt; &lt;version&gt;1.4.1&lt;/version&gt; &lt;/dependency&gt; &lt;dependency&gt; &lt;groupId&gt;javax.activation&lt;/groupId&gt; &lt;artifactId&gt;activation&lt;/artifactId&gt; &lt;version&gt;1.1&lt;/version&gt; &lt;/dependency&gt; &lt;/dependencies&gt; &lt;executions&gt; &lt;execution&gt; &lt;id&gt;prod&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;wsdl2java&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;urls&gt; &lt;url&gt;https://file1.svc?wsdl&lt;/url&gt; &lt;url&gt;https://file2.svc?wsdl&lt;/url&gt; &lt;url&gt;https://file3.svc?wsdl&lt;/url&gt; &lt;/urls&gt; &lt;allElements&gt;true&lt;/allElements&gt; &lt;wrapArrays&gt;false&lt;/wrapArrays&gt; &lt;testCases&gt;false&lt;/testCases&gt; &lt;serverSide&gt;false&lt;/serverSide&gt; &lt;typeMappingVersion&gt;1.2&lt;/typeMappingVersion&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;execution&gt; &lt;id&gt;sandbox&lt;/id&gt; &lt;goals&gt; &lt;goal&gt;wsdl2java&lt;/goal&gt; &lt;/goals&gt; &lt;configuration&gt; &lt;sourceDirectory&gt;${basedir}/wsdl&lt;/sourceDirectory&gt; &lt;useEmitter&gt;true&lt;/useEmitter&gt; &lt;wsdlFiles&gt; &lt;wsdlFile&gt;file4.wsdl&lt;/wsdlFile&gt; &lt;wsdlFile&gt;file5.wsdl&lt;/wsdlFile&gt; &lt;/wsdlFiles&gt; &lt;allElements&gt;true&lt;/allElements&gt; &lt;wrapArrays&gt;false&lt;/wrapArrays&gt; &lt;testCases&gt;false&lt;/testCases&gt; &lt;serverSide&gt;false&lt;/serverSide&gt; &lt;typeMappingVersion&gt;1.2&lt;/typeMappingVersion&gt; &lt;/configuration&gt; &lt;/execution&gt; &lt;/executions&gt; &lt;/plugin&gt; &lt;/plugins&gt; &lt;/build&gt; </code></pre> <p>Since its too long for comment, I had to edit my original post...</p> <p>Thanks for the reply. I did try your solution. As you are aware, the "axistools-maven-plugin" has the "maven-compiler-plugin" and the "maven-jar-plugin" built in. It first downloads all wsdl files, from the specified urls. It creates different output directories; however, in the compile phase, it tries to compile all the Java files in all output directories at once; since there are some Java files which are common bet. these wsdl files, it gives the "duplicate class" error at compile time.</p> <p>We can define our own custom "maven-compiler-plugin" and "maven-jar-plugin" blocks and add the "include" or "exclude" blocks to let maven know what files to compile and how to create the jar files, but since "axistools-maven-plugin" runs its own "maven-compiler-plugin" first, it tries to compile all the Java files first and still gives "duplicate class" error <strong>before</strong> it looks at our "maven-compiler-plugin" and "maven-jar-plugin" blocks.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload