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
10
votes
4 answers

How do you create a standalone application with dependencies intact using Maven?

I have a desktop Java application built using Maven 2 (but I could upgrade to Maven 3 if that helps) with a number of open source dependencies. I'm now trying to package it up as a standalone to make it available to end users without them needing to…
Paul Taylor
  • 13,411
  • 42
  • 184
  • 351
9
votes
1 answer

Change maven dependency for artifact using classifier

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: de.app.test foo
9
votes
1 answer

extended maven plugin ignores configuration

i did a maven plugin that overwrites "maven-jar-plugin" following this doc: How do I create a new packaging type for Maven? you can find my plugin here: http://mvnrepository.com/artifact/org.lucee/lco-plugin/1.0 the source is…
9
votes
2 answers

Maven archiver uses unlocked snapshots in classpath, but copy-dependencies copy locked snapshots

I am trying to use the maven-jar-plugin and maven-dependency-plugin to create an runnable "bundle" of my application. It works fine in most cases, but when I have a snapshot in the dependency hierarchy, the copy-dependencies goals seems to translate…
8
votes
3 answers

maven create zip with jar and some more files

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…
madhead
  • 31,729
  • 16
  • 153
  • 201
8
votes
1 answer

New entries of webstart-maven-plugin breaks the application

As my JDK version upgraded to u45 now I get warnings about missing security information. So I used following security updates as part of webstart signing using webstart-maven-plugin
7
votes
2 answers

download of a Maven artifact with dependencies from Nexus using the command line

I'm using the command below to download a maven jar from Nexus through the command line. call mvn org.apache.maven.plugins:maven-dependency-plugin:2.4:get -DrepoUrl=http://10.101.15.190:8081/nexus/content/repositories/releases/…
AnOldSoul
  • 4,017
  • 12
  • 57
  • 118
7
votes
1 answer

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

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: org.apache.maven.plugins
t777
  • 3,099
  • 8
  • 35
  • 53
6
votes
1 answer

Can I change the timestamp of a snapshot to the build number?

We've been seeing a bug recently where Maven tries to retrieve a SNAPSHOT that doesn't exist. As you can see the build number (whatever that is, because it's not our build number) matches, but the timestamp doesn't, causing the build to fail. This…
Alex
  • 2,953
  • 1
  • 27
  • 37
6
votes
2 answers

are there any examples of how to use maven-jar-plugin?

I am very new to Maven and would like to see an example of how one uses the maven jar plugin. I already visited here but did not find any examples. On the documentation page, there were some parameters listed for this goal but what I was looking for…
John
  • 877
  • 4
  • 11
  • 19
6
votes
3 answers

Getting maven to execute a program and store the output into a property that can be used in a .jar manifest

I would like to execute git describe as part of a maven build and use the resulting output in the manifest for building a .jar package. I know how to do this in ant via the task with outputproperty to an ant property variable, but I have very…
Jason S
  • 184,598
  • 164
  • 608
  • 970
6
votes
2 answers

Eclipse Luna maven-jar-plugin execution not covered by lifecycle

I have a maven java project (deploying to jboss, if that matters) that uses the maven-jar-plugin. This works fine using Eclipse Kepler. I'm now trying Luna (EE edition), and I'm now getting this error Plugin execution not covered by lifecycle…
marinier
  • 387
  • 3
  • 13
6
votes
0 answers

maven release:prepare skips test-jar

I`m using maven ver. 3 with following plugin to generate separated *.jar file with tests. org.apache.maven.plugins maven-jar-plugin 2.4
martin
  • 101
  • 2
  • 8
5
votes
1 answer

Create tests jar with all the Karate dependencies

I have the following project structure. src/test/java There is no src/main folder. Above src/test/java folder contains some scala classes as well as some java classes. When i build the jar file using following plugins maven-jar-plugin : it…
5
votes
1 answer

maven-javadoc-plugin overwrites central repository

I have a problem with the Maven Javadoc Plugin and a custom doclet. I'm using the maven-javadoc-plugin v2.10.1 and a custom doclet which is basicly a maven jar project. I have also a settings.xml which defines the central repository to a custom…
1
2
3
11 12