"The following artifacts could not be resolved" : Maven / Android / Eclipse - java

I am trying to run an android application in Eclipse using Maven .
Some dependencies are unfortunately stopping the run (could not be found or resolved).
I have already checked that I have the dependencies in my repository.
Any suggestion is welcome.
Thank you for your time and consideration.
Pom.xml :
<dependency>
<groupId>android</groupId>
<artifactId>android</artifactId>
<version>4.4.2_r2</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>android.support</groupId>
<artifactId>compatibility-v4</artifactId>
<version>19.0.1</version>
</dependency>
Console's error message:
The following artifacts could not be resolved: android:android:jar:4.4.2_r2, android.support:compatibility-v4:jar:19.0.1: Failure to find android:android:jar:4.4.2_r2 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

The android:android:jar:4.4.2_r2 does not exist in your repository. Check really if it exists.

Due to legal problems, Google do not allow Android JAR files to be installed on the Maven Central repository. You need to manually install these dependencies in your local repository.
To do this you need to clone and execute the Maven Android SDK Deployer.

Related

Pom.XML Maven Build Dependency of POM Only Looking for Jar

GIVEN:
I have an in house tool built with gradle that includes a dependency that is only a POM file which in turn then includes a bunch of other dependencies. No jar for this particular dependency by itself. The tool builds.
I have a maven project with a pom.xml file that I want to include this tool in because of all the company specific methods needed for some processes. I added the dependency with the type of pom and when I build it fails.
ERROR:
[ERROR] Failed to execute goal on project <MYPROJECT>: Could not resolve dependencies for project <MYPROJECT>:jar:0.0.326: <com.pom.only.dependency>:jar:7.0 was not found in <Company Repo where this POM file exists> during a previous attempt. This failure was cached in the local repository and resolution is not reattempted until the update interval of <company repo> has elapsed or updates are forced
REQUEST:
I have tried making the tool a fat jar in the hopes it would not need this. But it does. The my project builds without this tool jar so I know it is this jar that brings in the dependency. I just have no idea how to resolve this.
ALMOST CODE EXAMPLE
Because of company specific, I can not put the exact POM code but I can put what it looks like removing company specific stuff.
<dependency>
<groupId>com.group</groupId>
<artifactId>tools-app</artifactId>
<version>1.0.11</version>
</dependency>
<dependency>
<groupId>com.group</groupId>
<artifactId>pom only dependency</artifactId>
<version>7.0</version>
<type>pom</type>
</dependency>
So tools app is the one that I am pulling it. It is the gradle build and uses the pom only dependency without any issue. If I pull this into a gradle app it works fine and builds. However, in the app that has this in the pom, if fails for above. So I add the dependency for the pom only dependency and mark it as type pom but still get the error.
So for my situation (and not the best solution), I went into the dependency that has only a pom and pulled the dependencies out of there and built. It worked. But feel there should be a way to make it work without having to do this.

Maven dependency for javaplanner not resolving

