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 my wsdl and xsd in an own
project named 'wsdl' to
src/main/resources/META-INF and
nothing else.
- I made a own project
named 'soap' for the generated
Java-SOAP-Code. In this project I
added the the wsdl project as
dependency and unpacked the wsdl and
xsd files via
maven-dependency-plugin to the
target folder in the
initialize-phase. So I can use it to
generate the SOAP-Code.
- The soap
project I used as dependency for the
Webservice project and for the
client project.
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