summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-10-21 04:06:31 +0000
committerrfeng <rfeng@13f79535-47bb-0310-9956-ffa450edef68>2008-10-21 04:06:31 +0000
commit949095c3ee577a6d22cf1af8f5ffe0e4006c7e31 (patch)
tree914d0c482b55099ca627e3b2881f3e5de362fa8c
parent6a206b05d8da93f69d8136e747b3f451ce73d64c (diff)
Configure the eclipse profile to run eclipse:eclipse and process-resources
git-svn-id: http://svn.us.apache.org/repos/asf/tuscany@706507 13f79535-47bb-0310-9956-ffa450edef68
-rw-r--r--branches/sca-equinox/modules/thirdparty-library/pom.xml54
-rw-r--r--branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java135
-rw-r--r--branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java2
3 files changed, 35 insertions, 156 deletions
diff --git a/branches/sca-equinox/modules/thirdparty-library/pom.xml b/branches/sca-equinox/modules/thirdparty-library/pom.xml
index 16d57ef5fc..61269c9a53 100644
--- a/branches/sca-equinox/modules/thirdparty-library/pom.xml
+++ b/branches/sca-equinox/modules/thirdparty-library/pom.xml
@@ -41,53 +41,63 @@
<artifactId>tuscany-host-tomcat</artifactId>
<type>jar</type>
<version>1.4-SNAPSHOT</version>
- </dependency>
+ </dependency>
</dependencies>
<profiles>
<profile>
<id>eclipse</id>
<build>
+ <defaultGoal>process-resources</defaultGoal>
<plugins>
<plugin>
- <artifactId>maven-clean-plugin</artifactId>
- <configuration>
- <filesets>
- <fileset>
- <directory>${basedir}/lib</directory>
- <includes>
- <include>*</include>
- </includes>
- <followSymlinks>false</followSymlinks>
- </fileset>
- </filesets>
- </configuration>
- </plugin>
-
+ <artifactId>maven-clean-plugin</artifactId>
+ <configuration>
+ <filesets>
+ <fileset>
+ <directory>${basedir}/lib</directory>
+ <includes>
+ <include>*</include>
+ </includes>
+ <followSymlinks>false</followSymlinks>
+ </fileset>
+ </filesets>
+ </configuration>
+ </plugin>
+
<plugin>
<groupId>org.apache.tuscany.sca</groupId>
<artifactId>tuscany-maven-bundle-plugin</artifactId>
<executions>
<execution>
<id>assemble-thirdparty-bundle</id>
+ <phase>generate-resources</phase>
<goals>
<goal>assemble-thirdparty-bundle</goal>
</goals>
<configuration>
- <symbolicName>org.apache.tuscany.sca.thirdparty.library</symbolicName>
+ <symbolicName>org.apache.tuscany.sca.thirdparty.library
+ </symbolicName>
</configuration>
</execution>
+ <execution>
+ <id>generate-pde-classpath</id>
+ <phase>process-resources</phase>
+ <goals>
+ <goal>generate-pde-classpath</goal>
+ </goals>
+ </execution>
+
</executions>
</plugin>
-
<plugin>
- <groupId>org.apache.tuscany.sca</groupId>
- <artifactId>tuscany-maven-bundle-plugin</artifactId>
+ <artifactId>maven-eclipse-plugin</artifactId>
<executions>
<execution>
- <id>generate-pde-classpath</id>
+ <id>generate-eclipse-metadata</id>
+ <phase>generate-resources</phase>
<goals>
- <goal>generate-pde-classpath</goal>
+ <goal>eclipse</goal>
</goals>
</execution>
</executions>
@@ -96,5 +106,5 @@
</build>
</profile>
</profiles>
-
+
</project>
diff --git a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
index cf15c5602d..4dd42967ae 100644
--- a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
+++ b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
@@ -25,31 +25,19 @@ import java.io.FileInputStream;
import java.io.FileOutputStream;
import java.io.IOException;
import java.util.HashSet;
-import java.util.List;
import java.util.Set;
import java.util.jar.Manifest;
import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactCollector;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.versioning.VersionRange;
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
-import org.apache.maven.shared.dependency.tree.DependencyTree;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilder;
-import org.apache.maven.shared.dependency.tree.DependencyTreeBuilderException;
/**
* @version $Rev$ $Date$
* @goal assemble-thirdparty-bundle
- * @phase process-resources
+ * @phase generate-resources
* @requiresDependencyResolution test
* @description Build an OSGi bundle for third party dependencies
*/
@@ -64,96 +52,6 @@ public class ThirdPartyBundleBuildMojo extends AbstractMojo {
private MavenProject project;
/**
- * The basedir of the project.
- *
- * @parameter expression="${basedir}"
- * @required @readonly
- */
- private File basedir;
-
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @parameter expression="${component.org.apache.maven.artifact.factory.ArtifactFactory}"
- * @required
- * @readonly
- */
- private org.apache.maven.artifact.factory.ArtifactFactory factory;
-
- /**
- * Used to look up Artifacts in the remote repository.
- *
- * @parameter expression="${component.org.apache.maven.artifact.resolver.ArtifactResolver}"
- * @required
- * @readonly
- */
- private org.apache.maven.artifact.resolver.ArtifactResolver resolver;
-
- /**
- * Location of the local repository.
- *
- * @parameter expression="${localRepository}"
- * @readonly
- * @required
- */
- private org.apache.maven.artifact.repository.ArtifactRepository local;
-
- /**
- * List of Remote Repositories used by the resolver
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- * @readonly
- * @required
- */
- private java.util.List remoteRepos;
-
- /**
- * Dependency tree builder
- *
- * @component
- */
- private DependencyTreeBuilder dependencyTreeBuilder;
-
- /**
- * Artifact factory
- *
- * @component
- */
- private ArtifactFactory artifactFactory;
-
- /**
- * @component
- */
- private ArtifactMetadataSource artifactMetadataSource;
-
- /**
- * @component
- */
- private ArtifactCollector collector;
-
- /**
- * The local repository
- *
- * @parameter expression="${localRepository}"
- * @required
- */
- private ArtifactRepository localRepository;
-
- /**
- * The remote repositories
- *
- * @parameter expression="${project.remoteArtifactRepositories}"
- */
- private List remoteRepositories;
-
- /**
- * Artifact resolver
- *
- * @component
- */
- private ArtifactResolver artifactResolver;
-
- /**
* The bundle symbolic name
*
* @parameter
@@ -167,19 +65,9 @@ public class ThirdPartyBundleBuildMojo extends AbstractMojo {
return;
}
- DependencyTree dependencyTree;
- try {
- dependencyTree = dependencyTreeBuilder.buildDependencyTree(project,
- localRepository, artifactFactory,
- artifactMetadataSource, collector );
-
- } catch (DependencyTreeBuilderException e) {
- throw new MojoExecutionException("Could not build dependency tree", e);
- }
-
String projectGroupId = project.getGroupId();
Set<File> jarFiles = new HashSet<File>();
- for (Object o : dependencyTree.getArtifacts()) {
+ for (Object o : project.getArtifacts()) {
Artifact artifact = (Artifact)o;
if (!(Artifact.SCOPE_COMPILE.equals(artifact.getScope()) || Artifact.SCOPE_RUNTIME.equals(artifact.getScope()))) {
@@ -194,25 +82,6 @@ public class ThirdPartyBundleBuildMojo extends AbstractMojo {
if (projectGroupId.equals(artifact.getGroupId())) {
continue;
}
-
- VersionRange versionRange = artifact.getVersionRange();
- if (versionRange == null)
- versionRange = VersionRange.createFromVersion(artifact.getVersion());
- Artifact dependencyArtifact = artifactFactory.createDependencyArtifact(artifact.getGroupId(),
- artifact.getArtifactId(),
- versionRange,
- artifact.getType(),
- artifact.getClassifier(),
- artifact.getScope());
-
- try {
- artifactResolver.resolve(dependencyArtifact, remoteRepositories, localRepository);
- } catch (ArtifactResolutionException e) {
- log.warn("Artifact " + artifact + " could not be resolved.");
- } catch (ArtifactNotFoundException e) {
- log.warn("Artifact " + artifact + " could not be found.");
- }
- artifact = dependencyArtifact;
if (log.isDebugEnabled()) {
log.debug("Artifact: " + artifact);
diff --git a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java
index 57384fda5d..4eab9a82ec 100644
--- a/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java
+++ b/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java
@@ -36,7 +36,7 @@ import org.apache.maven.project.MavenProject;
/**
* @version $Rev$ $Date$
* @goal generate-pde-classpath
- * @phase process-classes
+ * @phase process-resources
* @requiresDependencyResolution test
* @description Adjust third party bundle classpath
*/