Reputation: 50287
We have one project that defines the message formats it produces with XSD files.
What is the easiest way to make these XSD files as dependencies of another project?
I was looking at using the maven-build-helper attach-artifact goal to attach my XSD files.
Is there a better mechanism?
Upvotes: 5
Views: 4352
Reputation: 51
I don't know the attach-artifact goal but I did something like you asked for. I had wsdl and xsd files to write Webservice artifacts and its client artifacts with axis2.
I put all these projects to a multi module project so that I can build all together. I think the important part for you is the configuration of dependency-plugin:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-wsdl-dependency</id>
<phase>initialize</phase>
<goals>
<goal>unpack</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>${groupId}</groupId>
<artifactId>wsdl</artifactId>
<outputDirectory>target/wsdl</outputDirectory>
<includes>META-INF/*.wsdl,META-INF/*.xsd</includes>
</artifactItem>
</artifactItems>
<!-- other configurations here -->
</configuration>
</plugin>
Hope that helps.
Greetings Michael
Upvotes: 5