maven build doesnot consider new repository url - java

We had to change the repository location in the Pom.xml but when I run Maven(from within IntelliJ IDE) I notice in the logs that it still points to the old URL.
The maven repository in our organization has recently been moved to a new URL. The old URL is not valid anymore and hence I get connection timeout errors in the logs. I verified that all the instances of old URL has been updated in the POM.xmls.
Here is the excerpt of the logs. I do not find any references of the old URL anywhere on my machine.
[Proj Guard] Skipping disabled repository central
[Proj Guard] snapshot com.XYZ.Proj:Proj-libraries-conflict-guard:4.trunk-SNAPSHOT: checking for updates from mvnnexus
[Proj Guard] Checking for pre-existing User-Agent configuration.
[Proj Guard] Adding User-Agent configuration.
[Proj Guard] Connecting to repository: 'mvnnexus' with url: 'http://ABC.XYZ.corp:8081/nexus/content/groups/public'.
[Proj Guard] repository metadata for: 'snapshot com.XYZ.Proj:Proj-libraries-conflict-guard:4.trunk-SNAPSHOT' could not be retrieved from repository: mvnnexus due to an error: Error transferring file: Connection timed out: connect
org.apache.maven.wagon.TransferFailedException: Error transferring file: Connection timed out: connect
at org.apache.maven.wagon.providers.http.LightweightHttpWagon.fillInputData(LightweightHttpWagon.java:143)
at org.apache.maven.wagon.StreamWagon.getInputStream(StreamWagon.java:116)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:88)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.apache.maven.artifact.manager.DefaultWagonManager.getRemoteFile(DefaultWagonManager.java:546)
at org.apache.maven.artifact.manager.DefaultWagonManager.getArtifactMetadata(DefaultWagonManager.java:443)
at org.apache.maven.artifact.repository.metadata.DefaultRepositoryMetadataManager.resolve(DefaultRepositoryMetadataManager.java:97)
at org.apache.maven.artifact.transform.AbstractVersionTransformation.resolveVersion(AbstractVersionTransformation.java:65)
at org.apache.maven.artifact.transform.SnapshotTransformation.transformForResolve(SnapshotTransformation.java:63)
at org.apache.maven.artifact.transform.DefaultArtifactTransformationManager.transformForResolve(DefaultArtifactTransformationManager.java:55)
at org.apache.maven.artifact.resolver.DefaultArtifactResolver.resolve(DefaultArtifactResolver.java:145)
The URL has been changed from(example) http:// ABC.XYZ.corp:8081/nexus/content/groups/public
to http:// nexus.Test.corp/nexus/content/groups/public but it does not seem to be picking.
Am I missing anything?
Please help me figure this out, let me know if you need any further info.

Related

Maven Build Issue with spring-boot-starter-parent <version>2.1.3.RELEASE</version>

