Custom maven archetype:generate defaults to version 3.1.1 instead of 3.1.2? - maven

I have build a custom maven archetype in my local. However while generating a project it always looks for the maven archetype:generate version 3.1.1 instead of 3.1.2. I have multiple modules in my project with profiles to avoid the bug associated in 3.1.1 using the upgraded version 3.1.2.
Here is the error.
C:\Repo>mvn archetype:generate -DarchetypeCatalog=local -DarchetypeGroupId=com.lamo.archtypes -DarchetypeArtifactId=microservice-component-server -DarchetypeVersion=0-SNAPSHOT -
DgroupId=com.organisation.platform.product -Dpackage=com.organisation.platform.product.pd -DartifactId=product-server -Dcomponent-short-name=pd -Dcomponent-long-name=product
[INFO] Scanning for projects...
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/3.1.1/maven-archetype-plugin-3.1.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/3.1.0/maven-archetype-plugin-3.1.0.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/3.0.1/maven-archetype-plugin-3.0.1.pom
Downloading from central: https://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-archetype-plugin/3.0.0/maven-archetype-plugin-3.0.0.pom
Here is the public repository link to my custom archetype https://github.com/lagnajit712/microservice-component-server

If you want a specific version of the maven archetype plugin, just specify it. Use
mvn org.apache.maven.plugins:maven-archetype-plugin:3.1.2:generate -DarchetypeCatalog...

Related

log4j 1.2.12 dependency showing in compile logs but not in mvn dependency tree

I am trying to compile the product and it downloads log4j 1.2.12 version.
When I try to see how is it added using mvn dependency:tree, it does not show up.
In the compilation logs, it says below:
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # jobcontroller-worker-api ---
Downloading from central: https://repo.maven.apache.org/maven2/log4j/log4j/1.2.12/log4j-1.2.12.jar
Downloaded from central: https://repo.maven.apache.org/maven2/log4j/log4j/1.2.12/log4j-1.2.12.jar (358 kB at 1.6 MB/s)
Any idea how to know who is downloading this jar and how to change it to use 2.x version of logs.
Thanks,
Swaraj

Maven download Artifact form Nexus is endless

I have strange behavior with maven. During my build, the download of the json-smart metadata component (the only artifact that seems to be affected by this problem) loops without ever stopping.
[INFO] Scanning for projects...
[INFO]
[INFO] ----------------< fr.project:myProject >----------------
[INFO] Building Ned MyProject 1.8.2
[INFO] --------------------------------[ jar ]---------------------------------
Downloading from nexus: http://mynexus/repository/maven-public/net/minidev/json-smart/maven-metadata.xml
If I pour central maven repo directly it's OK but if I use our Nexus, the problem is still there.
I check certificat, they are OK I check nexus log, there is nothing
about this download Maven Log in debug show nothing elses (just this
final command)
I have use -U and udpatePolicy command in maven setting but nothing (When maven says "resolution will not be reattempted until the update interval of MyRepo has elapsed", where is that interval specified?)
I have clean all json-smart artifact form maven-central repo of our
nexus and task a clean metadata but nothing(Remove artifacts from Nexus repository and how to force sonatype nexus 3 to recreate maven-metadata.xml for maven repository?)
I have no other ideas, has anyone as one ?
Apache Maven 3.6.3
Java version: 11.0.3, vendor: Oracle Corporation
Nexus : 3.6.0-02
We found the solution but no explication on the real problem.
metadata of our json-smart artefact were corrupted on our Nexus and block download from maven. I have delete all composant, invalidate cache of the repository and rebuilt the index and it's seem resolve the problem.

Nexus OSS 3 - UI not showing proxied components

