maven dependency not downloading - maven

I'm new to maven. I'm getting the following error, which I don't understand. Can you please help me to understand how to fix it ?
The following artifacts could not be resolved: org.springframework:org.springframework.core:jar:3.0.5.RELEASE, org.springframework:org.springframework.asm:jar:3.0.5.RELEASE: Failure to find org.springframework:org.springframework.core:jar:3.0.5.RELEASE in 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 -> [Help 1]

It would be more helpful if you provide your pom file with the question, but judging from a stacktrace it seems that dependency is not declared correctly. Specifically, correct artifact name for Spring is "spring-core" and not "org.springframework.core", So in your pom.xml file you should have:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-core</artifactId>
<version>3.0.5.RELEASE</version>
</dependency>
You can find a correct dependency definition at public Maven Repo search engines (like http://mvnrepository.com or http://search.maven.org). Here is the the link to Spring Core artifact: http://mvnrepository.com/artifact/org.springframework/spring-core/3.0.5.RELEASE
Btw, the error that you see is in following format:
<groupId>:<artifactId>:<packaging>:<version>

Try running your command with the -U option. Here is more information.

Yeah looks like your pom dependancy aren't marked correctly. Googling sample Spring MVC app and lookin sample pom will be helpful.

Related

Plugin .url=jdbc:oracle:thin or one of its dependencies could not be resolved - Spring Boot liquibase

I'm currently working in my company developing an API in Spring Boot with an Oracle database, the problem is that we use liquibase to create the database, and when I try to use the command:
mvn liquibase:update -Dliquibase.url="jdbc:oracle:thin:#..." -Dliquibase.username="xxx" -Dliquibase.password="xxx" -Dinterface-user="xxx" -Dtablespace-tablas="xxx" -Dtablespace-indices="xxx" -Dstorage-tablas="xxx" -Dstorage-indices="xxx"
It returns me this error:
Plugin .url=jdbc:oracle:thin or one of its dependencies could not be resolved: Failure to find .url=jdbc:oracle:jar:thin in https://maven.oracle
.com was cached in the local repository, resolution will not be reattempted until the update interval of maven.oracle.com has elapsed or updates are for
ced -> [Help 1]
I think it is related with the dependency ojdbc8 from oracle but I can't figure out how to make it work.
I know that all the credentials for the database and everything are correct as I can totally use them to connect to the database with a db manager.
Here is my dependency in pom.xml:
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3</version>
</dependency>
Right now I've tried these things:
Downloading the dependency from maven repo (https://mvnrepository.com/artifact/com.oracle.ojdbc/ojdbc8/19.3.0.0) and installing it locally using the command: mvn install:install-file -Dfile=./ojdbc8.jar -DgroupId=com.oracle -DartifactId=ojdbc8 -Dversion=19.3 -Dpackaging=jar.
This supposedly installed the dependency locally, but still does not work.
Adding the oracle server to the dependency repos in maven config, following this oracle guide
(https://docs.oracle.com/middleware/1213/core/MAVEN/config_maven_repo.htm#MAVEN9016)
With this second change I manage to get a different error:
Plugin .url=jdbc:oracle:thin or one of its dependencies could not be resolved: Could not find artifact .url=jdbc:oracle:jar:thin in maven.oracle
.com (https://maven.oracle.com) -> [Help 1]
Could you help me find what am I doing wrong or something that I might be missing? Thanks!
You need to use the follow GAV for downloading the JDBC driver from central maven. Refer to Maven guide for more details
<dependency>
<groupId>com.oracle.database.jdbc</groupId>
<artifactId>ojdbc8</artifactId>
<version>19.3.0.0</version>
</dependency>
In the end, the main problem was that I was using the embedded console of IntelliJ and It wasn't working that way, I switched to cmd and it worked...

How to add aem Uber jar dependency in maven build

I have used the maven archetype10 as shown below and created the project structure and everything was fine.
mvn archetype:generate -DarchetypeGroupId=com.adobe.granite.archetypes -DarchetypeArtifactId=aem-project-archetype -DarchetypeVersion=10 -DarchetypeRepository=https://repo.adobe.com/nexus/content/groups/public/
Now i wanted to add the aem uber-jar dependency and added the below dependency tags in the project pom.xml and in core module pom.xml respectively and also my repository tags are same as https://repo.adobe.com/
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.2.0</version>
<scope>provided</scope>
</dependency>
after adding the above dependency tag when i compile it is giving me the below error.
[ERROR] Failed to execute goal on project aemexample.core: Could not
resolve dependencies for project
com.krishh.example:aemexample.core:bundle:0.1: Could not transfer
artifact com.adobe.aem:uber-jar:jar:6.2.0 from/to
adobe-public-releases
(http://repo.adobe.com/nexus/content/groups/public): hostname in
certificate didn't match: <repo.adobe.com> != <devedge.day.com> OR
<devedge.day.com> -> [Help 1]
Is there anything am missing to add extra dependencies to compile and run this successfully.
You seem to be missing a classifier in your dependency. Try adding the one for AEM APIs, as suggested in the documentation. This should help Maven locate the necessary JAR in the repository:
<dependency>
<groupId>com.adobe.aem</groupId>
<artifactId>uber-jar</artifactId>
<version>6.2.0</version>
<classifier>apis</classifier>
<scope>provided</scope>
</dependency>
If that doesn't help, you should also look at the certificate warning. Check out the answers to this question for more information on the subject.
TL;DR - possible causes could be:
an old Maven version using an HTTP library that is not compliant with the certificate being used by the repository - try upgrading Maven
erroneous certificate used by the server
potential network configuration issues between you and the repository
an actual attempt at getting you to download a malicious file by a party pretending to be the Nexus

Nexus doesn't download the complete artifact content from the Central repository

In our project we use the artifact
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>1.7.5</version>
</dependency>
Everything works fine: Nexus downloads the same content as in http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/1.7.5/ to its proxy repository.
('Download' column in artifact details on Nexus shows 'pom, jar')
Now, we switch to the newest version 2.0.2 of the artifact:
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>2.0.2</version>
</dependency>
Then, when we try to build the project then the attempt fails. Nexus cannot resolve the artifact! It seems like Nexus didn't download the complete content of the artifact version ('Download' column in artifact details on Nexus shows 'pom, pom'). On the other site, when I look at the artifact in the Central repository, the content is as usual: http://repo1.maven.org/maven2/nl/jqno/equalsverifier/equalsverifier/2.0.2/.
What causes the problem with the newest artifact version? Why can't Nexus download it correctly?
You may have overlooked that your dependency is of type pom. This will only download the pom, because that's what you are asking for. Remove the <type> and you should get the jar aswell.
<dependency>
<groupId>nl.jqno.equalsverifier</groupId>
<artifactId>equalsverifier</artifactId>
<version>2.0.2</version>
<type>pom</type> <-------------- Remove this
</dependency>
Assuming crea1's answer didn't solve your problem:
Maybe something went wrong when Maven downloaded the artifact, causing Maven to "think" the artifact was downloaded anyway.
You can force Maven to try and download it again with mvn -U test.
If that doesn't work, try going into ~/.m2/repository (or wherever Maven stores its artifacts locally on your system), locating EqualsVerifier, removing the entire 2.0.2 folder, and calling Maven again.

Spring STS spring boot project maven pom error

Hello I am trying to learn spring boot. I have installed Spring STS
Spring Tool Suite
Version: 3.6.4.RELEASE
Build Id: 201503100339
Platform: Eclipse Luna SR1 (4.4.2)
Java 1.7.
I am trying to create a spring starter project. After I do it with the sts I get the project generated but the Maven pom contains errors.
It always says : Project build error:
Project build error: Non-resolvable import POM: Failure to transfer org.springframework:spring-framework-bom:pom:4.1.6.RELEASE from 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.springframework:spring-framework-bom:pom:4.1.6.RELEASE from/to central repo.maven.apache.org/maven2): The operation was cancelled.
Failure to transfer org.springframework:spring-framework-bom:pom:4.1.6.RELEASE from //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.springframework:spring-framework-bom:pom:4.1.6.RELEASE from/to central repo.maven.apache.org/maven2): The operation was cancelled.
Project build error: Non-resolvable import POM: Failure to transfer org.springframework.security:spring-security-bom:pom:3.2.7.RELEASE from 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.springframework.security:spring-security-bom:pom:3.2.7.RELEASE from/to central ( repo.maven.apache.org/maven2): The operation was cancelled.
The POM is automatically generated when I create a spring starter project and it always generates that error.
I understand that there is something wrong the the spring files but I don't know how to solve that problem.
Can someone here give me please an advice how to solve this.
Thanks.
Best regeards.
Khelvan
I was getting the same issue while importing maven project from spring initialzr.
Spring Tool Suite 4 Version: 4.1.0.RELEASE
Just add below lines in pom.xml file:-
<properties>
<maven-jar-plugin.version>3.1.1</maven-jar-plugin.version>
</properties>
Happy Coding ;
I had the same problem, using NetBeans 8.1, Maven 3.0.1, and Spring MVC versions 4.0.1 and 4.2.5.
The first solution I found on the web was to update Maven to version 3.3.9, which did not solve my problem. However, with more search I found a useful link. There it explains for including Maven's "bill of materials" (BOM) dependency you can use:
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-framework-bom</artifactId>
<version>4.2.5.RELEASE</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
Before I was missing <type> and <scope> tags in the auto-generated code. After adding them the problem was solved.
Since I am not sure if updating Maven also helped or not, you might also try that.
Check the version of the bom you are using. When I changed mine to 4.3.5.RELEASE, the error went away

Maven failure to find maven-plugins:maven-cobertura-plugin

I try to compile maven web project with
<dependency>
<groupId>org.springframework.ws</groupId>
<artifactId>spring-ws</artifactId>
<version>3.0.5-FINAL</version>
</dependency>
The problem is that when I try compile it I get the following errors:
[ERROR] Failed to execute goal on project inferx-d2aserver: Could
not resolve dependencies for project
com.inferx:inferx-d2aserver:war:4.0: The following artifacts could not
be resolved: maven-plugins:maven-cobertura-plugin:plugin:1.3,
maven-plugins:maven-findbugs-plugin:plugin:1.3.1,
org.springframework.ws:spring-ws:jar:3.0.5.RELEASE: Failure to find
maven-plugins:maven-cobertura-plugin:plugin:1.3 in
http://repository.springsource.com/maven/bundles/release was cached in
the local repository, resolution will not be reattempted until the
update interval of com.springsource.repository.bundles.release has
elapsed or updates are forced -> [Help 1] [ERROR]
I use Apache Maven 3.0.3, Java: 1.7.0 OS: Windows 7 (64 bit)
I am not sure if this is the same case since my dependencies is different. I got similar error message with the same dependencies error so I removed both dependencies from ~/.m2/repository/jaxen/jaxen/1.1.3/jaxen-1.1.3.pom and the project is compile fine now.
I was also facing similar issue. I just excluded jaxen from Jdom dependency and it worked for me.
jdom 1.1.2 includes jaxen 1.1.3 which imports those artifacts.
<dependency>
<groupId>org.jdom</groupId>
<artifactId>jdom</artifactId>
<version>1.1.2</version>
<exclusions>
<exclusion>
<groupId>jaxen</groupId>
<artifactId>jaxen</artifactId>
</exclusion>
</exclusions>
</dependency>
It look like your pom or parent pom contains a wrong definition of the maven-coberatura-plugin which should be fixed first. Furthermore remove the folder in your local repository.
From the error message related to cobertura version, it looks like you may be having a pom.xml corresponding to maven 1.
The following are maven 1.x versions of the plugins and not supported.
maven-plugins:maven-cobertura-plugin:plugin:1.3,
maven-plugins:maven-findbugs-plugin:plugin:1.3.1
Removing the pom is not the solution; in future builds may be you need them. Best solution according to my opinion is to modify the POM of corresponding jars. Like if you are getting error because of any jar; actually there is the dependency defined in its POM. So use <exclude>. That will work for sure.

Resources