while building artifacts with apache maven, it wont build manifest file in JAR anymore (compiler Intellij). Why? - maven

I'm trying to build a jar file with maven with a manifest file, but it won't work. When I build the artifacts from older projects it works, but now it won't. when I build artifacts from old projects, the jars do have manifest files automatically but new ones don't. can you tell me why?new projects with incomplete jar

Related

Update Maven Dependencies Jars

I am new to Maven and have a quick question. I am using the JBoss IDE and have my Maven project set up. I have several jar files in my Maven Dependencies build path that need to be updated to a newer version. I have tried adding the external jars manually, but they do not go within the Maven Dependencies library and the outdated jar remains within that library.
What is the best way to update the jars with the Maven Dependencies library?

How to stop maven deploying test jar files

Maven has a useful facility to create jar files for tests that can be depended on by other projects. We use the "easy way" from this page. This all works fine, and produces files of the name foo-1.0.0-tests.jar.
By default, these test jar files are installed and deployed. The question is how to have them be installed, but NOT deployed?
(There is no need or desire to publish these files to maven central, but they are needed when running tests locally. Thus install is correct, and deploy is not.)
The maven deploy plugin appears to have has no suitable options. The build-helper-plugin has the ability to attach file to deploy, but not to remove them.
Any suggestions to get these jar files installed, but not deployed?

How do I build an exploded WAR in a multi-module Maven project and also include sibling JAR files in its WEB-INF/lib directory?

I’m using Maven 3.3.3 with the Maven WAR 2.6 plugin. I have a multi module project with both JAR and WAR projects within it. My WAR projects depend on my JAR projects, however, I do not want to package my WAR files, opting instead to keep them in an exploded form. So I tried running this command
/usr/local/apache-maven-3.3.3/bin/mvn -B -f /home/jboss/.jenkins/jobs/subco/workspace/pom.xml -B clean prepare-package war:exploded -DskipTests -T 3
Although this keeps my WAR exploded, the JAR projects do not get included in my web application’s target/myproject/WEB-INF/lib directory. Instead what is included are empty directories where my JAR files would have been, for instance
.jenkins/jobs/subco/workspace/myproject/target/myproject/WEB-INF/lib/child-jar-module-2.0.0-SNAPSHOT.jar/
How can I keep an exploded WAR, include my JAR files, and do it all from the command line (as opposed to creating a custom profile in my parent pom to do it for me)?
Edit: If you think this is a duplicate of another one, notice the part of my question where i point out that empty directories are generated when using the "prepare-package" phase. I don't want that.

How to build project WAR file and it's dependencies in TAR/ZIP file

I am new to Maven and know the basic concepts of Maven. I got a requirment to work on mavenizing multiple projects which uses most of common/same jars.
I was asked to build a TAR/ZIP file that contains all the jars and build WAR file for each project with out jars. So that Project (WAR) can use jars present in TAR/ZIP file.
finally after build, TAR/ZIP file needs to be deployed on server forst and later WAR file. so that, in run time WAR can have refrence to jars.
Can anyone please help me in this ?
Actually this structure will reduce size of WAR files as we are keeping these jars in single TAR/ZIP file and deploying it in tomcat server.

How to download with Maven a project jar and its dependencies without checking out the sources

In one Java project, I have configured its POM so maven will generate in the target folder:
the binaries jar.
the sources jar.
the javadocs jar.
the tests jar.
In addition, I configured the POM so Maven downloads all the project dependencies in the target/lib folder.
The project is also uploaded to the Sonatype snapshots repository.
My question is: Is it possible for a user of my library to download all the artefacts mentioned above with one single instruction, without having to checkout the sources of my project first ?
I found in a question from some years ago that just distributing the POM is not enough to download a project and its dependencies.
But I have not lost hope that this could be possible to accomplish in one single step.
When you say "all of the artifacts mentioned above", do you mean:
the binaries jar.
the sources jar.
the javadocs jar.
the tests jar.
or do you mean:
all the project dependencies
Assuming the latter, then have your user do the following:
create a dummy pom.xml file
declare your library as a dependency
use maven-dependency-plugin:copy-dependencies to copy jars into desired location
Hope that helps.

Resources