incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r536615 - in /incubator/nmaven/branches/SI_XPT: components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ components/dotnet-artifact/src/main/r...
Date Wed, 09 May 2007 18:49:19 GMT
Author: sisbell
Date: Wed May  9 11:49:17 2007
New Revision: 536615

URL: http://svn.apache.org/viewvc?view=rev&rev=536615
Log:
Fixed runtime problem that occurred because of duplicate field types in artifact installer.

Modified:
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
    incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml
    incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/pom.xml
    incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java
    incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java?view=diff&rev=536615&r1=536614&r2=536615
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
Wed May  9 11:49:17 2007
@@ -100,12 +100,12 @@
      * artifact's directory within the local repository. This method should be used for exe,
winexe and
      * netplugins.
      *
-     * @param artifact the artifact to resolve
+     * @param dependency the dependency to resolve
      * @param pomFile
      * @throws ArtifactInstallationException
      * @throws ArtifactNotFoundException
      */
-    void resolveAndInstallLibraryDependenciesFor( Artifact artifact, File pomFile )
+    void resolveAndInstallLibraryDependenciesFor( Dependency dependency, File pomFile )
         throws ArtifactInstallationException , ArtifactNotFoundException;
 
     /**

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java?view=diff&rev=536615&r1=536614&r2=536615
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
Wed May  9 11:49:17 2007
@@ -25,10 +25,7 @@
 import org.apache.maven.dotnet.artifact.ArtifactType;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.versioning.VersionRange;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.resolver.ArtifactResolutionResult;
-import org.apache.maven.artifact.resolver.ResolutionNode;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
@@ -38,6 +35,7 @@
 import org.apache.maven.artifact.installer.ArtifactInstallationException;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.DefaultArtifactRepository;
+import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
 import org.apache.maven.model.Model;
 import org.apache.maven.model.Dependency;
 import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
@@ -67,11 +65,6 @@
 {
 
     /**
-     * A factory component used for creating artifacts from metadata
-     */
-    private ArtifactFactory mavenArtifactFactory;
-
-    /**
      * An installer component for installing artifacts into a local Maven repository.
      */
     private org.apache.maven.artifact.installer.ArtifactInstaller mavenInstaller;
@@ -119,6 +112,11 @@
     private ArtifactMetadataSource metadata;
 
     /**
+     * The artifact factory component, which is used for creating artifacts.
+     */
+    private ArtifactFactory artifactFactory;
+
+    /**
      * Constructor. This method is intended to by invoked by the plexus-container, not by
the application developer.
      */
     public ArtifactInstallerImpl()
@@ -224,7 +222,7 @@
         throws ArtifactInstallationException
     {
         Artifact artifact =
-            mavenArtifactFactory.createArtifactWithClassifier( groupId, artifactId, version,
packaging, null );
+            artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging,
null );
         artifact.setFile( artifactFile );
 
         FileWriter fileWriter = null;
@@ -336,16 +334,39 @@
         }
     }
 
-    public void resolveAndInstallLibraryDependenciesFor( Artifact sourceArtifact, File pomFile
)
+    public void resolveAndInstallLibraryDependenciesFor( Dependency dependency, File pomFile
)
         throws ArtifactInstallationException, ArtifactNotFoundException
     {
-        ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, pomFile );
-        sourceArtifact.addMetadata( meta );
+        Artifact sourceArtifact = artifactFactory.createBuildArtifact( dependency.getGroupId(),
+                                                                       dependency.getArtifactId(),
+                                                                       dependency.getVersion(),
dependency.getType() );
+        //Resolve the JavaBinding for the .NET plugin
+        ArtifactRepository localArtifactRepository =
+            new DefaultArtifactRepository( "local", "file://" + localRepository, new DefaultRepositoryLayout()
);
+        if ( sourceArtifact.getType().equals( ArtifactType.NETPLUGIN.getPackagingType() )
)
+        {
+            Artifact javaBindingArtifact = artifactFactory.createBuildArtifact( sourceArtifact.getGroupId(),
+                                                                                sourceArtifact.getArtifactId()
+
+                                                                                    ".JavaBinding",
+                                                                                sourceArtifact.getVersion(),
"jar" );
+            try
+            {
+                resolver.resolve( javaBindingArtifact, project.getRemoteArtifactRepositories(),
+                                  localArtifactRepository );
+            }
+            catch ( ArtifactResolutionException e )
+            {
+                throw new ArtifactNotFoundException( "", sourceArtifact );
+            }
+        }
 
