maven-assembly-plugin

Manually attach main artifact if built by maven-assembly-plugin

扶醉桌前 提交于 2019-12-03 12:49:09
I am having problems building a maven project. I have a requirement to produce deterministic jar files, which must be binary-consistent across different builds and versions, in case there are no source code changes in between these builds. For the purpose, I have used this article for guidance. I have successfully managed to build my jars and they are consistent up to my requirements. Here is my configuration: <plugin> <artifactId>maven-antrun-plugin</artifactId> <version>1.7</version> <executions> <execution> <id>step-1-remove-timestamp</id> <phase>prepare-package</phase> <configuration>

Why Maven assembly works when SBT assembly find conflicts

断了今生、忘了曾经 提交于 2019-12-03 12:48:19
The title could also be: What are the differences between Maven and SBT assembly plugins. I have found this to be an issue, while migrating a project from Maven to SBT. To describe the problem I have created an example project with dependencies that I found to behave differently, depending on the build tool. https://github.com/atais/mvn-sbt-assembly The only dependencies are (sbt style) "com.netflix.astyanax" % "astyanax-cassandra" % "3.9.0", "org.apache.cassandra" % "cassandra-all" % "3.4", and what I do not understand is, why mvn package creates the fat jar successfully, while sbt assembly

Exclude unused parts of dependencies from jar (Maven)

守給你的承諾、 提交于 2019-12-03 10:37:13
We have a small project with some heavy-weight dependencies (e.g. Spring) of which we only use small parts. Therefore, the JAR we get when packing with all dependencies weighs several megabytes, even for out two-class-server. This seems unnecessary. Is there a way to restrict JAR assembly to actually used (class) files? You can use the maven-shade-plugin to create a Jar-with-dependencies (your project and the dependencies merged into one big jar) while limiting the classes or packages that are added to that jar. See the includes / excludes page for reference. If you don't want to manually

Create a zip with all dependencies with Maven [duplicate]

女生的网名这么多〃 提交于 2019-12-03 09:47:53
问题 This question already has answers here : Closed 7 years ago . Possible Duplicate: With Maven, how can I build a distributable that has my project's jar and all of the dependent jars? maybe I'm blind, but can the maven assembly plugin just create a zip file containing the current project.jar and all my dependency jars? the "bin" id contains just my project.jar and the jar-with-dependencies puts all together in one jar which I don't like. 回答1: You need a custom assembly descriptor to do what

Maven的生命周期和maven-assembly-plugin插件使用

自闭症网瘾萝莉.ら 提交于 2019-12-03 08:10:36
记住,运行任何一个阶段的时候,它前面的所有阶段都会被运行,这也就是为什么我们运行mvn install 的时候,代码会被编译,测试,打包。 Maven的插件机制是完全依赖Maven的生命周期的。 Furthermore, a build phase can also have zero or more goals bound to it. If a build phase has no goals bound to it, that build phase will not execute. 此外,每个build阶段可以有0到多个目标与其绑定。如果一个build阶段没有目标与其绑定,那这个build阶段不会执行。 Maven有一个概念:goal。每个build阶段可能包含一个或多个。 The first, and most common way, is to set the packaging for your project via the equally named POM element <packaging>. Some of the valid packaging values are jar, war, ear and pom. If no packaging value has been specified, it will default to jar. Each

Maven Error assembling WAR: webxml attribute is required when building the SpringMVC project with pure Java Based Configuration and no xml's

做~自己de王妃 提交于 2019-12-03 07:11:59
问题 I am developing a Spring MVC project with pure Java based configuration. I am getting the error below when I do a Maven clean install. Failed to execute goal org.apache.maven.plugins:maven-war-plugin:2.2:war (default-war) on project SpringMVC-ShoppingCart: Error assembling WAR: webxml attribute is required (or pre-existing WEB-INF/web.xml if executing in update mode) -> [Help 1] The error says that web.xml is missing, but I did not have one since I used pure Java based configuration. How to

Maven Assembly Plugin - install the created assembly

烂漫一生 提交于 2019-12-03 05:48:33
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> <!--

How do I suppress maven assembly plugin skipping files that are already added? Or allow overwrite?

陌路散爱 提交于 2019-12-03 04:50:17
For weeks, I've been wrestling with maven, getting it to deploy our project "properly." I'm almost done but I have one stubborn little problem: When I use the maven assembly plugin with the "directory" goal as in mvn assembly:directory I get LOTS of console output like the following: [INFO] tomcat/conf already added, skipping [INFO] tomcat/conf/Catalina already added, skipping [INFO] tomcat/conf/Catalina/localhost already added, skipping [INFO] tomcat/webapps already added, skipping I've written my own assembly descriptor that basically copies several FileSets into various sub-directories

Maven can't compile java 1.8

纵饮孤独 提交于 2019-12-03 01:59:56
I'm trying to use maven to build a jar but I keep getting the error ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:3.1:compile (default-compile) on project Application: Fatal error compiling: invalid target release: 1.8 -> [Help 1] [ERROR] [ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch. [ERROR] Re-run Maven using the -X switch to enable full debug logging. [ERROR] [ERROR] For more information about the errors and possible solutions, please read the following articles: [ERROR] [Help 1] http://cwiki.apache.org/confluence/display

Maven build error - Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.5.5

匿名 (未验证) 提交于 2019-12-03 01:45:01
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: I am trying to build project using Maven. Unfortunately I have no experience with maven so I am a bit helpless. It is most likely caused by the riak submodule. Here is the github repo with code: YCSB My system: Apache Maven 3.2.2 (NON-CANONICAL_2015-04-01T06:56:20_mockbuild; 2015-04-01T08:56:20+02:00) Maven home: /usr/share/maven Java version: 1.8.0_51, vendor: Oracle Corporation Java home: /usr/lib/jvm/java-1.8.0-openjdk-1.8.0.51-4.b16.fc21.x86_64/jre Default locale: en_US, platform encoding: UTF-8 OS name: "linux", version: "4.1.5-100.fc21