Primefaces maven how to build snapshot version? - maven

Do I need to change the version in pom.xml? For example,
11.0.0.snapshot20220708
Is there command line options for building a snapshot version?

Yes I do this everyday with 12.0.0-SNAPSHOT in the pom.xml run this maven command.
mvn clean install but it must be -SNAPSHOT

Related

Maven tool of Java, how to using mvn uninstall package?

Java, mvn tool, how to using mvn uninstall package? Have some plugin, tool, shell script and command method?
If you want to uninstall/remove any artifact downloaded by maven just go to your ~/.m2/repository directory, where all installed artifacts are stored and delete that one which you want to get rid of.
All you have to do is remove the dependency from your pom.xml, maven should take care of the rest.
I really struggled with this because I had an upstream dependency that included the dependency I was trying to remove, so even mvn dependency:purge-local-repository didn't help - in that case, it might be worth trying to configure dependency exclusions (also in the pom.xml file).

Can't determine why maven is downloading a jar file

I am having an issue with log4j-api. I have specified log4j-api:2.8.1 in my pom but when running a mvn clean install command, mvn keeps insisting that I need log4j-api:2.1. If i delete the log4j-api:2.1 directory from my .m2/repository and do the mvn clean install command, it will say it is downloading the 2.1 version.
Here's the weird thing: If I do a mvn dependency:tree there is no mention of version 2.1, only 2.8.1.
Anybody understand why mvn dependency:tree would say my project is NOT dependent on version 2.1 but then downloads the 2.1 version when I run mvn clean install?
Some other versions we are using in case somebody knows that something could be causing this:
Spring Boot 1.2.1
Spring Framework 4.1.6
Elastic Java APIs 5.6.4
Get the dependency tree in verbose mode
mvn dependency:tree -Dverbose
From maven docs
More specifically, in verbose mode the dependency tree shows dependencies that were omitted for: being a duplicate of another; conflicting with another's version and/or scope; and introducing a cycle into the dependency tree.

Base command line for builds in Maven

I am using apache maven version 3.5.0 in Eclipse. I have problem with this error - "org.apache.maven.plugins:maven-eclipse-plugin:2.10:eclipse". I guess it makes by wrong command in Preferences->Anypoint Studio->Maven->Base command line for builds. Now, I have command - "mvn eclipse:clean eclipse:eclipse -Dwtpversion=2.0".
The maven-eclipse-plugin is deprecated and should not be used. Actually, it can destroy your project.
Newer Eclipse versions (like Mars, Neon, Oxygen) have m2e included, which does all the Maven-Eclipse magic for you.

What is the difference between "mvn clean install" & "mvn eclipse:clean eclipse:eclipse" command?

I have a maven project in eclipse. I use mvn clean install for installing dependencies in pom.xml.
I want to know what mvn eclipse:clean eclipse:eclipse command does and also the difference between these two?
mvn eclipse:clean eclipse:eclipse
The second command is completely different from the first one.
First, it deletes previously generated Eclipse files (like .project and .classpath and .settings) and then generates new ones, thus, effectively updating them. It may be useful if you introduced some changes in pom.xml (like new dependencies or plugins) and want Eclipse to be aware of them.
mvn clean install
The first command deletes target directory and then builds all you code and installs artifacts into local repository.

How to deploy own files from maven

I am installing and running sakai project from command prompt
mvn install sakai:deploy
but command prompt show me error that 2 artifact missing that is 2 jar files are missing dwnload it manually
i am dwnload it and save it in local system then how i can install and deploy it
When you build Sakai it will generate that missing jar file and place it into the local maven repo. That said, this version of Sakai is very old and you should be running Sakai 10. We suggest you upgrade to Sakai 10 and maven 3. If you do, this issue will go away.
The process for building Sakai is as follows:
Open a command line shell
Change directory to your Sakai source root directory (should contain many directories including the "master" directory)
Execute mvn clean install to build the Sakai source using maven
Note: The build will take an extra 5-10 minutes to download dependencies the first time
Execute mvn sakai:deploy to deploy Sakai to your tomcat using maven
Partial builds are supported by the maven2/3 build system
You can do a "mvn clean install sakai:deploy" from any subdirectory and build just that code
Once you have downloaded the jars you can run maven off-line with mvn -o clean install sakai:deploy
As i can understand you have to manually add the jar in .m2 repository where it needs to be or
add dependency in pom.xml for it(it will automatically add it in repository).
One more thing you can try, go to project>right click>build path> add external jar (it will add the jar to your project).

Resources