I have a project that simply consists of files. I want to package those files into a zip and store them in a maven repository. I have the assembly plugin configured to build the zip file and that part works just fine, but I cannot seem to figure out how to install the zip file?
Also, if I want to use this assembly in another artifact, how would I do that? I am intending on calling dependency:unpack, but I don't have an artifact in the repository to unpack.
How can I get a zip file to be in my repository so that I may re-use it in another artifact?
parent pom
<build>
<plugins>
<plugin>
<!--<groupId>org.apache.maven.plugins</groupId>-->
<artifactId>maven-assembly-plugin</artifactId>
<version>2.2-beta-5</version>
<configuration>
<filters>
<filter></filter>
</filters>
<descriptors>
<descriptor>../packaging.xml</descriptor>
</descriptors>
</configuration>
</plugin>
</plugins>
</build>
Child POM
<parent>
<groupId>com. ... .virtualHost</groupId>
<artifactId>pom</artifactId>
<version>0.0.1</version>
<relativePath>../pom.xml</relativePath>
</parent>
<name>Virtual Host - ***</name>
<groupId>com. ... .virtualHost</groupId>
<artifactId>***</artifactId>
<version>0.0.1</version>
<packaging>pom</packaging>
I filtered the name out. Is this POM correct? I just want to bundle files for a particular virtual host together.
Thanks,
Walter
I think assemblies are supposed to be automatically attached to the build, but if that doesn't work, the Maven Build Helper "attach-artifact" goal attaches a specified file to be installed in the repository. I've used this plugin for installing files created by an external process like Ant or NSIS.
I don't know wether this could be usefull for you, but as a JAR file is basically a ZIP file plus the META-INF information, you could create your project as a jar without sources and add the xip countents in
src/main/resources
without needing any plugin configuration.If you want your content to be in a different location, you can always do something like:
I f you want your artifact to be installed and being accessible in a repository you will need to set it up for the deploy phase:
http://maven.apache.org/plugins/maven-deploy-plugin/usage.html
Well, the created assembly should get automatically attached to the project and then uploaded into the repository on an
install
anddeploy
goal. Can you show your pom?Update: With your current configuration, I don't think that the assembly gets created as part of your build. You need to bind the
single
goal to a lifecycle phase, typicallypackage
:And now it should get installed/deployed properly.
You can declare a dependency on an assembly (using the right
classifier
andtype
in your case) but since dependency are resolved through the repository, you'll need to solve the first step first. Then, declare something like this (where the classifier is the assembly's id):