maven-assembly-plugin

Generate two jar with the same maven project

落花浮王杯 提交于 2019-12-01 07:44:06
I would like to generate two jars from the same maven project when executing a mvn clean install. The only difference between the two jars, will be the content of the META-INF folder. For the moment, I've my-app.jar , I would like to have now my-jar-xxx.jar and my-jar-yyy.jar . How can I achieve this ? Regards. Raghuram You should not be creating two maven jars from the same maven project. Why? This sonatype blog post should explain. The same article also explains two ways in which you can still do it, if you want to Using profiles By doing two executions of maven jar plugin Here is the

Maven include another pom for plugin configuration

﹥>﹥吖頭↗ 提交于 2019-12-01 05:27:06
is there a way to include another pom or information in a maven pom ? I have several poms which are basically not related or have different parent poms. Nevertheless for packaging it is required to have a Manifest identical to all projects. So currently I have in a pom: <plugin> <artifactId>maven-assembly-plugin> <!--- .... --> <archive> <manifestEntries> <build-date>....</build-date> <build-nr>.....</build-nr> etc etc I would like to avoid to paste this configuration to all severall poms. So how can I share the configuration of a plugin without inheritance ? Thanks One way to do this is using

Maven, how to copy files?

[亡魂溺海] 提交于 2019-12-01 04:43:46
I want to copy some files (jar, launch scripts, docs) to some directory, like dist/ in project root. I am using maven-assembly-plugin and set <configuration><outputDirectory> in pom.xml. It creates files in dist/ but inside <my_project>-<decsriptor_id>/ subdirectory. Is there any way to output it just in the root of dist/ ? Or is there a plugin in Maven that simply copies files? <plugin> <artifactId>maven-assembly-plugin</artifactId> <version>3.0.0</version> <executions> <execution> <id>maven-assembly</id> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions>

java maven rebuild dependency

℡╲_俬逩灬. 提交于 2019-12-01 03:18:13
I have a project which has dependency A. Project is packing into WAR and dependency A - into jar. And another dependency B, which also depends on A. I want to pack project and when project B is packing it must rebuild its dependency A instead of getting compiled dependency. Please help, how can i achieve this Always perform a clean when doing an install, ie mvn clean install . This will make sure that all modules in the project are rebuilt, packaged, and installed in the local .m2 repository for inclusion by parent dependencies and projects. What you may want is a multi-module project

Maven include another pom for plugin configuration

陌路散爱 提交于 2019-12-01 02:09:17
问题 is there a way to include another pom or information in a maven pom ? I have several poms which are basically not related or have different parent poms. Nevertheless for packaging it is required to have a Manifest identical to all projects. So currently I have in a pom: <plugin> <artifactId>maven-assembly-plugin> <!--- .... --> <archive> <manifestEntries> <build-date>....</build-date> <build-nr>.....</build-nr> etc etc I would like to avoid to paste this configuration to all severall poms. So

Maven - 'all' or 'parent' project for aggregation?

大兔子大兔子 提交于 2019-11-30 21:47:54
For educational purposes I have set up a project layout like so (flat in order to suite eclipse better): -product | |-parent |-core |-opt |-all Parent contains an aggregate project with core, opt and all. Core implements the mandatory part of the application. Opt is an optional part. All is supposed to combine core with opt, and has these two modules listed as dependencies. I am now trying to make the following artifacts: product-core.jar product-core-src.jar product-core-with-dependencies.jar product-opt.jar product-opt-src.jar product-opt-with-dependencies.jar product-all.jar product-all-src

Log4j2 custom plugins - annotation processing with Maven Assembly Plugin

陌路散爱 提交于 2019-11-30 19:44:06
I am not very familiar with Maven, I started using it just yesterday, but I like it. In my project I use Log4j2 library for logging and because of insufficiecy of advanced plugins (like appenders, converters) I need to use custom plugins . log4j-api and log4j-core (also with a bunch of other libraries) are added as dependencies in pom.xml associated with my project. Actually I am using version 2.0 of Log4j. Log4j uses annotation processing to pre-load classes marked as @Plugin . As far as I know, in older releases of log4j, additional plugin entry had to be specified in pom.xml to trigger

maven-assembly-plugin的使用

≡放荡痞女 提交于 2019-11-30 19:08:11
maven-assembly-plugin使用描述(拷自 maven-assembly-plugin 主页 ) The Assembly Plugin for Maven is primarily intended to allow users to aggregate the project output along with its dependencies, modules, site documentation, and other files into a single distributable archive. 目前它只有一个有意义的goal, 详细的请看( http://maven.apache.org/plugins/maven-assembly-plugin/plugin-info.html ): assembly:single single操作有很多可配置的参数,详细的请看( http://maven.apache.org/plugins/maven-assembly-plugin/single-mojo.html )。 简单的说,maven-assembly-plugin 就是用来帮助打包用的,比如说打出一个什么类型的包,包里包括哪些内容等等。 目前至少支持以下打包类型: zip tar tar.gz tar.bz2 jar dir war 默认情况下

Maven - Include dependent libs in jar without unpacking dependencies?

风格不统一 提交于 2019-11-30 17:10:38
We're trying to build a client jar that includes unpacked dependent jar's. And the manifest should have class-path entries to the dependent jars. The snippet below works but the jars are unpacked - how can we stop the jars from being unpacked? <plugin> <artifactId>maven-assembly-plugin</artifactId> <configuration> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> <archive> <manifest> <addClasspath>true</addClasspath> </manifest> </archive> </configuration> <executions> <execution> <id>make-assembly</id> <phase>package</phase> <goals> <goal>single</goal> <

Maven assembly plugin warning “The assembly descriptor contains a filesystem-root relative reference”

☆樱花仙子☆ 提交于 2019-11-30 16:47:25
Starting from some assembly plugin version maven builds issue the following warning: [WARNING] The assembly descriptor contains a filesystem-root relative reference,which is not cross platform compatible / Is there any recommended ready-to-use solution for this? Direct googling provided me with lot of trash and no real help. Re-check of Maven assembly plugin help did not provide answer for me, maybe someone else has better search skill and can help. UPDATE Yes, this is probably because of Linux-like outputDirectory but how should I rewrite this to be portable? Looked at assembly plugin