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
5
votes
1 answer

Java Maven Project appears in another project as directory not a jar

So, I created a Spring Maven Project, a Dao Project, which works great. All the code is in the correct place, all the unit tests run, and I can do a mvn clean install. I can see in the target directory that there is a build jar, and everything in…
tjholmes66
  • 1,850
  • 4
  • 37
  • 73
4
votes
0 answers

Difference between ${scmBranch} and $\{scmBranch} for maven-jar-plugin/ maven-war-plugin

I do use the maven-jar-plugin in my pom.xml. maven-jar-plugin ${buildNumber}
Splioo
  • 370
  • 3
  • 11
4
votes
2 answers

Order of entries in MANIFEST.MF

I am adding entries to the MANIFEST.MF in Maven like maven-jar-plugin true
J Fabian Meier
  • 33,516
  • 10
  • 64
  • 142
4
votes
3 answers

maven-jar-plugin does not include .gitignore file

I try to package an application into a jar file with maven. Somehow all files except .gitignore files are added to the jar. Why is this file skipped and how can I disable this? Even if I try to include it like below the include is ignored and the…
ochs.tobi
  • 3,214
  • 7
  • 31
  • 52
4
votes
1 answer

Execution order of maven-assembly-plugin and maven-jar-plugin

I have a question regarding the execution order of maven-assembly-plugin and maven-jar-plugin. What I am trying to do is to put together an uberjar file for the pf4j framework (plugin framework for java). For this to be able to do I need to first…
4
votes
1 answer

`finalName` parameter not allowed in maven-jar-plugin configuration

We have recently tried to upgrade our maven-jar-plugin from 2.3.2 version to 3.0.2. Since the change we were using the plugin as follows - org.apache.maven.plugins maven-jar-plugin
Naman
  • 27,789
  • 26
  • 218
  • 353
4
votes
1 answer

Create a checksum for all maven artifacts

I'm trying to create an SHA-1 checksum for ALL the artifacts currently in my maven build and write these checksums to a file. Currently I am looking into using the maven-install-plugin which has a built in checksum…
4
votes
3 answers

Build maven jar from classes no java source

I want to build a maven jar artifact from classes. I don't have source files. These classes are originally in another artifact installed locally. I use maven-dependency-plugin to unpack the classes and put them in the target folder for this…
Aravind Datta
  • 327
  • 4
  • 6
  • 17
4
votes
0 answers

Maven-android-jarsigner failed to sign

I am trying to sign a core application and a tests application for that core app. I was getting the error: Failed to execute goal com.jayway.maven.plugins.android.generation2:android-maven-plugin:3.4.1:internal-integration-test…
4
votes
3 answers

maven-jar-plugin Exclusions Failing

We are trying to build two jars from the same pom file (and yes, I have read this Sonotype blog post saying not to) because we need one with all our resources and one without for internal political reasons. We have configured the maven-jar-plugin…
cneff
  • 388
  • 6
  • 15
4
votes
3 answers

Unable to disable generation of empty JAR (maven-jar-plugin)

Sometimes, my Talend Open Studio components have resources but not Java sources (they are purely metadata components). I need to disable the generation of JAR files in such a case. I configured the maven-jar-plugin this way:
Gabriele B
  • 2,665
  • 1
  • 25
  • 40
3
votes
1 answer

How do I build only one JAR file with classifier?

I'm using Maven 2 and maven-jar-plugin to build my jar. I'd like to generate only a jar with a classifier. Is it possible? In my example I'd like to generate only the myjar-another-1.0.jar but not myjar-1.0.jar. After take a look at this question I…
ssedano
  • 8,322
  • 9
  • 60
  • 98
3
votes
2 answers

Asciidoctor maven plugin is generating index.html with no read permissions

Im creating an index.htm file with the asciidoctor-maven-plugin:2.2.2 and I get a build error, because the created file has no read permissions. mvn clean install mvn clean install works on other machines. I am on a M1 Macbook Pro. I have tried…
Glup3
  • 144
  • 5
3
votes
0 answers

Maven test jar and Java 11 modules

How can we create a Maven test jar with Java 11 modules? The only way I found is to add a module-info.java file to test/java and change the module name (e.g. append ".test"). Then provide the class in a separate package (e.g. append ".test") and…
Puce
  • 37,247
  • 13
  • 80
  • 152
3
votes
2 answers

Java/Maven - Could not find or load main class

I've looked at the other stackoverflow questions regarding this issue and those questions and answers relate to the improper main class setting in the pom.xml. I've written the main class to have the correct package name and proper case sensitivity…
j will
  • 3,747
  • 11
  • 41
  • 64
1 2
3
11 12