You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by "Maring, Steven" <St...@gentiva.com> on 2010/02/25 14:29:03 UTC
problem attaching non-archived files with maven-assembly-plugin
I am trying to deploy plain-text files (specifically, a WSDL and XSD) as
part of a project with pom packaging. I would like other developers to
be able to directly reference the WSDL as deployed in our local Nexus
repository. I have no difficulty deploying these with the "zip"
format. However, the "dir" format always seems to result in something
like:
[WARNING] Assembly file:
C:\workspace\webservice-java-example\contract\target\contract-1.0.0-0000
-SNAPSHOT-webservice-java-example-contracts is not a regular file (it
may be a directory). It cannot be attached to the project build for
installation or deployment.
If I am interpreting the assembly plugin documentation properly, it
would seem to suggest that this is possible.
Here is what I have been doing ...
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<descriptors>
<descriptor>src/main/assembly/contracts.xml</descriptor>
</descriptors>
</configuration>
<executions>
<execution>
<phase>package</phase>
<goals>
<goal>single</goal>
</goals>
</execution>
</executions>
</plugin>
<assembly>
<id>webservice-java-example-contracts</id>
<formats>
<format>dir</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>src/main/resources</directory>
<includes>
<include>example.xsd</include>
<include>example.wsdl</include>
</includes>
<outputDirectory></outputDirectory>
</fileSet>
</fileSets>
</assembly>
-Steve Maring
Tampa, FL
Re: problem attaching non-archived files with maven-assembly-plugin
Posted by Jörg Schaible <jo...@gmx.de>.
Hi Steven,
Maring, Steven wrote at Donnerstag, 25. Februar 2010 14:29:
> I am trying to deploy plain-text files (specifically, a WSDL and XSD) as
> part of a project with pom packaging. I would like other developers to
> be able to directly reference the WSDL as deployed in our local Nexus
> repository.
[snip]
Use the attach-artifact goal of the build-helper plugin:
=============== %< =================
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<executions>
<execution>
<id>xml-schema</id>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>src/main/xsd/my.xsd</file>
<type>xsd</type>
</artifact>
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
=============== %< =================
It shares the GAV of the pom. The nice thing is, you can now address it as
dep of type "xsd" and you have on top a direct URL where it is accessible in
the Maven repo.
- Jörg
---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
For additional commands, e-mail: users-help@maven.apache.org