4

In Jenkins I use redeploy artifacts to deploy artifacts to mvn repository. It deploys the regular jar file but not the jar-with-dependencies jar. Is this a bug in Jenkins?

Should I modify the pom file to indicate that this jar should also be deployed? What changes should I make in Jenkins?

Cœur
  • 37,241
  • 25
  • 195
  • 267
user1164061
  • 4,222
  • 13
  • 48
  • 74

1 Answers1

0

When you push to maven, it will only put the code for your project in the jar, the pom will tell others what dependencies are needed for the jar to be used. It is up the the user of the jar to get the dependencies that you require.

If you need a fat jar, you should take a peek at the following: Building a fat jar using maven http://orphanware.blogspot.com/2010/09/creating-fat-jar-using-maven.html

Community
  • 1
  • 1
Ethan
  • 6,883
  • 3
  • 33
  • 41
  • fat jar needs to be pushed to maven for use with external systems. In the pom file it is created in the profiles section. Should this be specified in the dependencies section as well? I do not know maven. If you can provide a link to where I can learn to add this fat jar to maven repo along with the light jar it will be helpful – user1164061 May 03 '13 at 23:06
  • I edited the response. Can you generate a fat jar yourself via maven? The link I posted will give you a way to get a fat jar. – Ethan May 04 '13 at 00:30
  • Need some time to check it out. Will let you know.Thanks for the link! – user1164061 May 07 '13 at 20:53
  • Hi, I had a look at the information in the link provided. 1) I do not want to combine the jars. 2) Probably I did not convey my requirement right. Am able to generate the light and fat jar. It is just deploying to my common maven repository which is a problem. Am able to deploy the light jar using 'redeploy artifacts' in jenkins. It is skipping deploying the fat jar. So how do I make it deploy the fat jar as well? Thanks! – user1164061 May 07 '13 at 23:19
  • So you want 2 jars, one with just your project source and one with everything (your source and your deps) and to deploy both to a maven repo, right? If you are using the. You might also want to look at http://maven.apache.org/plugins/maven-assembly-plugin/usage.html – Ethan May 08 '13 at 03:35