Questions tagged [maven-jar-plugin]

This plugin provides the capability to build and sign jars.

The Maven Jar Plugin provides the capability to build and sign jars. This is one of the most common plugins used in Maven.

If the packaging of your project is set to jar, this plugin is executed whenever it passes the package phase, according to default Maven bindings.

Goals Overview

From the official documentation :

  • jar:jar create a jar file for your project sources.
  • jar:test-jar create a jar file for your project test classes.

Check the official usage page for a first look at this plugin.

171 questions
0
votes
1 answer

Build JAR with custom manifest in maven

I am trying to get maven to create the artifact jar with a custom MANIFEST.MF. Sounds like an easy task using the following snippet: maven-jar-plugin
Nitek
  • 2,515
  • 2
  • 23
  • 39
0
votes
0 answers

Include classes in a maven jar package properly

My target directory has main sub-folders and I don't want those sub-folders be included in my package, only their contents (folders and files they consist of). For example, this is my target folder: targetFolder -subfolder1 …
banana
  • 23
  • 7
0
votes
2 answers

how to generate additional jar which having correct and complete manifest file for Bamboo deployment?

Basically, I want to generate a jar file named .jar in addition to default jar file(which in my case is something like + .jar). NOTICE : This .jar is all the same to default jar but the…
Acton
  • 255
  • 4
  • 13
0
votes
1 answer

Running multiple maven profiles from command line

have two profiles to build a dependent jar for a web application (one for tomcat and the other is for websphere). Here what I'm trying is to run those two profiles in one go to build those jars together. mvn help:active-profiles -o…
kallada
  • 1,829
  • 4
  • 33
  • 64
0
votes
2 answers

How to avoid the generation of default jar when specifying a final name?

We are using maven profile to build a jar specific to tomcat. TOMCAT maven-jar-plugin
kallada
  • 1,829
  • 4
  • 33
  • 64
0
votes
1 answer

Maven: generate MANIFEST in custom location

I am trying to retrieve the implementation title and version for a maven jar module. If I use Myclass.class.getPackage().getImplementationVersion() on the built jar, it works, but the same does not work in a debugging environment where the jar is…
Neel
  • 2,100
  • 5
  • 24
  • 47
0
votes
0 answers

Build an executable jar using maven in eclipse

First of all, I am new in maven... I am trying to build a jar executable of my app using maven but without success. My pom.xml configuration file is as below:
Willy
  • 9,848
  • 22
  • 141
  • 284
0
votes
0 answers

Maven project with "war" packaging: how to create JAR with maven-jar-plugin?

I have a Maven project, which builds a WAR (a REST web service running on Tomcat). In pom.xml I have war Some classes are used in another, separate project. I build these classes using the maven-jar-plugin, which is…
simon
  • 12,666
  • 26
  • 78
  • 113
0
votes
2 answers

How to filter some folder/files from maven during project's build?

I have this file from spring at ./META-INF/spring/props.properties that I would like not have it in my built .jar when I ran mvn clean package or mvn deploy. I don't want to provide this file for security purposes. I'm trying to add this on my…
Valter Silva
  • 16,446
  • 52
  • 137
  • 218
0
votes
1 answer

What difference between plugins in profile and without

I use maven-jgit-buildnumber-plugin(github) In one case I define it in profile: make-buildnumber true
burtsevyg
  • 3,851
  • 2
  • 29
  • 44
0
votes
1 answer
0
votes
1 answer

How to add a dependency into a lib directory of a jar using maven?

I have a jar that contains map/reduce code for hadoop. It needs a dependency, which I need to put into the jar's lib directory so that the jar is self contained and can work in hadoop. This is what I did in my pom: 1) add maven-dependency-plugin to…
feroze
  • 7,380
  • 7
  • 40
  • 57
0
votes
1 answer

maven-jarsigner-plugin vs maven-jar-plugin

What is difference between maven-jarsigner-plugin and maven-jar-plugin? http://maven.apache.org/plugins/maven-jar-plugin/ http://maven.apache.org/plugins/maven-jarsigner-plugin/ In android, I use maven-jarsigner-plugin.today seeing another android…
xingjiu
  • 389
  • 3
  • 6
0
votes
1 answer

Maven webapp filtering for JAR

I need to do a Maven filter on a file that is located under my src/main/webapp directory. This seems straightfoward when using the maven-war-plugin: org.apache.maven.plugins maven-war-plugin
Mike
  • 1,791
  • 1
  • 17
  • 23
0
votes
1 answer

Maven test jar including dependencies

My project is divided into several modules, one of them is common which is supposed to be used to other modules. In this module there are TestUtils which I want to be able to use from other modules. My libraries does not seem to be added to the…
J2B
  • 1,703
  • 2
  • 16
  • 31