You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@tuscany.apache.org by rf...@apache.org on 2008/10/21 06:06:32 UTC

svn commit: r706507 - in /tuscany/branches/sca-equinox: modules/thirdparty-library/ tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/tools/sca/tus...

Author: rfeng
Date: Mon Oct 20 21:06:31 2008
New Revision: 706507

URL: http://svn.apache.org/viewvc?rev=706507&view=rev
Log:
Configure the eclipse profile to run eclipse:eclipse and process-resources

Removed:
    tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/tools/sca/tuscany/bundle/
Modified:
    tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml
    tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
    tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java

Modified: tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml?rev=706507&r1=706506&r2=706507&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml (original)
+++ tuscany/branches/sca-equinox/modules/thirdparty-library/pom.xml Mon Oct 20 21:06:31 2008
@@ -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>

Modified: tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java?rev=706507&r1=706506&r2=706507&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java (original)
+++ tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleBuildMojo.java Mon Oct 20 21:06:31 2008
@@ -25,31 +25,19 @@
 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 @@
     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 @@
             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 @@
             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);

Modified: tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java
URL: http://svn.apache.org/viewvc/tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java?rev=706507&r1=706506&r2=706507&view=diff
==============================================================================
--- tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java (original)
+++ tuscany/branches/sca-equinox/tools/maven/maven-bundle-plugin/src/main/java/org/apache/tuscany/sca/tools/bundle/plugin/ThirdPartyBundleClasspathGeneratorMojo.java Mon Oct 20 21:06:31 2008
@@ -36,7 +36,7 @@
 /**
  * @version $Rev$ $Date$
  * @goal generate-pde-classpath
- * @phase process-classes
+ * @phase process-resources
  * @requiresDependencyResolution test
  * @description Adjust third party bundle classpath
  */