I have a dependency for javaplanner in my project:
<dependency>
<groupId>javaplanner</groupId>
<artifactId>javaplanner</artifactId>
<version>1.5</version>
</dependency>
I am having an issue when building the project, giving error not able to resolve the dependency:
Failure to find javaplanner:javaplanner:jar:1.5
in https://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]
I tried to search the javaplanner dependency in the mvn repository, but its missing there.
How can I resolve this issue? Appreciated!!!!
javaplanner does not exist in Maven Central and does not appear to exist in any other public Maven repository. It has also been discontinued and is no longer downloadable from its provider if it is as I suspect "DHTMLX JavaPlanner" - see https://dhtmlx.com/blog/javaplanner-full-featured-scheduler-for-java/.
To resolve this issue you'll need to download the dependency's JAR file from a third-party site, verify that the downloaded JAR is what used to be available from dhtmlx.com and install the JAR as the javaplanner:javaplanner dependency in your local (or private shared - e.g. Nexus, Artifactory, JFrog - see https://maven.apache.org/repository-management.html) Maven repository. See DHTMLX JavaPlanner maven dependency for more on the local install process.

Maven pom.xml missing dependency error: artifacts could not be resolved

This error won't go away even after many 'mvn clean install' and reimport pom.xml's
[ERROR] Failed to execute goal on project foo:
Could not resolve dependencies for project be.foo:foo:jar:2.0-SNAPSHOT:
The following artifacts could not be resolved:
org.neo4j:neo4j-spatial:jar:0.12-neo4j-2.0.4,
diff_match_patch:diff_match_patch:jar:current:
Failure to find org.neo4j:neo4j-spatial:jar:0.12-neo4j-2.0.4 in
https://repo.spring.io/libs-release was cached in the local repository,
resolution will not be reattempted until the update interval of spring-releases has elapsed or updates are forced -> [Help 1]
eventhough the pom clearly has the dependency:
<dependency>
<groupId>org.neo4j</groupId>
<artifactId>neo4j-spatial</artifactId>
<version>0.12-neo4j-2.0.4</version>
</dependency>
Weirdest thing is I don't even think I need this in my project, it just started complaining about it.
So far I'm guessing that it has to do with some sort of version mismatch?
"diff_match_patch" etc
If you go to the URL thart´s shown in your logs, you´ll see that library is not there. You probably need to change the version or set up a different repo.

maven add dependency located on a local repository

I have a maven project from Github, I fork it, and then I imported it to eclipse. It contains three maven modules. I added a fifth one.
Now I want to add this fifth (new) as a dependency to one of the previous modules.
I did the install in maven, and I got the jar located in my local repository. now when I added a dependency to a one of the previous modules, i got error that my new models doesn't exist in the public dependency. I mean:
Failed to execute goal on project moquette-broker: Could not resolve dependencies for project org.eclipse.moquette:moquette-broker:jar:0.7: Failure to find org.eclipse.moquette:moquette-configurationmanager:jar:0.7 in https://repo.eclipse.org/content/repositories/paho-releases/ was cached in the local repository, resolution will not be reattempted until the update interval of Paho Releases has elapsed or updates are forced -> [Help 1]
my question is how can I tell eclipse to search in my local repository as well?
I tried to upload my dependency to a public repository but it doesn't make any sence now because i am still developing
could you help please
the jar in my local repository
this is what i put in the pom in order to call my new module
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>moquette-configurationmanager</artifactId>
<version>${project.version}</version>
<scope>Test</scope>
</dependency>
and the image that i published is my local repository, because i can see that from my eclipse, like this:
After reading the first 28 comments and responses to your question, I still cannot imagine the cause of this strange error, so you'll have to debug it a bit more:
Two recommendations to debug the Maven build:
Whatever test you run, execute mvn --debug <phase> and analyze carefully the produced log.
Run mvn dependency:build-classpath to ask Maven where are the downloaded libraries referenced in the classpath.

POM.xml error fix

I am very new to eclipse and maven repository. I got a project to config the errors of POM.xml. I fixed many of it, but I am unable to fix some. Following are that errors.
<dependency>
<groupId>jlibs</groupId>
<artifactId>jlibs-jdbc</artifactId>
<version>1.0-SNAPSHOT</version>
</dependency>
<dependency>
<groupId>com.jgodies.form</groupId>
<artifactId>forms</artifactId>
<version>2.3</version>
</dependency>
<dependency>
<groupId>com.oracle</groupId>
<artifactId>ojdbc6</artifactId>
<version>11.2.0</version>
<scope>runtime</scope>
In Maven repository folder there are not all the files which are in the other folders, so I put them manually, but still no results.
All the Oracle realted jars are not the part of the Central Maven Repository.
May be the case with the other oracle related jars. That is the reason why its not able to resolve the dependencies.
You should create a separate custom repository on your company server where you can put all these jar and configure that in POM.xml. Maven will first check the Central reposiroty and if it does not find the files will later check the custom repositry.
For locally running Maven you will have to do a MVN Install manually. you should never manuallly copy any jars to the m2 repositiry
Getting the JDBC drivers is a bit tricky. Please check this article for directions.
Due to Oracle license restriction, there is NO public Maven repository provides Oracle JDBC driver. To use Oracle jdbc drive with Maven, you have to install it manually into your Maven local repository.

Categories