+        //Resolve all the specified dependencies
+        localArtifactRepository =
+            new DefaultArtifactRepository( "local", "file://" + localRepository, new AssemblyRepositoryLayout()
);
         Set<Artifact> artifactDependencies = new HashSet<Artifact>();
         artifactDependencies.add( sourceArtifact );
-        ArtifactRepository localArtifactRepository =
-            new DefaultArtifactRepository( "local", "file://" + localRepository, new AssemblyRepositoryLayout()
);
+        ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, pomFile );
+        sourceArtifact.addMetadata( meta );
         ArtifactResolutionResult result;
         try
         {
@@ -357,6 +378,7 @@
             throw new ArtifactNotFoundException( "", sourceArtifact );
         }
 
+        //Do local installing of the dependencies into exe and netplugin repo directories
         AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
         Set<Artifact> artifacts = result.getArtifacts();
         File destDir = new File( localRepository, layout.pathOf( sourceArtifact ) ).getParentFile();

Modified: incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=536615&r1=536614&r2=536615
==============================================================================
--- incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml
(original)
+++ incubator/nmaven/branches/SI_XPT/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml
Wed May  9 11:49:17 2007
@@ -40,7 +40,7 @@
         </requirement>
         <requirement>
           <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
-        </requirement>
+        </requirement>        
       </requirements>
     </component>
     <component>

Modified: incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/pom.xml?view=diff&rev=536615&r1=536614&r2=536615
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/pom.xml (original)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/pom.xml Wed May  9 11:49:17
2007
@@ -38,6 +38,11 @@
       <artifactId>maven-artifact</artifactId>
       <version>2.1-SNAPSHOT</version>
     </dependency>
+    <dependency>
+      <groupId>NMaven.Plugin</groupId>
+      <artifactId>NMaven.Plugin.Settings.JavaBinding</artifactId>
+      <version>0.14</version>
+    </dependency>
   </dependencies>
   <build>
     <plugins>

Modified: incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java?view=diff&rev=536615&r1=536614&r2=536615
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java
(original)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-compile-plugin/src/main/java/org/apache/maven/dotnet/plugin/compile/SourceProcessorMojo.java
Wed May  9 11:49:17 2007
@@ -122,6 +122,10 @@
         String[] files = directoryScanner.getIncludedFiles();
         getLog().info( "NMAVEN-904-002: Copying source files: From = " + sourceDirectory
+ ",  To = " +
             outputDirectory + ", File Count = " + files.length );
+
+        //Boolean sourceFilesUpToDate = Boolean.TRUE;
+        //super.getPluginContext().put("SOURCE_FILES_UP_TO_DATE", sourceFilesUpToDate );
+
         for ( String file : files )
         {
             try
@@ -130,6 +134,7 @@
                 File targetFile = new File( outputDirectory + File.separator + file );
                 if ( sourceFile.lastModified() > targetFile.lastModified() )
                 {
+                    //sourceFilesUpToDate = Boolean.FALSE;
                     FileUtils.copyFile( sourceFile, targetFile );
                 }
             }

Modified: incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java?view=diff&rev=536615&r1=536614&r2=536615
==============================================================================
--- incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
(original)
+++ incubator/nmaven/branches/SI_XPT/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
Wed May  9 11:49:17 2007
@@ -27,7 +27,6 @@
 import org.apache.maven.artifact.installer.ArtifactInstallationException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.dotnet.registry.RepositoryRegistry;
 
 import java.io.File;
@@ -98,11 +97,6 @@
     /**
      * @component
      */
-    private ArtifactFactory artifactFactory;
-
-    /**
-     * @component
-     */
     private org.apache.maven.dotnet.NMavenRepositoryRegistry nmavenRegistry;
 
     /**
@@ -192,13 +186,9 @@
         matchPolicies.add( new ExecutableAndNetPluginMatchPolicy() );
         for ( Dependency dependency : repository.getDependenciesFor( matchPolicies ) )
         {
-            Artifact artifact = artifactFactory.createBuildArtifact( dependency.getGroupId(),
-                                                                     dependency.getArtifactId(),
-                                                                     dependency.getVersion(),
dependency.getType() );
-
             try
             {
-                artifactContext.getArtifactInstaller().resolveAndInstallLibraryDependenciesFor(
artifact, pomFile );
+                artifactContext.getArtifactInstaller().resolveAndInstallLibraryDependenciesFor(
dependency, pomFile );
 
             }
             catch ( ArtifactNotFoundException e )



Mime
View raw message