maven-assembly-plugin

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

佐手、 提交于 2019-12-02 20:48:28
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 make sure that the project builds and creates war file without web.xml ? Tunaki This error happens

Getting started with Maven assembly plugin with multi-module project

一世执手 提交于 2019-12-02 07:33:26
We had a guy working with us who used the maven-assembly-plugin to package all dependencies. He has since left the company and I'm trying to figure out how he did this. I am just now learning about the maven-assembly-plugin. Our applications are split into a Maven POM project with associated module projects. In the following example, I've included the runtime module project. I tried to create a module project called runtime in my application, but the minute I make any changes it loses the association with the parent project. We are using Netbeans. +- pom.xml +- Simulator +- pom.xml +- comms +-

Creating Two Executable Jars Using maven-assembly-plugin

旧城冷巷雨未停 提交于 2019-12-02 03:29:42
I have a Maven project and I want to create two executable jar files from it. One will be used interactively by users and a second will be run as a scheduled job that reads the log files produced by the former. In the end, I would expect the two jar files to be identical except for the Main-Class attribute in the MANIFEST.MF file. I am using maven-antrun-plugin to create an executable jar and this seemed to be working fine until I tried to create a second jar file by introducing Maven profiles. The relevant section of my POM file looks like this: <profiles> <profile> <id>publisher</id> <build>

How to create maven uber jar which includes dependencies with scope provided

梦想的初衷 提交于 2019-12-02 00:30:43
<plugin> <artifactId>maven-assembly-plugin</artifactId> <executions> <execution> <phase>package</phase> <goals> <goal>single</goal> </goals> </execution> </executions> <configuration> <archive> <manifest> <mainClass>com.XXXX.XXXXOfflineApp</mainClass> </manifest> </archive> <descriptorRefs> <descriptorRef>jar-with-dependencies</descriptorRef> </descriptorRefs> </configuration> </plugin> </plugins> I have the above code piece to create an jar with dependencies, but in my pom i also have some dependencies with scope provided but these are not included in the uber jar, Well I cannot change the

Maven assembly plugin not applying fileMode on unpacked dependencySet

假装没事ソ 提交于 2019-12-01 18:03:46
I have been banging my head against the wall all afternoon with this one. I need to create a pair of assemblies ( zip and tgz ) and need to set the correct executable permissions for shell scripts included in the archive. It doesn't seem to make any difference what I do, the fileMode settings seem to have no effect. Here is a snippet from my assembly descriptor: <dependencySet> <useProjectArtifact>false</useProjectArtifact> <useStrictFiltering>true</useStrictFiltering> <outputDirectory></outputDirectory> <unpack>true</unpack> <fileMode>0755</fileMode> <unpackOptions> <lineEnding>keep<

Maven Error reading assemblies: No assembly descriptors found

為{幸葍}努か 提交于 2019-12-01 17:49:47
问题 Following this Guide I ran the command mvn assembly:assembly and got the Build Failure of Error reading assemblies: No assembly descriptors found. I've looked at numerous questions on this, but to no avail. From this post, I created a .xml with this inside: <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http:/

Exclude files with maven assembly does not work

余生长醉 提交于 2019-12-01 14:48:21
问题 I have very simple assembly descriptor <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd"> <id>dist</id> <formats> <format>jar</format> </formats> <!-- copied from jar-with-dependencies --> <includeBaseDirectory>false</includeBaseDirectory> <dependencySets>

使用maven-assembly-plugin将第三方依赖jar包 打包入jar

旧城冷巷雨未停 提交于 2019-12-01 14:16:48
一、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. ( maven-assembly-plugin 主页 ) 目前它只有一个有意义的goal , 详细的请看( http://maven.apache.org/plugins/maven-assembly-plugin/plugin-info.html ): Goal Description: assembly:single Assemble an application bundle or distribution from an assembly descriptor. This goal is suitable either for binding to the lifecycle or calling directly from the command line (provided all required

Merging META-INF/services files with Maven Assembly plugin

南笙酒味 提交于 2019-12-01 12:53:59
I am looking for a way to merge META-INF/services files, e.g. META-INF/services/javax.ws.rs.ext.Providers , when building jar-with-dependencies using Maven Assembly plugin. I have found answers showing how to do that using Maven Shade plugin. Unfortunately, we are extensively using Mave Assembly plugin already and it is unclear how we could plug Maven Shade plugin...in. It turns out that some versions of Maven Assembly plugin can merge these files: <assembly xmlns="http://maven.apache.org/ASSEMBLY/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven

How to create Jar from submodules of module?

亡梦爱人 提交于 2019-12-01 11:44:57
问题 I have this java maven project structure - parentModule - firstChildModule - firstChildModule - firstChildModule - secondChildModule -> **jar** - thirdChildModule - thirdChildModule - thirdChildModule And I want to package the secondChildModule module as a jar containing its submodules. I have tried to set the packaging type to pom but an exception is thrown stating that 'packaging' with value 'jar' is invalid. So my question is how to do this the right way? I mention that only the