Not able to upload jar using mvn:deploy command - maven

I have one jar that I want to upload into mvn artifact using mvn:deploy command.
after executing command, it is creating new jar and bundled the jar which I want to upload in artifact inside it.

Related

Upload multiple jar files to maven repository (e.g. Archiva)

In one of our project we are planning to generate multiple jar files (basically libraries, which contain no dependencies) .
We would like to upload these jar files to local maven repository (Archiva looks good, we are also open to other options) so other developers can simply use them.
(Single jar file deploy works great)
PS: We are using maven.
Thanks in advance.
When you build your jar files with Maven, you simply call mvn deploy (having a correct settings.xml) and the jar goes into your Maven repository.
If you have jars not built with Maven, you can use mvn deploy:deploy-file to upload them.

Springboot - Executing Fat Jar

I have a springboot application which creates a JAR artifact using maven build. I understand that we can execute this jar from command line by going into target folder and executing appropriate command but what I want to know that how can I export this jar to a different machine(Unix Box) and execute the jar?

Customize build and release role in maven

I have a Non-Java Maven project. By default the deploy goal generates a JAR file, however I would like to generate a zip file instead that should be published to nexus at a later phase.
If I create the zip file manually and place it in the target folder, Maven is not publishing it to nexus, it only publishes the JAR file automatically created.
So my question is: Is there any way to upload to nexus all the content of the target folder? If not, how do I tell Maven not to create a jar file and create a custom zip instead?
Maven has the deploy:deploy-file goal which can be configured in your pom.xml It can be used to upload arbitrary files, including zips.
You can avoid the creation of a jar if you change <packaging> to pom.

Change the artifact name while uploading to Maven Repository through command line

I am new to Maven and looking out for ways to upload many 'XML'(not jars) files to a Maven Repository.
I came across the 'mvn deploy' command which allows me to successfully upload the files to a Maven Nexus Repository.
I am using below command to upload single file successfully. So my XML gets uploaded with name com/xxx/test/test/0.1/test-0.1.xml.
call mvn deploy:deploy-file -DgroupId=com.xxx.test -DartifactId=test -Dversion=0.1 -DgeneratePom=false -DrepositoryId=kepler-releases -Durl=http://example.com:8081/repository/xxx-release -Dfile=xxx/abc.xml
Is there a way that I can upload multiple xml files under this same group 'com.xxx.test' with their existing file names (like abc.xml in this case)?
I saw there is some option -finalName but couldnt find many examples around its use. Any help with this would be appreciated.
Thanks.

I want to include a jar file in my build using maven

The problem is like this
I have a maven build of my project already. But I have a requirement wherein I need to replace a .jar file located in WEB-INF/lib folder with another .jar file. This new jar file can be downloaded from a link.
What changes do I have to make in the pom.xml file to achieve this requirement. I tried to find out ways to do it but could not figure out the exact solution as I am a novice in Maven.
Assuming that the jar file is not found in any public maven repository you can install it in your local repository using the install plugin mvn install:install-file ... and refer it as any other dependency

Resources