I've installed a fresh new Nexus Repository OSS 3.3.2-02. It has a maven-central repository pre-configured. Without changing anything I just grabbed URL for accessing this proxy repository and added it to my local M2 settings.
When I try building some project, my dependencies are correctly fetched and project built. Here is a look of maven client logs:
[INFO] ------------------------------------------------------------------------
[INFO] Building jiraBootcamp 1.0.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[WARNING] The POM for com.atlassian.jira:jira-api:jar:7.2.2 is missing, no dependency information available
[WARNING] The POM for com.atlassian.plugin:atlassian-spring-scanner-annotation:jar:2.1.1 is missing, no dependency information available
[WARNING] The POM for com.atlassian.activeobjects:activeobjects-plugin:jar:1.2.3 is missing, no dependency information available
[WARNING] The POM for com.atlassian.plugins.rest:atlassian-rest-common:jar:1.0.2 is missing, no dependency information available
[WARNING] The POM for com.atlassian.sal:sal-api:jar:2.6.0 is missing, no dependency information available
Downloading: https://devtools.morosystems.cz/nexus/repository/maven-central/org/projectlombok/lombok/1.16.4/lombok-1.16.4.pom
Downloading: http://repo.maven.apache.org/maven2/org/projectlombok/lombok/1.16.4/lombok-1.16.4.pom
Downloaded: http://repo.maven.apache.org/maven2/org/projectlombok/lombok/1.16.4/lombok-1.16.4.pom (2 KB at 10.5 KB/sec)
The problem is that when I browse Nexus UI I would expect Lombok library to be:
present in Components/Assets view,
searchable.
However, this is not working as the views are empty and search finds nothing.
Please, can you help me find what is wrong? It is the first time I configure Nexus OSS 3 so solution may be very simple.
Thank you very much!
Your maven log shows that the component wasn't downloaded from Nexus:
Downloading: http://repo.maven.apache.org/maven2/org/projectlombok/lombok/1.16.4/lombok-1.16.4.pom
Set up Nexus as a mirror of all repositories in Maven as outlined here:
http://books.sonatype.com/nexus-book/reference3/maven.html#maven-sect-single-group
That will prevent Maven from accessing repositories other than Nexus.

Building mavenized MuleStudio project

I have a mavenized Mule project in MuleStudio. When I try to package using maven it starts downloading some EE jar files from http://dev.ee.mulesource.com/repository/...
I have no EE dependencies in my POM.xml.
Why is maven trying to download these dependencies?
Maven is just pulling pom files only (and not related jar files). Why ?
Downloading: http://dev.ee.mulesource.com/repository/content/repositories/releas
es/com/ibm/icu/icu4j-normalizer_transliterator/4.8.1.1/icu4j-normalizer_translit
erator-4.8.1.1.pom
Downloading: http://dev.ee.mulesource.com/repository/content/repositories/snapsh
ots/com/ibm/icu/icu4j-normalizer_transliterator/4.8.1.1/icu4j-normalizer_transli
terator-4.8.1.1.pom
Downloading: http://dev.ee.mulesource.com/repository/content/repositories/ext-re
leases/com/ibm/icu/icu4j-normalizer_transliterator/4.8.1.1/icu4j-normalizer_tran
sliterator-4.8.1.1.pom
Downloading: https://repository-lsi.forge.cloudbees.com/release/com/googlecode/s
ardine/sardine/248/sardine-248.pom
Downloading: http://dev.ee.mulesource.com/repository/content/repositories/releas
es/com/googlecode/sardine/sardine/248/sardine-248.pom
Downloading: http://dev.ee.mulesource.com/repository/content/repositories/snapsh
ots/com/googlecode/sardine/sardine/248/sardine-248.pom
These are DataMapper dependencies. To use it you need an enterprise edition license.
If you have purchased a subscription you can get access to MuleSoft's Enterprise Edition (EE) Nexus repository, otherwise simply remove the datamapper dependency and the clover-etl one from your pom.

Cannot find parent: net.java:jvnet-parent for project: com.sun.jersey:jersey-project:pom:1.9

My project invloves of spring-data-neo4j,when runnging mvn clean install,
there is a maven build error.
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: com.sun.jersey:jersey-project:pom:1.9
Reason: Cannot find parent: net.java:jvnet-parent for project: com.sun.jersey:jersey-project:pom:1.9 for project com.sun.jersey:jersey-project:pom:1.9
"The root cause is a deficiency in Maven 2.2.1. It's not following 301 redirects; if you look at the .pom that is downloaded into your local repository, you will see the 301 HTML that was delivered from the server. More information is available at http://jira.codehaus.org/browse/WAGON-314 . It sounds like the only workaround is to either downgrade to 2.2.0, or upgrade to a newer version of Maven 3." (mrandall_cerner_com at https://java.net/jira/browse/JERSEY-1080 )
I second the issue here with specific version of maven installation. 2.2.1
Steps for resolution : (Assuming you have ubuntu)
If maven (2.2.1) is already installed :
sudo apt-get remove maven2 [To uninstall current maven 2.2.1]
sudo apt-get install maven [Will install upgraded version]
Verify :
mvn --version [Expect to display 3.*]
Try this and see:
Go to Eclipse-> Window-> Preferences->Maven->User Settings
Copy the local repository path of your machine
Navigate to .m2\repository\com\sun\jersey\jersey-project and clean all folders
if jersey-project folder is not there then
clean .m2\repository\com\sun\jersey contents..
Then on you project update you maven depencies (then check if all jars are downloaded to .m2\repository\com\sun\jersey folder)

Resources