maven-jar-plugin

maven create zip with jar and some more files

二次信任 提交于 2019-12-07 05:28:19
问题 I do not understand maven. Better use ant, but... I've managed to create jar (with, or without dependencies), I've managed to copy bat runner script close to jar but now i want to create zip with this jar and this bat. So i use assembly plugin and get BUUUM!!!! CADAAAM! In my configuration it happens so, that it executes parallel to jar packaging. I wrote assembly file: <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001

How do I exclude java files from a jar in maven-jar-plugin?

ぐ巨炮叔叔 提交于 2019-12-06 13:07:52
问题 I created a pom.xml to compile my project and package it as a jar, and indeed it comiples and the jar is created - problem is that i got a jar with both classes and java inside, and i only want the classes inside. How do I lose the java files? I don’t need them. this is the pom.xml that i created: <build> <resources> <resource> <directory>src/main/java</directory> <filtering>true</filtering> </resource> </resources> <finalName>api-interfaces</finalName> <plugins> <plugin> <groupId>org.apache

Maven: include files in JAR's META-INF

假如想象 提交于 2019-12-05 16:29:12
I'm using Maven to build a Java project, and I've got a couple files, CHANGELOG and LICENSE , that I'd like to copy to the META-INF directory inside the JAR file. So far what I've got working is the following: <build> <resources> <resource> <directory>${project.basedir}</directory> <includes> <include>CHANGELOG</include> <include>LICENSE</include> </includes> <targetPath>META-INF</targetPath> </resource> </resources> <plugins> ... but that also copies those two files to the classes/META-INF directory when compiling. So I'd like the files to be included in the JAR file, but nowhere else. Is

How to include package.jar with maven-assembly-plugin

蹲街弑〆低调 提交于 2019-12-05 11:33:07
I used maven and maven-jar-plugin and maven-assembly-plugin to build a zip of my project including the projects jar and its dependencies. This is the plugin configuration: <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.5</version> <configuration> <archive> <manifest> <mainClass>MyMainClass</mainClass> <addClasspath>true</addClasspath> <classpathPrefix>lib/</classpathPrefix> </manifest> </archive> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-assembly-plugin</artifactId> <version>2.4<

maven create zip with jar and some more files

被刻印的时光 ゝ 提交于 2019-12-05 08:34:36
I do not understand maven. Better use ant, but... I've managed to create jar (with, or without dependencies), I've managed to copy bat runner script close to jar but now i want to create zip with this jar and this bat. So i use assembly plugin and get BUUUM!!!! CADAAAM! In my configuration it happens so, that it executes parallel to jar packaging. I wrote assembly file: <assembly xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1

How do I exclude java files from a jar in maven-jar-plugin?

纵饮孤独 提交于 2019-12-04 19:56:12
I created a pom.xml to compile my project and package it as a jar, and indeed it comiples and the jar is created - problem is that i got a jar with both classes and java inside, and i only want the classes inside. How do I lose the java files? I don’t need them. this is the pom.xml that i created: <build> <resources> <resource> <directory>src/main/java</directory> <filtering>true</filtering> </resource> </resources> <finalName>api-interfaces</finalName> <plugins> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-jar-plugin</artifactId> <version>2.4</version> <executions>

Change maven dependency for artifact using classifier

岁酱吖の 提交于 2019-12-03 12:48:36
With the maven jar plugin I build two jar: bar-1.0.0.jar and bar-1.0.0-client.jar. Actually in my POM I have the following dependency: <dependency> <groupId>de.app.test</groupId> <artifactId>foo</artifactId> <version>1.0.0</version> </dependency> This artifact exist also in two version bar-1.0.0.jar and bar-1.0.0-client.jar I want to make bar-1.0.0-client.jar dependent of foo-1.0.0-client.jar and bar-1.0.0.jar dependent of foo-1.0.0.jar . ================ ->First (wrong) solution: define the scope as provided and use the right foo package when using bar.jar ->Second (long) solution : Add

m2e error in MavenArchiver.getManifest()

♀尐吖头ヾ 提交于 2019-12-03 00:35:06
问题 I am seeing an error in my STS and am not sure how to debug it. Searching around I only see vague references to the error and no solutions. The error is: org.apache.maven.archiver.MavenArchiver.getManifest(org.apache.maven.project.MavenProject, org.apache.maven.archiver.MavenArchiveConfiguration) pom.xml / <maven projectName> line 1 Maven Configuration Problem Question : Can anyone give any suggestions on how to get more information on the issue in order to debug it further or any possible

multi artifact id in one pom

非 Y 不嫁゛ 提交于 2019-12-02 04:17:25
问题 There is a maven project(jar), but now it needs to be spilt into two artifacts I want to have two maven artifact like following <groupId>xxx</groupId> <artifactId>xxx-client</groupId> <groupId>xxx</groupId> <artifactId>xxx-impl</groupId> But all the code is in one single project. My question would be, How can I package the tow required artifacts without changing the project too much. Then , mvn package deploy will auto deploy these two artifacts into repository Actually I don't want to split

Why is the Maven JAR plugin not including some resources?

痴心易碎 提交于 2019-12-01 16:34:18
I have an enterprise application which I am in the process of converting from an Ant build to Maven. It's almost completely converted; this is the very last thing I need to fix. The application is packaged as an EAR file which contains two WARs and has a JAR module which provides all of the core functionality of the application. I'm using the Freemarker templating library to generate, among other things, message bodies for automatic emails sent by the application. Freemarker needs its *.ftl template files to be on the classpath, and since this is core application functionality not specific to