Where did the EclipseLink/Maven repository go to? - maven-2

The link quoted on the EclipseLink/Maven wiki ends on an Error 403 page on switch.ch. If you are redirected to a better mirror then that would already be the answer.
If not: where did the repository go to? Searching the net only reveals that EclipseLink/Maven hat a history of typos on there Wiki-Page. However all the corrected links I found end on error pages as well.

The only link I see is:
http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
and it seems to works just fine, redirecting it to
http://www.gtlib.gatech.edu/pub/eclipse/rt/eclipselink/maven.repo/

The URL from that page
http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo
works for me and redirects to
http://eclipse.ialto.org/rt/eclipselink/maven.repo/
However, inside a pom.xml, I had to escape the &:
<repositories>
<repository>
<id>eclipselink</id>
<url>http://www.eclipse.org/downloads/download.php?r=1&nf=1&file=/rt/eclipselink/maven.repo/</url>
</repository>
</repositories>

Just faced the same problem today.
It appears that the URL provided on their Maven wiki page http://wiki.eclipse.org/EclipseLink/Maven works. But it works in a weird way: their repository is not indexed so if you try just to add this into pom.xml:
<repositories>
<repository>
<id>EclipseLink Repo</id>
<url>http://download.eclipse.org/rt/eclipselink/maven.repo</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
and then try to index the repository it will tell you Unable to update index for EclipseLink Repo|http://download.eclipse.org/rt/eclipselink/maven.repo.
But if you also include into the pom.xml this:
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>eclipselink</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
</dependencies>
it will do the work and add the dependency.
Not ideal but works.

<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.0.0</version>
<scope>compile</scope>
</dependency>
...
<repository>
<id>EclipseLink Repo</id>
<url>http://repo.maven.apache.org/maven2</url>
</repository>

The following configuration in ivy-setting.xml worked fine for me guys:
<resolvers>
<url name="eclipselink" m2compatible="true">
<artifact pattern="http://mirrors.ibiblio.org/pub/mirrors/eclipse/rt/eclipselink/maven.repo/[organisation]/[module]/[revision]/[artifact]-[revision].[ext]"/>
</url>
</resolvers>

All broken. I get 404s everywhere. And the Nexus instance has not indexed the latest releases. Thank you very much for chaotic distribution managment (the project should really be relocated to Apache)
However, manual digging lead to:
<dependencies>
<dependency>
<groupId>org.eclipse.persistence</groupId>
<artifactId>javax.persistence</artifactId>
<version>2.3.2</version>
<scope>compile</scope>
</dependency>
</dependencies>
<repositories>
<repository>
<id>EclipseLink Repo</id>
<url>http://maven.eclipse.org/nexus/service/local/repositories/Sonatype/content</url>
</repository>
</repositories>
Again, this is not working 100% perfectly because Maven is not able to find dependency information.
Hmmm... maybe I should think again before using software that is obviously maintained in such an amateurish manner.

Related

Spring Webflux including spring-cloud-starter-eureka breaks endpoints

I have a basic hello world Webflux app that I want to include in a Spring cloud stack. Whenever I add spring-cloud-starter-eureka to the project it launches Tomcat with a bunch of extra stuff and breaks my Webflux endpoints.
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.0.0.M3</version>
</parent>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-dependencies</artifactId>
<version>Finchley.M2</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-webflux</artifactId>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-tomcat</artifactId>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.16.18</version>
</dependency>
<dependency>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-test</artifactId>
</dependency>
<!--<dependency>-->
<!--<groupId>org.springframework.cloud</groupId>-->
<!--<artifactId>spring-cloud-starter-eureka</artifactId>-->
<!--</dependency>-->
</dependencies>
<repositories>
<repository>
<id>spring-milestones</id>
<name>Spring Milestones</name>
<url>https://repo.spring.io/libs-milestone</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
The output shows that the endpoints are mapped, but they always give a 404.
If I take out the Eureka starter everything works fine.
This question asked the same thing and responses stated that the Webflux endpoints were not support yet.
Spring 5 Functional Web Framework is not working with Eureka Client
I use org.springframework.cloud:spring-cloud-starter-netflix-eureka-client:2.0.0.RELEASE instead of spring-cloud-starter-eureka. This combines fine with webflux.

where is the correct and recent ehcache maven repository

I've been struggling to get ehcache 2.1.0 in my environment. Anytime I thought I got it right, it's just not downloading it. Here is where I set the repository:
<repository>
<!--<url>https://oss.sonatype.org/content/repositories/releases/</url>-->
<url>http://oss.sonatype.org/content/repositories/sourceforge-releases</url>
<id>sonatype-mirror</id>
<layout>default</layout>
<name>Repository for library including ehcache recent ones</name>
</repository>
And I add the dependency this way :
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.1.0</version>
</dependency>
Is there anything that's i'm doing wrong or not properly?
Ehcache is available in the maven central repository, there is no need to add a particular repository.
However, the ehcache artifact is special, it's an "aggregating" artifact which is of type pom. So the dependency should be declared like this:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.1.0</version>
<type>pom</type>
</dependency>
Of course, you can also declare dependencies on individual modules if you want (e.g. ehcache-core) in which case you don't need to specify the type.
References
Ehcache Documentation
Java Requirements and Dependencies
net.sf.ehcache:ehcache:2.1.0 is a dependency of type pom therefore you need to specify it:
<dependency>
<groupId>net.sf.ehcache</groupId>
<artifactId>ehcache</artifactId>
<version>2.1.0</version>
<type>pom</type>
</dependency>
See also:
3.6. POM Best Practices

