简体   繁体   中英

java - Release a Maven project as library with several artifacts

This might be trivial but i'm having issue on how to do it. Currently i have a Maven project that generates a jar file (with other dependent jars), 3 scripts and 3 property files. It can be run standalone without problem.

Now i would like to release the artifacts from this project into our in house Maven Repository, so that others can use this project artifact and do customization. The question is, since there are non jar files in the build artifact, how should i release them?

Currently i'm using maven-jar-plugin to create the jar file, and maven-resources-plugin to copy the resource file to the target folder.

Any idea or correction is appreciated. Thank you.

EDIT

To be clear, what i intend to do is to allow other developer to reuse the classes of this project while adding custom features and settings.

Currently the output of the project are:

engine.jar
run.sh
runDaemon.sh
loadJob.sh
mapping.xml

For others, they can reuse engine.jar, while adding a jar of their own and edit the mapping.xml to suit their need.

EDIT2

Decided to export a single jar from the library project, and use Archetype to generate a template project instead. Accepting the answer below as it provides clear information for packaging several artifacts together.

You may want to pack those configs into a zip file. You should look at the maven assembly plugin which is created exacly for those cases (releasing one or more non jar artifacts).

There is an example with some text files which is similar to your case.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM