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

Maven: remove "-version-SNAPSHOT" suffix from downloaded dependencies

I'm using in build section of maven to rename my-artifact--SNAPSHOT.jar to my-artifact.jar, I see that the resulting artifact is renamed as expected in my target folder but when the same artifact is specified as a…
0
votes
1 answer

Missing classes after adding custom dependency to spring project

In order to avoid code duplication, I decided to pack some classes in the spring based library project. Below are the steps I took: Created project using spring initialzr. Created desired structure and add classes. Deleted main class Added to…
kamil
  • 39
  • 1
  • 6
0
votes
1 answer

How to list dependencies with their relative path in class path of Manifest file of generated jar file using maven jar plugin?

I am working on java project with Maven and Maven-jar-plugin I have generated a classpath of dependencies for my jar file in MANIFEST.MF using maven jar plugin. here is my plugin usage:
0
votes
1 answer

How to let bazel recursively download dependencies by maven_jar in java

I am new to Bazel and would like to implement a Google Cloud Datastore client in Java. I tried to add the google-cloud-datastore jar as a dependency in my Bazel project. I added the maven_jar workspace rule in my WORKSPACE file as follows:…
0
votes
2 answers

Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.1.2:jar (default-jar)

maven-jar-plugin fails with following error: Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:3.1.2:jar (default-jar) on project myProject: You have to use a classifier to attach supplemental artifacts to the project instead of…
Maria Dorohin
  • 355
  • 4
  • 17
0
votes
0 answers

Add Property File from Another Jar (Maven)

I am trying to do a maven build (lets say A.jar), where the property file resides in one of the dependencies (lets say, B.jar) that I am adding. Is there any way to add the properties from B.jar to A.jar or to read them in some way from B.jar? I…
hell_storm2004
  • 1,401
  • 2
  • 33
  • 66
0
votes
0 answers

How does Maven orders the dependency jars on the classpath when using Maven-Jar-plugin with "addClasspath" property true?

I am trying to understand the way maven orders all the dependency defined in the pom, while we are trying to create a jar using maven-jar-plugin. I am trying to use manual configuration approach defined here. Let's say we have following dependency…
0
votes
1 answer

Manifest classpath filter in maven-jar-plugin

Can I exclude some artifacts from classpath that generates by true option? For example, I have some dependencies: com.group1 lib11
DaddyRatel
  • 729
  • 3
  • 13
  • 30
0
votes
0 answers

Not able to add resources using Maven jar plugin

I have a src folder out of which i need to create multiple jars. Like each package as a separate jar. Also i need to put specific xml files from src folder into specific jars. I created a pom which creates multiple jars successfully using multiple…
harimper
  • 1
  • 2
0
votes
1 answer

maven-jar-plugin with maven-source-plugin not working

I'm using maven-jar-plugin to create JAR with my test class as below: org.apache.maven.plugins maven-jar-plugin ${maven-jar-plugin.version}
0
votes
1 answer

Unable to build the jar with maven-jar-plugin

I am using maven-compiler-plugin 3.1 When I try to do 'Run As---> Maven install', I am getting the following error : Failed to execute goal org.apache.maven.plugins:maven-jar-plugin:2.3.2:jar (default-jar) on project test-tom: Error assembling JAR:…
Sunit Bana
  • 13
  • 4
0
votes
1 answer

Maven package jar multi-module project

I have multi module project. I want to make an executable jar from one of this modules. root pom is ru.netCracker root 1.1.0
Gordeev Pavel
  • 25
  • 2
  • 8
0
votes
0 answers

Creating JAR Files with Maven: How to change the target directory for class files?

When creating a JAR file using Maven, the class files (or rather the package structure) are placed directly in the root of the JAR file. How can I configure Maven (or the maven-jar-plugin) to copy the classes to a "classes" directory instead? For…
jhead
  • 11
  • 2
0
votes
1 answer

Java getClass().getClassLoader().getResource(path) fails inside Maven shaded .jar

When running my project directly with java, I can confirm that a particular method is able to fetch a resource via getClass().getClassLoader().getResource(path), where path is docs/info.md and there exists a file at…
Charney Kaye
  • 3,667
  • 6
  • 41
  • 54
0
votes
0 answers

standalone application classpath entry using maven

We are using maven for our standalone applications.currently we have two standalone application for new project and going forward it would increase. So I've deployment approach for all standalone application with dependency jars. All application…