Using artifacts from Eclipse Luna P2 repository in Maven - eclipse

Has anybody an idea how to define a regular Maven dependency against an artifact that is hosted in an Eclipse P2 repository (e.g http://download.eclipse.org/releases/luna)? The only answer I found was this: Use dependencies from Eclipse p2 repository in a regular Maven build?.
In my case I cannot change from the pom-first approach to the manifest-first approach and especially, I don't want to change the packaging from bundle to eclipse-plugin. Unfortunately, I cannot find any up-to-date releases in any of the public Maven repositories.
The artifacts I am interested in are:
org.eclipse.equinox:org.eclipse.equinox.http.jetty:3.0.200.v20131021-1843
org.eclipse.equinox:org.eclipse.equinox.http.servlet:1.1.500.v20140318-1755
I have tried it with simply defining the Eclipse P2 Repository in my root pom:
<repository>
<id>eclipse-luna-repository</id>
<url>http://download.eclipse.org/releases/luna</url>
<layout>p2</layout>
</repository>
Of course this does not work and I get the following error:
Could not transfer artifact org.eclipse.equinox\:org.eclipse.equinox.http.jetty\:pom\:3.0.200.v20131021-1843 from/to eclipse-luna-repository (http\://download.eclipse.org/releases/luna)\: No connector available to access repository eclipse-luna-repository (http\://download.eclipse.org/releases/luna) of type p2 using the available factories WagonRepositoryConnectorFactory
Has anybody an idea how to solve this problem?

Related

Missing artifact in vaadin start project (maven issue)

I was just about to get started with the vaadin start project (https://start.vaadin.com/). I downloaded it and imported it into eclipse. However after that I got a Maven import error on line 112+ telling me there is a "Missing artifact org.vaadin.artur:a-vaadin-helper:jar:1.5.0"
<dependency>
<groupId>org.vaadin.artur</groupId>
<artifactId>a-vaadin-helper</artifactId>
<version>1.5.0</version>
</dependency>
All other dependencies can be resolved. I do not have a custom settings.xml for maven. Refreshing does not help.
The artifact is located in the Vaadin Addons repository (for which there is a definition in the pom.xml). Perhaps you are using a Maven proxy that does not include this repository?

Spring boot not compiling

I am trying to compile the project https://github.com/spring-cloud/spring-cloud-aws but the parent project has references to flatten-maven-plugin thus i am getting the error.
If this plugin is public i am not sure why i am getting the error as below. I am not able to get rid of this plugin. I opened a ticket on the git project but as it may not gather any answer.
Error resolving version for plugin 'org.codehaus.mojo:flatten-maven-plugin' from the repositories [local (C:\Users\ranajit.jana\.m2\repository), central (https://repo.maven.apache.org/maven2)]: Plugin not found in any plugin repository pom.xml /spring-cloud-aws-**** line 1 Maven pom Loading Problem
I am compiling this code as i want to make some changes.
Anyone has idea what can be done ?
=============================
This is resolved now.
This is was repo issue the plugin repo was pointing to repo1.maven.apache.org/maven2 which could not resolve this plugin.
I had to add the following to resolve this issue..
This is added as one additional plugin repo
<pluginRepository>
<id>maven-plugin-repo-mvn</id>
<name>Maven plugin repo maven</name>
<url>https://repo.maven.apache.org/maven2</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
Open the .m2/repository and proceed to the path org/codehaus/mojo/flatten-maven-plugin/. There delete the subdirectory version number. and all contained files. Maven will automatically download them the next time they are required.

Circular Dependencies in Eclipse Platform

I'm trying to add the Eclipse Platform to my Maven project and stumbled over something very weird.
There is the plug-in org.eclipse.swt, which has a dependency org.eclipse.swt.${osgi.platform}, where ${osgi.platform} can be any of the following:
cocoa.macosc.cocoa
gtk.linux.aarch64
win32.win32.x86_64
However if you check the pom.xml of org.eclipse.swt.win32.win32.x86_64 you learn that this project has a dependency to org.eclipse.swt. Which forms a nice dependency circle, which is not allowed in Maven nor in OSGi.
Consequently I'm getting a StackOverflowError, but only if I try to use the maven-dependency-plugin with -Dosgi.platform=win32.win32.x86_64.
If I don't use that parameter I get the following exception:
No versions available for org.eclipse.platform:org.eclipse.swt.gtk.linux.aarch64:jar:[3.105.2,3.105.2]
(Which is probably okay, because I guess that Linux is the default value, but it doesn't apply to me, since I've got a Windows PC.)
I can't exclude the dependency either, e.g. with:
<dependency>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.swt</artifactId>
<exclusions>
<exclusion>
<groupId>org.eclipse.platform</groupId>
<artifactId>org.eclipse.swt.gtk.linux.aarch64</artifactId>
</exclusion>
</exclusions>
</dependency>
I get the same error messages as above with that approach.
I'm wondering how the Eclipse guys even managed to release that mess, but more importantly: How do I build against a Maven project with circular dependencies like this?
You're looking at the wrong place. Eclipse artifacts are published in Eclipse p2 repositories. In addition, some Eclipse artifacts will be published in Maven repositories for use in plain (non-Eclipse based) Java applications which cannot be used to build Eclipse-based applications. Something seems to have gone wrong publishing Eclipse SWT to Maven Central causing the circular dependencies. Please report this to Eclipse.
The Eclipse IDE packages are built with the Maven plug-in Tycho. See for example the pom.xml file for the Eclipse platform or here the parent pom.xml for all IDE packages. Tycho uses one or more Eclipse p2 repositories to resolve dependencies. A Maven repository would not work to resolve Import-Package dependencies or product configurations, for example. In a Maven repository, an artifact has a version, while in a p2 repository also Java packages of the same JAR can have different versions. In a Maven Tycho pom.xml only the p2 repositories have to be specified, the dependencies are already declared in the META-INF/MANIFEST.MF, feature.xml and *.product files.

Eclipse 3.7 (Indigo): How to add a remote Maven 2 repository mirror

I recently installed Eclipse 3.7 (Indigo) and now a wanted to start a new project using the integrated Maven plugins.
Problem is, I can't download any dependencies from the central maven 2 repository http://repo1.maven.org/maven2
After creating a new simple Maven project (without an archetype), i constantly get these Error messages:
Description Resource Path Location Type
CoreException: Could not calculate build plan: Plugin org.apache.maven.plugins:maven-compiler-plugin:2.3.2 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-compiler-plugin:jar:2.3.2: ArtifactResolutionException: The repository system is offline but the artifact org.apache.maven.plugins:maven-compiler-plugin:pom:2.3.2 is not available in the local repository. pom.xml /JAVA line 1 Maven Project Build Lifecycle Mapping Problem
Description Resource Path Location Type
Could not calculate build plan: Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3 pom.xml /JAVA line 1 Maven Build Problem
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:compile (execution: default-compile, phase: compile) pom.xml /JAVA line 1 Maven Project Build Lifecycle Mapping Problem
Description Resource Path Location Type
Plugin execution not covered by lifecycle configuration: org.apache.maven.plugins:maven-compiler-plugin:2.3.2:testCompile (execution: default-testCompile, phase: test-compile) pom.xml /JAVA line 1 Maven Project Build Lifecycle Mapping Problem
Using an archetype doesn't work at all.
Am I right to just add another repository mirror to get the needed dependencies?
If so, how do I add another one?
Update: I wrote a D:\Users\.m2\settings.xml manually and the m2e-plugin recognized it correctly:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
http://maven.apache.org/xsd/settings-1.0.0.xsd">
<localRepository/>
<interactiveMode/>
<usePluginRegistry/>
<offline/>
<pluginGroups/>
<servers/>
<mirrors>
<mirror>
<id>dotsrc.org</id>
<url>http://mirrors.dotsrc.org/maven2</url>
<mirrorOf>central</mirrorOf>
</mirror>
</mirrors>
<proxies/>
<profiles/>
<activeProfiles/>
</settings>
Problem is: I can't find a complete mirror of the Maven central repository. I tried every single one I could find on the net, but all are missing some dependencies, archetypes, etc.
Any help out there?
Try one of these.

building spring batch sample application

I am trying to build the sample application for spring batch 2.1.6. (ie. spring-batch-2.1.6.RELEASE/samples/spring-batch-samples) using maven but am getting this error for a missing plugin:
[ERROR] Plugin
com.springsource.bundlor:com.springsource.bundlor.maven:1.0.0.RELEASE
or one of its dependencies could not be resolved: Failure to find
com.springsource.bundlor:com.springsource.bundlor.maven:jar:1.0.0.RELEASE
in http://repo1.maven.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 ->
Is there another repository I can set up to get this plugin? I am a bit suprised to be getting this errror as this is the latest realease version of spring batch.
Here is the repository section from the pom as it came in the download:
<repositories>
<repository>
<id>com.springsource.repository.bundles.external</id>
<name>SpringSource Enterprise Bundle Repository - SpringSource Bundle External</name>
<url>http://repository.springsource.com/maven/bundles/external</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</repository>
</repositories>
The project's parent pom has a bootstrap profile which contains the necessary repository definitions. Build the project with the command mvn test -P bootstrap and it will download the dependencies.
P.S. This is explained in the readme's instructions that how to build Spring Batch. It would be good if they would also tell how to do it in the instructions for using the samples - maybe you could file a bug report?
i am using maven3 and was able to solve this problem by adding this to my pom:
<pluginRepositories>
<pluginRepository>
<id>plugin.repo.maven.central2</id>
<url>http://objectstyle.org/maven2/</url>
<snapshots>
<enabled>false</enabled>
</snapshots>
</pluginRepository>
</pluginRepositories>
The Spring batch Admin sample build is broken for sure. At least as of today.
The -Pbootstrap doesn't help and adding the repos in that profile in my local settings doens't help either.
When I attempted to build spring-batch-admin-sample, I found that I was missing dependencies of spring batch!
So I went to build that. There I found that I was missing org.neo4j:neo4j-cypher-dsl-1.9.M04 and also gemfire.7.0.1.jar. Adding repos doesn't help because of the maven2/3 incompatibility issues.
So a sure way to fix this is to go to each repo, download the missing dep and mvn install-file them.
So get the neo4j one here:
http://m2.neo4j.org/content/repositories/releases/org/neo4j/neo4j-cypher-dsl/1.9.M04/
Get the gemfire one from here:
https://repo.springsource.org/gemstone-release-cache/com/gemstone/gemfire/gemfire/7.0.1/
And then I ran into a foundrylogic.vpp dependency that I found here:
http://objectstyle.org/maven2/foundrylogic/vpp/vpp/2.2.1/
Don't forget to get the corresponding poms also to keep it clean and get all the transitives, if any.
Use the mvn install-file plugin described here to get all three deps to your local repo.
http://maven.apache.org/plugins/maven-install-plugin/usage.html
Now spring-batch should build clean.
Now if you go to build spring-batch-admin it will still fail because it depends on spring-batch-core-2.2.3.BUILD-SNAPSHOT whereas what we just built was version 3.0.0.BUILD-SNAPSHOT.
So go to spring-batch-admin-parent's pom and modify the pom like so:
<!-- <spring.batch.version>2.2.3.BUILD-SNAPSHOT</spring.batch.version> -->
<spring.batch.version>3.0.0.BUILD-SNAPSHOT</spring.batch.version>
And then step back to spring-batch-admin and mvn clean install should build the sample.
Hope this helps someone!
I installed maven 3.2.1 and it works.