Maven site plugin not getting downloaded by intellij - spring

I am building a spring project in Intellij community edition using maven.
I can see the maven-site-plugin folder created in my local m2 repository:
C:\Users\user_name\.m2\repository\org\apache\maven\plugins\maven-site-plugin
Inside, i see only one file named maven-site-plugin-3.3.pom.lastUpdated with the below content:
#NOTE: This is a Maven Resolver internal implementation file, its format can be changed without prior notice.
#Thu Oct 28 17:03:21 IST 2021
#default-central-https\://repo.maven.apache.org/maven2/.lastUpdated=1635420801486
https\://repo.maven.apache.org/maven2/.error=Could not transfer artifact org.apache.maven.plugins\:maven-site-plugin\:pom\:3.3 from/to central (https\://repo.maven.apache.org/maven2)\: Transfer failed for https\://repo.maven.apache.org/maven2/org/apache/maven/plugins/maven-site-plugin/3.3/maven-site-plugin-3.3.pom
I took a fresh clone of the repo, did a clean build, also tried Intellij's cache invalidate and restart but to no avail..

Related

I have a problem with Maven 3.8.4 that not allowed to authorize our private repo on Apache Archiva

I have installed Maven 3.8.4 with homebrew on Macbook M1 CPU recently and I have ~/.m2/settings.xml properly containing the Apache Archiva user name and password.
when I executed mvn help:effective-settings -DshowPasswords=true command I can see the correct xml content. But when I run mvn clean package I get something like that
Failed to read artifact descriptor for company.webshop:webshop-common:jar:21.11.12:
Could not transfer artifact company.webshop:webshop-common:pom:21.11.12
from/to company (https://repo.company.com/repository/internal/):
authorization failed for https://repo.company.com/repository/internal/company/webshop/webshop-
common/21.11.12/webshop-common-21.11.12.pom,
status: 403 Forbidden -> [Help 1]
when I try to access https://repo.company.com/repository/internal/ address from my browser I can login and see the artifacts properly as well. More than that other team members don't live any problem.
I also removed maven and reinstalled but nothing changed.
any idea?
I noticed that after removing the folders (under the .m2 folder) related to our private repo, and re-run the maven after a fresh instalment it's working properly.
Maven was not downloading the artifacts I guess, since there is a folder of that version number and only showing the content of old files which says something like "not authorized to the repo." and was miss leading

Maven - grab latest upload of artifact

I am trying to install the latest uploaded version of an artifact into my local repository.
For example:
I have a pulsar artifact that was initially uploaded on 12/10. I have recently added to the pulsar artifact and the blob has the updated date 12/17
Blob created Thu Dec 10 2020 10:57:13 GMT-0500 (Eastern Standard Time)
Blob updated Thu Dec 17 2020 12:16:30 GMT-0500 (Eastern Standard Time)
I would like to run a command that will grab the latest blobs for all artifacts in my maven repository in Nexus
Any help would be appreciated!
Thanks
Your local maven repository is throw-away. It's really just a cache of artifacts found in various remote repositories during previous builds.
If you have already built against version 1.0-SNAPSHOT of some artifact, Maven will find that artifact in your local repo, and not attempt to refresh it from the remote.
You can override this with the -U option (--update-snapshots). This will force Maven to re-download snapshot artifacts from your Nexus repo.
mvn -U clean install ...
HTH

maven .pom and . pom.shal1 files not getting updated

I am trying to install maven for the 1st time and seeing below issues when trying to do a maven force update to get the jars to my local repository. I am able to see the property file, jar and jar.sha1 but the .pom and .pom.sha1 is not getting updated. When i go to the specific folder i see this file instead
maven-clean-plugin-3.0.0.pom.lastUpdated
This is happening to all the folders in my repository. The content inside this .lastUpdated file is
#NOTE: This is an Aether internal implementation file, its format can be changed without prior notice.
#Sat Nov 04 22:38:58 EDT 2017
https\://artifactory.cen.gov/artifactory/repo/.error=Could not transfer artifact org.apache.maven.plugins\:maven-clean-plugin\:pom\:3.0.0 from/to repo (https\://artifactory.cen.gov/artifactory/repo)\: com.ibm.jsse2.util.h\: PKIX path building failed\: java.security.cert.CertPathBuilderException\: PKIXCertPathBuilderImpl could not build a valid CertPath.; internal cause is\: \n\tjava.security.cert.CertPathValidatorException\: The certificate issued by CN\=CENInternalRootCA, OU\=cen Service, O\=U.S. Government, C\=US is not trusted; internal cause is\: \n\tjava.security.cert.CertPathValidatorException\: Certificate chaining error
#proxy.cen.gov\:8080>#default-repo-https\://artifactory.cen.gov/artifactory/repo/.lastUpdated=1509849538349
I had this certificate chaining exception earlier but got rid after adding proper certificate and creating keystore and adding them to env variables.
Because of this error i am not able to do a maven clean or run as maven install.
Any suggestions please?
When you already got rid of your certificate problem, you can force an update by using
mvn clean install -U
-U,--update-snapshots Forces a check for missing
releases and updated snapshots on
remote repositories
Otherwise you can delete your local repository. This is a very effective way to force Maven to re-download all dependencies, but the next build may take a substantial ammount of time, depending on the number of dependencies.
The repository is located in ~/.m2/repository by default. Otherwise its location is configured by the <localRepository> setting in settings.xml.
See also Force maven update
If the problem with your certificate chain still exists, Maven will not be able to download the dependencies and you will get the same .lastUpdated files again

Can not build the project after upgrading to mule version 3.8.4 to 3.7.4

Previously I was building the project with the mule version 3.7.4. now, as mule version 3.8.4 is the latest one, so planned to build with this latest version. So,
from Anypoint Studio I have downloaded the latest version.
Then I updated my POM file with the 3.8.4 version. But it seems that with the same jars its not able to build the project.
Its gives error as
Failed to execute goal on project sho-pointofsales: Could not resolve dependencies for project com.sho:sho-pointofsales:mule:1.0-SNAPSHOT: Failed to collect dependencies at com.mulesoft.muleesb.modules:mule-module-tracking-ee:jar:3.8.4: Failed to read artifact descriptor for com.mulesoft.muleesb.modules:mule-module-tracking-ee:jar:3.8.4: Could not transfer artifact com.mulesoft.muleesb.modules:mule-module-tracking-ee:pom:3.8.4 from/to mule-ee-releases (https://repository-master.mulesoft.org/nexus/content/repositories/releases-ee/): Not authorized , ReasonPhrase:Unauthorized. -> [Help 1]
Although I placed this jar inside my local REPO. Don't know what is wrong I am doing.
Thanks in advance.
It exists: https://repository.mulesoft.org/nexus/content/repositories/releases-ee/com/mulesoft/muleesb/modules/mule-module-tracking-ee/
check your username and password in your settings.xml or pom etc for that repo.
But it's part of the platform anyway and doesn't need to be explicit in your pom. So just remove it from the pom or set it the scope to 'provided' on the dependency
Check following stuff:
a. You can either comment the enterprise repository in the pom.xml file.
b. Check if the enterprise repository is accessible from your browser.
c. verfiy username and password.

SpringToolSuite : Faliure to transfer org.apache.maven.diagnostics:pom:2.0.6

I Have recently installed newest Spring Tool Suite 3.4.0 RELEASE.
I wanted to create project by: new->spring project -> Spring MVC Project. Unfortunatly after template is created and built I got error in my pom.xml which says:
Failure to transfer org.apache.maven:maven-error-diagnostics:pom:2.0.6
from http://repo.maven.apache.org/maven2 was cached in the local
repository, resolution will not be reattempted until the update
interval of central has elapsed or updates are forced. Original error:
Could not transfer artifact
org.apache.maven:maven-error-diagnostics:pom:2.0.6 from/to central
(http://repo.maven.apache.org/maven2): connection timed out to
http://repo.maven.apache.org/maven2/org/apache/maven/maven-error-diagnostics/2.0.6/maven-error-diagnostics-2.0.6.pom
I have internet connection and all repo which are included in pom.xml are downloaded.
When I run my project on the tomcat server vfabric project is being deployed and I get my Hello World working.
What should I do to avoid error I am getting?
This seems to be an issue while getting updates from maven repo.
I use these steps to resolve such issues -
Make sure you are not on a vpn or using proxy.
Right click on project -> Maven -> update project - check "Force update snapshots and releases"
If that does not work,
Go to your .m2 folder under your user. Inside that you will find a repository folder, rename or delete that and update your project again with the above steps. STS will refresh workspace and download all the jars again from maven repo.
Also try replacing your maven error diagnostics dependency to the latest version using this
<dependency>
<groupId>org.apache.maven</groupId>
<artifactId>maven-error-diagnostics</artifactId>
<version>2.2.1</version>
</dependency>
In case if you must use a proxy, then you will have to configure the settings file
Here is the documentation -
http://maven.apache.org/guides/mini/guide-proxies.html

Resources