I have a maven module for holding a plain text file that I need to "build" (rename the file with name-version-classifier.extension format) and deploy on my maven repository. I know I can deploy it via command line but I want to know if i can write a pom.xml whereby I can achive the same result.
LDM.
In Maven terminology, an artifact is an output generated after a Maven project build. It can be, for example, a jar, war, or any other executable file. Also, Maven artifacts include five key elements, groupId, artifactId, version, packaging, and classifier.
From the discussion How to attach a text file to a module's distribution? :
In the past i've made use of the Build Helper plug-in to attach additional artifacts https://www.mojohaus.org/build-helper-maven-plugin
The example of how to attach additional artifacts to your project shows how to attach a file; make your module of type pom
and the additional artifact will be the only artifact deployed:
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
<version>1.8</version>
<executions>
<execution>
<id>attach-artifacts</id>
<phase>package</phase>
<goals>
<goal>attach-artifact</goal>
</goals>
<configuration>
<artifacts>
<artifact>
<file>some file</file>
<type>extension of your file </type>
<classifier>optional</classifier>
</artifact>
...
</artifacts>
</configuration>
</execution>
</executions>
</plugin>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With