Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIgor Fedorenko2010-12-21 03:40:55 +0000
committerIgor Fedorenko2010-12-21 13:53:33 +0000
commit9fb0471c727b584fa500d0b94ca236700e6faf68 (patch)
tree5d42a5770239532ed3ae946d0663a7eaa15d349d /org.eclipse.m2e.cliresolver30
parent6d224823f7340a1de4160c5127f8f4b46af9c120 (diff)
downloadm2e-core-9fb0471c727b584fa500d0b94ca236700e6faf68.tar.gz
m2e-core-9fb0471c727b584fa500d0b94ca236700e6faf68.tar.xz
m2e-core-9fb0471c727b584fa500d0b94ca236700e6faf68.zip
moved cliresolver from github
Signed-off-by: Igor Fedorenko <igor@ifedorenko.com>
Diffstat (limited to 'org.eclipse.m2e.cliresolver30')
-rw-r--r--org.eclipse.m2e.cliresolver30/.classpath8
-rw-r--r--org.eclipse.m2e.cliresolver30/.gitignore1
-rw-r--r--org.eclipse.m2e.cliresolver30/.project29
-rw-r--r--org.eclipse.m2e.cliresolver30/.settings/org.eclipse.core.resources.prefs3
-rw-r--r--org.eclipse.m2e.cliresolver30/.settings/org.eclipse.jdt.core.prefs6
-rw-r--r--org.eclipse.m2e.cliresolver30/.settings/org.eclipse.m2e.core.prefs5
-rw-r--r--org.eclipse.m2e.cliresolver30/about.html28
-rw-r--r--org.eclipse.m2e.cliresolver30/pom.xml95
-rw-r--r--org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceArtifactRepository.java65
-rw-r--r--org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java56
10 files changed, 296 insertions, 0 deletions
diff --git a/org.eclipse.m2e.cliresolver30/.classpath b/org.eclipse.m2e.cliresolver30/.classpath
new file mode 100644
index 00000000..1e019b73
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/.classpath
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<classpath>
+ <classpathentry kind="src" output="target/classes" path="src/main/java"/>
+ <classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/J2SE-1.5"/>
+ <classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="con" path="org.maven.ide.eclipse.MAVEN2_CLASSPATH_CONTAINER"/>
+ <classpathentry kind="output" path="target/classes"/>
+</classpath>
diff --git a/org.eclipse.m2e.cliresolver30/.gitignore b/org.eclipse.m2e.cliresolver30/.gitignore
new file mode 100644
index 00000000..ea8c4bf7
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/.gitignore
@@ -0,0 +1 @@
+/target
diff --git a/org.eclipse.m2e.cliresolver30/.project b/org.eclipse.m2e.cliresolver30/.project
new file mode 100644
index 00000000..b276e0bf
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/.project
@@ -0,0 +1,29 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>org.eclipse.m2e.cliresolver30</name>
+ <comment></comment>
+ <projects>
+ </projects>
+ <buildSpec>
+ <buildCommand>
+ <name>org.eclipse.jdt.core.javabuilder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.maven.ide.eclipse.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ <buildCommand>
+ <name>org.eclipse.m2e.core.maven2Builder</name>
+ <arguments>
+ </arguments>
+ </buildCommand>
+ </buildSpec>
+ <natures>
+ <nature>org.eclipse.m2e.core.maven2Nature</nature>
+ <nature>org.eclipse.jdt.core.javanature</nature>
+ <nature>org.maven.ide.eclipse.maven2Nature</nature>
+ </natures>
+</projectDescription>
diff --git a/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.core.resources.prefs b/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.core.resources.prefs
new file mode 100644
index 00000000..fc41399d
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.core.resources.prefs
@@ -0,0 +1,3 @@
+#Mon Dec 20 22:59:10 EST 2010
+eclipse.preferences.version=1
+encoding//target/classes/META-INF/plexus/components.xml=UTF-8
diff --git a/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.jdt.core.prefs b/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.jdt.core.prefs
new file mode 100644
index 00000000..ebea6802
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.jdt.core.prefs
@@ -0,0 +1,6 @@
+#Wed Dec 08 10:33:02 EST 2010
+eclipse.preferences.version=1
+org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.5
+org.eclipse.jdt.core.compiler.compliance=1.5
+org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
+org.eclipse.jdt.core.compiler.source=1.5
diff --git a/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.m2e.core.prefs b/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.m2e.core.prefs
new file mode 100644
index 00000000..c011df1f
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/.settings/org.eclipse.m2e.core.prefs
@@ -0,0 +1,5 @@
+#Mon Dec 20 22:59:06 EST 2010
+activeProfiles=
+eclipse.preferences.version=1
+resolveWorkspaceProjects=true
+version=1
diff --git a/org.eclipse.m2e.cliresolver30/about.html b/org.eclipse.m2e.cliresolver30/about.html
new file mode 100644
index 00000000..70e4b67c
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/about.html
@@ -0,0 +1,28 @@
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
+ "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+<head>
+<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1"/>
+<title>About</title>
+</head>
+<body lang="EN-US">
+<h2>About This Content</h2>
+
+<p>October 29, 2010</p>
+<h3>License</h3>
+
+<p>The Eclipse Foundation makes available all content in this plug-in (&quot;Content&quot;). Unless otherwise
+indicated below, the Content is provided to you under the terms and conditions of the
+Eclipse Public License Version 1.0 (&quot;EPL&quot;). A copy of the EPL is available
+at <a href="http://www.eclipse.org/legal/epl-v10.html">http://www.eclipse.org/legal/epl-v10.html</a>.
+For purposes of the EPL, &quot;Program&quot; will mean the Content.</p>
+
+<p>If you did not receive this Content directly from the Eclipse Foundation, the Content is
+being redistributed by another party (&quot;Redistributor&quot;) and different terms and conditions may
+apply to your use of any object code in the Content. Check the Redistributor's license that was
+provided with the Content. If no such license exists, contact the Redistributor. Unless otherwise
+indicated below, the terms and conditions of the EPL still apply to any source code in the Content
+and such source code may be obtained at <a href="http://www.eclipse.org/">http://www.eclipse.org</a>.</p>
+
+</body>
+</html>
diff --git a/org.eclipse.m2e.cliresolver30/pom.xml b/org.eclipse.m2e.cliresolver30/pom.xml
new file mode 100644
index 00000000..dd71fad4
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/pom.xml
@@ -0,0 +1,95 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Copyright (c) 2008 Sonatype, Inc. All rights reserved. This program
+ and the accompanying materials are made available under the terms of
+ the Eclipse Public License v1.0 which accompanies this distribution,
+ and is available at http://www.eclipse.org/legal/epl-v10.html
+-->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+ xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
+ <modelVersion>4.0.0</modelVersion>
+
+ <groupId>org.maven.ide.eclipse</groupId>
+ <artifactId>org.maven.ide.eclipse.cliresolver30</artifactId>
+ <version>0.12.0-SNAPSHOT</version>
+
+ <dependencies>
+ <dependency>
+ <groupId>org.apache.maven</groupId>
+ <artifactId>maven-core</artifactId>
+ <version>3.0-alpha-5</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.sonatype.aether</groupId>
+ <artifactId>aether-api</artifactId>
+ <version>1.2</version>
+ <scope>provided</scope>
+ </dependency>
+
+ <dependency>
+ <groupId>org.maven.ide.eclipse</groupId>
+ <artifactId>org.maven.ide.eclipse.cliresolver</artifactId>
+ <version>${project.version}</version>
+ </dependency>
+ </dependencies>
+
+ <build>
+ <plugins>
+ <plugin>
+ <groupId>org.apache.maven.plugins
+ </groupId>
+ <artifactId>maven-compiler-plugin
+ </artifactId>
+ <configuration>
+ <source>1.5</source>
+ <target>1.5</target>
+ </configuration>
+ </plugin>
+ <plugin>
+ <groupId>org.codehaus.plexus</groupId>
+ <artifactId>plexus-component-metadata</artifactId>
+ <version>1.0.0</version>
+ <executions>
+ <execution>
+ <goals>
+ <goal>generate-metadata</goal>
+ <goal>generate-test-metadata</goal>
+ </goals>
+ </execution>
+ </executions>
+ </plugin>
+
+ <plugin>
+ <groupId>org.apache.maven.plugins</groupId>
+ <artifactId>maven-shade-plugin</artifactId>
+ <version>1.2.1</version>
+ <executions>
+ <execution>
+ <phase>package</phase>
+ <goals>
+ <goal>shade</goal>
+ </goals>
+ <configuration>
+ <artifactSet>
+ <includes>
+ <include>org.maven.ide.eclipse:org.maven.ide.eclipse.cliresolver</include>
+ </includes>
+ </artifactSet>
+ <filters>
+ <filter>
+ <artifact>org.maven.ide.eclipse:org.maven.ide.eclipse.cliresolver</artifact>
+ <includes>
+ <include>org/maven/eclipse/cli/**</include>
+ </includes>
+ </filter>
+ </filters>
+ </configuration>
+ </execution>
+ </executions>
+ </plugin>
+
+ </plugins>
+ </build>
+
+</project>
diff --git a/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceArtifactRepository.java b/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceArtifactRepository.java
new file mode 100644
index 00000000..b6ee00ce
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceArtifactRepository.java
@@ -0,0 +1,65 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.m2e.cliresolver30;
+
+import java.util.Properties;
+
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.repository.LocalArtifactRepository;
+import org.codehaus.plexus.component.annotations.Component;
+import org.eclipse.m2e.cli.WorkspaceState;
+
+/**
+ * Enables workspace resolution in Maven 3.0-beta-2 and below.
+ */
+@Component( role = LocalArtifactRepository.class, hint = LocalArtifactRepository.IDE_WORKSPACE )
+public final class EclipseWorkspaceArtifactRepository
+ extends LocalArtifactRepository
+{
+
+ protected boolean resolveAsEclipseProject( Artifact artifact )
+ {
+ Properties state = WorkspaceState.getState();
+
+ if (state == null) {
+ return false;
+ }
+
+ if (artifact == null) {
+ // according to the DefaultArtifactResolver source code, it looks
+ // like artifact can be null
+ return false;
+ }
+
+ return WorkspaceState.resolveArtifact(artifact);
+ }
+
+ public Artifact find( Artifact artifact )
+ {
+ resolveAsEclipseProject( artifact );
+ return artifact;
+ }
+
+ public boolean hasLocalMetadata()
+ {
+ return false; // XXX
+ }
+
+ @Override
+ public int hashCode()
+ {
+ return 0; // no state
+ }
+
+ @Override
+ public boolean equals( Object obj )
+ {
+ return obj instanceof EclipseWorkspaceArtifactRepository;
+ }
+}
diff --git a/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java b/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java
new file mode 100644
index 00000000..ebee6ade
--- /dev/null
+++ b/org.eclipse.m2e.cliresolver30/src/main/java/org/eclipse/m2e/cliresolver30/EclipseWorkspaceReader.java
@@ -0,0 +1,56 @@
+/*******************************************************************************
+ * Copyright (c) 2008 Sonatype, Inc.
+ * All rights reserved. This program and the accompanying materials
+ * are made available under the terms of the Eclipse Public License v1.0
+ * which accompanies this distribution, and is available at
+ * http://www.eclipse.org/legal/epl-v10.html
+ *******************************************************************************/
+
+package org.eclipse.m2e.cliresolver30;
+
+import java.io.File;
+import java.util.Collections;
+import java.util.List;
+
+import org.codehaus.plexus.component.annotations.Component;
+import org.eclipse.m2e.cli.WorkspaceState;
+import org.sonatype.aether.repository.WorkspaceReader;
+import org.sonatype.aether.repository.WorkspaceRepository;
+
+
+/**
+ * Enables workspace resolution in Maven 3.0-beta-3 and newer.
+ */
+@Component(role = WorkspaceReader.class, hint = "ide")
+public final class EclipseWorkspaceReader implements WorkspaceReader {
+
+ private WorkspaceRepository workspaceRepository;
+
+ public EclipseWorkspaceReader() {
+ this.workspaceRepository = new WorkspaceRepository("ide", getClass());
+ }
+
+ @Override
+ public int hashCode() {
+ return getClass().hashCode(); // no state
+ }
+
+ @Override
+ public boolean equals(Object obj) {
+ return obj instanceof EclipseWorkspaceReader;
+ }
+
+ public WorkspaceRepository getRepository() {
+ return workspaceRepository;
+ }
+
+ public File findArtifact(org.sonatype.aether.artifact.Artifact artifact) {
+ return WorkspaceState.findArtifact(artifact.getGroupId(), artifact.getArtifactId(), artifact.getExtension(),
+ artifact.getBaseVersion());
+ }
+
+ public List<String> findVersions(org.sonatype.aether.artifact.Artifact artifact) {
+ return Collections.emptyList();
+ }
+
+}

Back to the top