Artifact com.oracle.toplink:toplink:jar:10.1.3 not found - java

I am trying to create a spring 4 project from scratch and maven is unable to resolve the dependency of com.oracle.toplink:toplink:jar:10.1.3
The following are the repositories that I have set in the pom.xml
<repositories>
<repository>
<id>repo2.maven.org</id>
<name>repo2.maveng.org</name>
<url>http://repo2.maven.org/maven2</url>
</repository>
<repository>
<id>repo1.maven.org</id>
<name>repo1.maven.org</name>
<url>http://repo1.maven.org/maven2</url>
</repository>
<repository>
<id>java.net</id>
<name>java.net</name>
<url>http://download.java.net/maven/2</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.release</id>
<name>EBR Spring Release Repository</name>
<url>http://repository.springsource.com/maven/bundles/release</url>
</repository>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>EBR External Release Repository</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
</repository>
<repository>
<id>repo.spring.io</id>
<name>repo.spring.io-releases</name>
<url>http://repo.spring.io/ext-release-local</url>
</repository>
</repositories>
Questions:
Which repo should I add to make sure maven resolves this dependency?
Usually, how does one know which repo has a particular artifact belong to?
The error message I see is below. Does this error mean Maven did not try looking up for it in other repositories mentioned?
Could not find artifact com.oracle.toplink:toplink:jar:10.1.3 in repo2.maven.org (http://repo2.maven.org/maven2) -> [Help 1]

The is Oracle toplink - toplink-10.1.3 in maven's Central repository http://repo1.maven.org/maven2. So you just only need to add the dependency in pom.xml, not the repository.
<dependency>
<groupId>com.oracle.toplink</groupId>
<artifactId>toplink</artifactId>
<version>10.1.3</version>
</dependency>
Source:
http://mavenhub.com/mvn/central/com.oracle.toplink/toplink/10.1.3
http://mvnrepository.com/artifact/com.oracle.toplink/toplink/10.1.3

Related

Unable to resolve spring-webmvc-5.0.0.M5 dependency in spring-mvc project

I have a spring-mvc project. In my pom file following dependency was added previously:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-webmvc</artifactId>
<version>5.0.0.M5</version>
</dependency>
And repository is:
<repositories>
<repository>
<id>Alfresco Public Repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
</repositories>
I deleted repository folder under .m2. After that I was getting following error when I try to build the project(mvn clean install):
The following artifacts could not be resolved: org.springframework:spring-webmvc:jar:5.0.0.M5: Failure to find org.springframework:spring-webmvc:jar:5.0.0.M5 in https://artifacts.alfresco.com/nexus/content/repositories/public/ was cached in the local repository, resolution will not be reattempted until the update interval of Alfresco Public Repository has elapsed or updates are forced
I have added new repository in my pom:
<repositories>
<repository>
<id>Alfresco Public Repository</id>
<url>https://artifacts.alfresco.com/nexus/content/repositories/public/</url>
</repository>
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>http://repo.spring.io/milestone</url>
</repository>
</repositories>
Now I am getting following error:
Failed to collect dependencies at org.springframework:spring-webmvc:jar:5.0.0.M5: Failed to read artifact descriptor for org.springframework:spring-webmvc:jar:5.0.0.M5: Could not transfer artifact org.springframework:spring-webmvc:pom:5.0.0.M5 from/to repository.spring.milestone (http://repo.spring.io/milestone): Access denied to: http://repo.spring.io/milestone/org/springframework/spring-webmvc/5.0.0.M5/spring-webmvc-5.0.0.M5.pom
From browser I can see spring-webmvc-5.0.0.M5.pom.
Why I am getting "Access denied"?
What is the solution of this problem?
Note: I am unable to update the version 5.0.0.M5 to 5.0.0.RELEASE
As per #Sebastian's comment, I have changed http to https at Spring Milestone Repository:
<repository>
<id>repository.spring.milestone</id>
<name>Spring Milestone Repository</name>
<url>https://repo.spring.io/milestone</url>
</repository>
It's working fine now. Thanks #Sebastian

Can't get "Gluon Glisten" dependency library in Eclipse's Maven

https://mvnrepository.com/artifact/com.gluonhq/charm-glisten/5.0.2
I want to use Gluon\AutoCompleteTextField, but I can't get this dependency library in Eclipse's Maven. What's the problem? (Jdk11, JavaFX11)
update your pom with
<project>
...
<repositories>
<repository>
<id>charm-glisten</id>
<name>charm-glisten Repository</name>
<url>https://nexus.gluonhq.com/nexus/content/repositories/releases/</url>
<layout>default</layout>
</repository>
</repositories>
...
</project>
the problem already explained here

Maven: copy local jar to target dir

I want a local jar located in C:/myLibs/TDKLogging/TDKLogging-2.1.6.jar
to be copied to my target dir when generating the war, so I modified my pom as follows:
<repositories>
<repository>
<id>JBossNexus</id>
<name>JBoss Nexus Repository Manager</name>
<layout>default</layout>
<url>https://webgate.tdk.com/JBoss/nexus/content/groups/public</url>
</repository>
<repository>
<id>my-local-repo</id>
<url>file://C:/myLibs/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>tdk.com.iot.log</groupId>
<artifactId>TDKLogging</artifactId>
<version>2.1.6</version>
<type>jar</type>
</dependency>
..
But I got this error
Could not find artifact tdk.com.iot.log:TDKLogging:jar:2.1.6 in tdkPublicRepository (https://webgate.tdk.com/JBoss/nexus/content/groups/public)
How to tell maven to search the artifact in a specific repo ???? Can a project work with more than 1 repo at the same time ???? because I only have 1 jar in the local repo, the others ones are stored in the public repo
you may have more than one repo specified.
<repositories>
<repository>
<id>Webgate repository</id>
<url>https://webgate.tdk.com/JBoss/nexus/content/groups/public/</url>
</repository>
<repository>
<id>JBoss repository</id>
<url>http://repository.jboss.org/nexus/content/groups/public/</url>
</repository>
<repository>
<id>java.net</id>
<url>https://maven.java.net/content/repositories/public/</url>
</repository>
</repositories>
What about your particular situation - you have to add your jar and pom to your local repository. You have to run few commands.
Check this
How to include custom library into maven local repository?
and this Guide to installing 3rd party JARs

The best way to get rid from SNAPSHOT version in the dependency

I want to use dependency from the Cloudera Maven repository:
Extract from my pom.xml:
<repositories>
<repository>
<id>cloudera</id>
<url>https://repository.cloudera.com/cloudera/cloudera-repos/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>org.apache.spark</groupId>
<artifactId>spark-core_2.10</artifactId>
<version>0.9.0-cdh4.6.0</version>
</dependency>
It depends on parent "spark-parent" that referenced to parent with SNAPSHOT version.
Extract from spark-parent pom.xml (https://repository.cloudera.com/artifactory/cloudera-repos/org/apache/spark/spark-parent/0.9.0-cdh4.6.0/):
<parent>
<groupId>com.cloudera.cdh</groupId>
<artifactId>cdh-root</artifactId>
<version>4.6.0-SNAPSHOT</version>
</parent>
<groupId>org.apache.spark</groupId>
<artifactId>spark-parent</artifactId>
<version>0.9.0-cdh4.6.0</version>
When I run simple "mvn clean package" I have the error that this SNAPSHOT artifact cannot be found.
What is the simplest way to solve this? A solution must be a change in pom.xml or in the build command.
Thanks.
The Cloudera Maven repository doesn't have the artifact com.cloudera.cdh:cdh-root:pom:4.6.0-SNAPSHOT, therefore you won't be able to build your project using it.
However, you can use the Spring cache of this repository: http://repo.spring.io/cloudera-cache. It contains the missing artifacts. You will also have to enable snapshot dependencies inside your repository:
<repositories>
<repository>
<id>cloudera-cache</id>
<url>http://repo.spring.io/cloudera-cache/</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>

How to add Spring to new Java Project in Eclipse?

I have Eclipse with m2 plugin and want to make new project with Spring.
In maven central repo are only Spring 1.x and Spring 2.x versions and adding http://maven.springframework.org/milestone to pom.xml don't change anything.
I the central repository there are also the latest final Spring artifacts (3.0.5.RELEASE).
E.g. http://repo1.maven.org/maven2/org/springframework/spring-beans/3.0.5.RELEASE
If you need milestones for 3.1 you should add repository definition to your pom.xml as follows:
<repository>
<id>spring-maven-milestone</id>
<name>Springframework Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
And then you can define the dependency:
<dependency>
<groupId>org.springframework</groupId>
<artifactId>spring-beans</artifactId>
<version>3.1.0.M2</version>
</dependency>
There is also repository containing snapshots (nightly):
<repository>
<id>spring-maven-snapshot</id>
<snapshots><enabled>true</enabled></snapshots>
<name>Springframework Maven SNAPSHOT Repository</name>
<url>http://maven.springframework.org/snapshot</url>
</repository>
Seems like you want to use springs own repositories, but you need to add them in your settings.xml file (~/.m2/settings.xml), not in the pom.xml in your project.
<repository>
<id>repository.springframework.maven.release</id>
<name>Spring Framework Maven Release Repository</name>
<url>http://maven.springframework.org/release</url>
</repository>
<repository>
<id>repository.springframework.maven.milestone</id>
<name>Spring Framework Maven Milestone Repository</name>
<url>http://maven.springframework.org/milestone</url>
</repository>
<repository>
<id>repository.springframework.maven.snapshot</id>
<name>Spring Framework Maven Snapshot Repository</name>
<url>http://maven.springframework.org/snapshot</url>
</repository>

Categories