I have tried multiple options changing the spring boot starter parent versions updating the
repository URL in the POM file, But still no luck keep on getting the below issue.
Tried adding the repository config in the pom still getting the issue. I have tried deletng the entire m2 repo but no luck its trying to download other tuff but not the plugin.
Error :
plugin org.springframework.boot:spring-boot-maven-plugin:2.1.3.RELEASE or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.springframework.boot:spring-boot-maven-plugin:jar:2.1.3.RELEASE: Could not transfer artifact org.springframework.boot:spring-boot-maven-plugin:pom:2.1.3.RELEASE from/to central (http://repo.maven.apache.org/maven2): Failed to transfer http://repo.maven.apache.org/maven2/org/springframework/boot/spring-boot-maven-plugin/2.1.3.RELEASE/spring-boot-maven-plugin-2.1.3.RELEASE.pom. Error code 501, HTTPS Required
The url from where your code is trying to fetch the dependency should be an https url
expected url
in your case it is :-
your code URL
You might need to change your artifactory url

maven-metadata.xml build error

I am getting the error below in log whenever I try to build my Spring project.
Could anyone please help me?
[WARNING] Could not transfer metadata org.springframework:spring-core:3.2.1.SPR-10124-SNAPSHOT/maven-metadata.xml from/to tinkerpop-repository (like--//tinkerpop.com/maven2): Access denied to link-->//tinkerpop.com/maven2/org/springframework/spring-core/3.2.1.SPR-10124-SNAPSHOT/maven-metadata.xml. Error code 403, Forbidden
[WARNING] Failure to transfer org.springframework:spring-core:3.2.1.SPR-10124-SNAPSHOT/maven-metadata.xml from link: //tinkerpop.com/maven2 was cached in the local repository, resolution will not be reattempted until the update interval of tinkerpop-repository has elapsed or updates are forced. Original error: Could not transfer metadata org.springframework:spring-core:3.2.1.SPR-10124-SNAPSHOT/maven-metadata.xml from/to tinkerpop-repository (link://tinkerpop.com/maven2): Access denied to link---//tinkerpop.com/maven2/org/springframework/spring-core/3.2.1.SPR-10124-SNAPSHOT/maven-metadata.xml. Error code 403, Forbidden
I had the same error. In my case I am using Netbeans 7.1.2, I am posting this because maybe someone end up here same as I did.
I tried to configure the proxy options from the GUI, but the documentation says that maven doesn't read those. So I checked the NetBeans FAQ here :
What mainly you have to do is create (if it does not exist) a settings.xml under
user.home/.m2/settings.xml
if you don't have it you can copy from
netbeans.home/java/maven/conf/settings.xml
then uncomment if you already have it otherwise just fill this section:
<proxies>
<proxy>
<active>true</active>
<host>myproxy.host.net</host>
<port>80</port>
</proxy>
</proxies>
you have to check your proxy configuration and replace it there

checking out project from svn access forbidden

i want to check out a project from svn,but it gives an error(the server is actually runnig)
URL access forbidden for unknown reason
svn: Unable to connect to a repository at URL 'http:.................'
svn: Access to '............' forbidden
The error means that your user account does not have permissions to read the repository path you want to checkout. Contact your manager or server / repository admin for assistance with this issue.
It seems the issue is with a wrong repository access path configuration in svn server.
For e.g. if you are trying to access repository path
yoursvnserver.com/repo/projectRepository/trunk
and svn repository access rules is set wrong as below you could face the mentioned error. Please check with your svn server admin to fix this.
[groups]
superUser=admin
projectDev=user1,user2
[projectRepository:trunk]
#projectDev=r
[projectRepository:/branches]
#projectDev=rw

Gradle build is failing [Could not resolve all dependencies for configuration ':compile'.]

I am trying for so many days to resolve this exception , followed many blogs and couldn't find solution. when I run a bundle.gradle by giving jettyRun as command
I am getting an exception
**FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve javax.servlet:servlet-api:2.5.
Required by:
:1-SimpleServlet:unspecified
> Could not GET 'http://repo1.maven.org/maven2/javax/servlet/servlet-api/2.5/servlet-api-2.5.pom'.
> Connection to http://repo1.maven.org refused
> Could not resolve org.apache.commons:commons-io:1.3.2.
Required by:
:1-SimpleServlet:unspecified
> Could not GET 'http://repo1.maven.org/maven2/org/apache/commons/commons-io/1.3.2/commons-io-1.3.2.pom'.
> Connection to http://repo1.maven.org refused**
The real error is this:
Connection to http://repo1.maven.org refused
Gradle needs to download the dependencies listed in the error message to be able to compile the project.
You're probably behind a firewall or your Internet connection isn't working. You need to make sure Gradle can access http://repo1.maven.org.
Note: Maven Central (http://repo1.maven.org) can be accessed with a browser. If you see the message "Browsing for this directory has been disabled" that means your browser could connect to the server (the error is a special message my Maven Central, not a standard HTTP error message).
If you see this but Maven or Gradle fail, then you need to check your browser's/OS's proxy settings and configure your tool accordingly.
Related:
How do I use Maven through a proxy?
Gradle proxy configuration
Using --refresh-dependencies switch with gradle, helped me to resolve this issue.
In my case the problem was resolved when I changed my gradle version from 4.6 to 4.7.
#Aaron Digulla said I have firewall problem.
I was having problem with GSON dependency, (hope it will solve other dependecy problems also) and this answer solved the problem. Stack Overflow Could not resolve all dependencies for configuration ':classpath'
#Kangars post :
This is what i have in my gradle.build for build script and allprojects
buildscript {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
allprojects {
repositories {
jcenter {
url "http://jcenter.bintray.com/"
}
}
}
This is because of slow internet connection or you haven't configure proxy settings correctly. Gradle needs to download some dependencies , if it cant access the repository it fires this error. All you have to do is check your internet connection and make sure gradle can access the maven repository.
The root cause
Connection to http://repo1.maven.org refused
indicates that the build is failing as gradle is not able to fetch some dependencies from the repository.
Here is a list of causes and corresponding resolutions you might want to try:
Internet connectivity issues - Have a good internet speed and connectivity
Firewall (system or third party) - Ensure firewall is not blocking access to the repository
Working behind a proxy - Gradle proxy configuration
Firewall or some random application meddling with proxy application1 - Kill the process meddling with the proxy application
The proxy application causes certificate problems2 - Import proxy application's certificate
References:
Telerik forum's answer on how to fix internet connectivity issue while using Fiddler
Telerik forum's answer on secure connection issue while using Fiddler
It looks like you don't have a working internet connection or haven't configured your proxy/firewall.
Please check if you can access repo1.maven.org from commandline or a browser.
I used the steps below to fix it.
Go to command prompt and set the java opts.
SET JAVA_OPTS=-Dhttp.proxyHost=your_proxy_server_name -Dhttp.proxyPort=your_proxy_port -Dhttp.nonProxyHosts=127.0.0.1
Then build your Gradle application and all the connection refused errors no longer appear.
gradle clean build distZip
For my case it was a poor connection issue so the IDE couldn't get resources online

Using Nexus as feature repository

Is there a way to add a secured Nexus repository as feature repository to Apache Karaf?
I tried to run the command:
karaf#root()> feature:repo-add http://<user>:<password>#<my-repository>
But I get the following error:
Adding feature url http://<user>:<password>#<my-repository> Error executing command: Server returned HTTP response code: 401 for URL: http://<user>:<password>#<my-repository>
I'm using Apache Karaf 3.0.0.
Thanks,
Mickael
The solution is simple.
Install Maven on the server on which Karaf is running and configure it. Generally, you will configure it through the file settings.xml present in ~/.m2. The credentials for accessing the Nexus repository are indicated in the file.
Finally, instead of using an HTTP URL for referencing your feature, use a Maven URL of the form:
mvn:<groupId>/<artifactId>/<version>/xml/features
The feature will be resolved through Maven.
You can add your own Maven repository to org.ops4j.pax.url.mvn.repositories.
config:edit org.ops4j.pax.url.mvn
config:property-set org.ops4j.pax.url.mvn.repositories http://your.nexus.repo/here
config:update

Categories

Resources