java.net maven repo - JMS artifact missing

I just created a new Maven project using the default archetype and added the following dependency to my POM file.
<dependencies>
<dependency>
<groupId>javax.jms</groupId>
<artifactId>jms</artifactId>
<version>1.1</version>
<scope>compile</scope>
</dependency>
</dependencies>
Realizing that the Sun's JARs are not on Maven central due to licensing issues, I added
the following Maven repo to my POM (I know this is bad practice though and that it needs to be added to a settings.xml)
<repositories>
<repository>
<id>Repo ID</id>
<layout>default</layout>
<name>Java.net Maven repo</name>
<releases>
<enabled>true</enabled>
</releases>
<url>http://download.java.net/maven/2/</url>
</repository>
</repositories>
I still see this error in my POM file.
"Missing artifact javax.jms:jms:jar:1.1:compile"
Does anyone here know what else needs to be done in addition to the config I already have?
Realizing that the Sun's JARs are not on Maven central due to licensing issues, I added
the following Maven repo to my POM
Yeah, but http://download.java.net/maven/2/javax/ doesn't have the jms artifact...
The good news is that the JBoss Nexus repository does have it:
<repository>
<id>repository.jboss.org-public</id>
<name>JBoss repository</name>
<url>https://repository.jboss.org/nexus/content/groups/public</url>
</repository>
If you just want the jms artifact and don't want to add the whole repo, you can do the following:
wget https://repository.jboss.org/nexus/content/groups/public/javax/jms/jms/1.1/jms-1.1.jar
mvn -e install:install-file -Dfile=./jms-1.1.jar -DartifactId=jms -DgroupId=javax.jms -Dversion=1.1 -Dpackaging=jar
In fact the real solution for this issue is to use the jms-api-1.1-rev-1.jar artifact available on Maven Central : http://search.maven.org/#artifactdetails%7Cjavax.jms%7Cjms-api%7C1.1-rev-1%7Cjar

How to specify a repository for a dependency in Maven

In projects with several dependencies and repositories, the try-and-error approach of Maven for downloading dependencies is a bit cumbersome and slow, so I was wondering if there is any way to set an specific repo for some declared dependencies.
For example, I want for bouncycastle to check directly BouncyCastle's Maven repo at http://repo2.maven.org/maven2/org/bouncycastle/ instead of official Maven.
Not possible. Maven checks the repositories in their declaration order until a given artifact gets resolved (or not).
Some repository manager can do something approaching this though. For example, Nexus has a routes feature that does something equivalent.
I have moved libraries from 3rd party repositories to their own project and included this project as first module in my base project:
base/pom.xml
...
<modules>
<module>thirdparty</module>
<module>mymodule</module>
...
</modules>
base/thirdparty/pom.xml:
...
<artifactId>thirdparty</artifactId>
<packaging>pom</packaging>
<repositories>
<repository>
<id>First thirdparty repository</id>
<url>https://...</url>
</repository>
...
</repositories>
<dependencies>
<dependency>
<!-- Dependency from the third party repository -->
</dependency>
....
</dependencies>
base/mymodule/pom.xml:
<dependencies>
<dependency>
<groupId>${project.groupId}</groupId>
<artifactId>thirdparty</artifactId>
<version>${project.version}</version>
<type>pom</type>
</dependency>
...
</dependencies>
This will ensure that the libraries from the thirdparty repository are downloaded into the local repository as soon as the root project is build. For all other dependencies the repositories are not visible and therefore not included when downloading.
This post could be very old but might be useful to someone. I specified the two repositories in pom.xml like below and it worked.
<repositories>
<repository>
<id>AsposeJavaAPI</id>
<name>Aspose Java API</name>
<url>http://repository.aspose.com/repo/</url>
</repository>
<repository>
<id>Default</id>
<name>All apart from Aspose</name>
<url>https://repo.maven.apache.org/maven2/</url>
</repository>
</repositories>

google salve - maven

I tried to install google salve http://code.google.com/p/salve/ by adding following statements in the project's pom file:
However, when running mvn dependency:resolve it states "unable to find resource "salve:salve:jar:2.0" in repository salve
What's wrong?
<dependency>
<groupId>salve</groupId>
<artifactId>salve</artifactId>
<version>2.0</version>
</dependency>
<repository>
<id>salve</id>
<name>Google Maven Repository</name>
<url>http://salve.googlecode.com/svn/maven2/</url>
</repository>
The salve artifact you're mentioning is a pom (and indeed, there is no salve:salve:jar:2.0). If this is really the dependency you want to declare, you need to specify the type:
<project>
...
<repositories>
<repository>
<id>salve</id>
<name>Google Maven Repository</name>
<url>http://salve.googlecode.com/svn/maven2/</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>salve</groupId>
<artifactId>salve</artifactId>
<version>2.0</version>
<type>pom</type>
</dependency>
...
</dependencies>
</project>
Honestly, I doubt you want the pom but I can't tell you which artifact you need.
Update: I guess you would have figured this out yourself but for salve-depend-guice, use the following dependency:
<dependency>
<groupId>salve</groupId>
<artifactId>salve-depend-guice</artifactId>
<version>2.0</version>
</dependency>
The dependencies of the above artifact will be downloaded transitively by Maven.