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

How to deploy jar file to JBoss EAP comes along with dependencies by maven

I'm struggling with deploying a jar file to JBoss EAP 6. My app depends on some dependencies. I tried to do some hacks such as using maven-jar-plugin, maven-assembly-plugin but neither work. By the way, I tried to make the jar file has the…
Esca Tran
  • 129
  • 1
  • 3
  • 14
0
votes
0 answers

How to merge two jar files with same name but with different version in a project?

I'm using two jar files like httpclient-4.2.3.jar and httpcore-4.2.jar but now I want to use another two files with same name but different version httpclient-4.3.4.jar and httpcore-4.3.jar. How can I use all four files in a same project? Please…
atul
  • 1
0
votes
1 answer

war conflict in maven

mybatis-generator-maven-plugin has dependencies of sisu-guava(maven-plugin-api) and google-collect(plexus-container-default). Both of them has com.google.common.collect.Ordering class, but the one in google-collect does not have the "reverse"…
dustdn
  • 418
  • 2
  • 6
  • 18
0
votes
0 answers

Exception throws when calling jar

I have a class and I use String signingAlgorithm = SigningAlgorithm.HmacSHA256.toString(); there. class works fine when I running unit test or main method. But it gives this exception Exception in thread "main" java.lang.NoClassDefFoundError:…
Darshana
  • 2,462
  • 6
  • 28
  • 54
0
votes
1 answer

Super POM Manifest Entries not being used

We have a corporate wide super-pom that we use. It sets up all of the mvn site reports, making sure that all of the users are using Findbugs, PMD, etc. One of the things we want to do is add entered to our MANIFEST.MF file. The entries help us pin…
David W.
  • 105,218
  • 39
  • 216
  • 337
0
votes
1 answer

Attaching only a contents of the folder to the jar

I am using maven-jar-plugin to generate a sources jar. I have the following folder structure: folder/foo/baz/A.java folder/bar/baz/B.java I want the sources jar to contain the following: baz/A.java baz/B.java I am using the following…
WonderCsabo
  • 11,947
  • 13
  • 63
  • 105
0
votes
1 answer

Java not able to find dependencies while executing executable jar generated with maven-jar-pluin configured with exact classpath arguments

The following is the directory structure of my java application: application.jar dependency-jars a.jar b.jar c.jar The application executes fine when I use the following command: java -cp "application.jar;dependency-jars/*"…
Anand Patel
  • 6,031
  • 11
  • 48
  • 67
0
votes
1 answer

Java 1.4 used with maven jar plugin?

In some of my maven modules (example myChild) I use maven-jar-plugin to create some additional jar, named here my-plugin.jar. This my-plugin.jar should be only the part of the entire module - myChild.jar.
LancerX
  • 1,211
  • 7
  • 23
  • 40
0
votes
1 answer

Library to create and upload jar dynamically to maven repository

I have service based environment in which I have to create a jar and upload it dynamically to maven repository and return the dependency tree for it. Is there any library which will create a jar file and upload that jar file to maven repository and…
pbhle
  • 2,856
  • 13
  • 33
  • 40
0
votes
1 answer

Export test jar with maven one jar plugin

I've used maven-one-jar plugin , exported runnable jars and used them. Can I export a test-one-jar containing the junit test classes along with the other dependencies using this plugin? What changes should I make in the pom(.xml) configuration?
0
votes
0 answers

Maven: How to make SNAPSHOT artifacts identical even if built at different times?

We use SNAPSHOTs a lot and rebuild frequently, and have found that even if the source was unchanged the resulting artifact was not binary identical to the artifact built last time. I would like them to be. To my understanding from a SO post I cannot…
Thorbjørn Ravn Andersen
  • 73,784
  • 33
  • 194
  • 347
0
votes
1 answer

Maven exporting pom.xml with jar plugin

I am adding attribute in the jar plugin to specify the location of jar file. But at that location maven is not exporting pom.xml file which is used in generating the jar. Can you please tell me how to export the pom.xml too in the same location…
Manu
  • 453
  • 2
  • 6
  • 15
0
votes
2 answers

maven-jar-plugin, include upper dir

Build part of POM maven-jar-plugin 2.2 ./
Ilya
  • 29,135
  • 19
  • 110
  • 158
0
votes
1 answer

NPE in maven-jar-plugin

Error that occurs during Maven build: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.4:jar (default-jar) on project cc-distFS: Error assembling JAR: Failed to read filesystem attributes for:…
Vladislav Bauer
  • 952
  • 8
  • 19
0
votes
1 answer

Including the Jar of a Maven Project in another Maven Project does not work but including the Project in another Maven Project works

I have 2 Projects namely Project_1 and Project_2. Both projects are Maven and I am using Netbeans. I want to include the jar of Project_1 in Project_2 which I am doing like this. The problem is when I include the jar I do not get any compile time…
JHS
  • 7,761
  • 2
  • 29
  • 53
1 2 3
11
12