incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r559454 [2/4] - in /incubator/nmaven/trunk: ./ archetypes/ archetypes/maven-archetype-dotnet-simple/ archetypes/maven-archetype-netexecutable/ assemblies/ assemblies/NMaven.Artifact/ assemblies/NMaven.Artifact/src/main/csharp/ assemblies/NM...
Date Wed, 25 Jul 2007 13:34:57 GMT
Modified: incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java Wed Jul 25 06:34:15 2007
@@ -29,14 +29,9 @@
 import org.apache.maven.artifact.handler.ArtifactHandler;
 import org.apache.maven.artifact.handler.manager.ArtifactHandlerManager;
 import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.repository.DefaultArtifactRepository;
-import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
-import org.apache.maven.artifact.resolver.*;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.project.MavenProject;
-import org.apache.maven.model.Dependency;
 
 /**
  * Provides an implemenation of the <code>ArtifactContext</code> interface.
@@ -48,11 +43,6 @@
 {
 
     /**
-     * A layout component used in the creation of a .NET artifact repository.
-     */
-    private ArtifactRepositoryLayout layout;
-
-    /**
      * Metadata component used by the <code>ArtifactResolver</code>.
      */
     private ArtifactMetadataSource metadata;
@@ -73,12 +63,6 @@
     private RepositoryRegistry repositoryRegistry;
 
     /**
-     * An artifact resolver component for locating artifacts and pulling them into the local repo if they do not
-     * already exist.
-     */
-    private ArtifactResolver artifactResolver;
-
-    /**
      * The maven project
      */
     private MavenProject project;
@@ -117,7 +101,8 @@
      */
     public File getLocalRepository()
     {
-        return new File( localRepository );
+        return ( localRepository != null ) ? new File( localRepository )
+            : new File( System.getProperty( "user.home" ), "/.m2/repository" );
     }
 
     /**
@@ -136,10 +121,9 @@
         }
         repository.init( artifactFactory );
         List<Artifact> artifacts = repository.getArtifactsFor( groupId, artifactId, version, type );
-        AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
         for ( Artifact artifact : artifacts )
         {
-            artifact.setFile( new File( localRepository + File.separator + layout.pathOf( artifact ) ) );
+            artifact.setFile( PathUtil.getUserAssemblyCacheFileFor( artifact, getLocalRepository() ) );
         }
         return artifacts;
     }
@@ -173,85 +157,9 @@
     }
 
     /**
-     * @see ArtifactContext#getDirectDependenciesFor(org.apache.maven.artifact.Artifact,
-     *      java.util.List<org.apache.maven.dotnet.artifact.ArtifactMatchPolicy>)
-     */
-    public List<Artifact> getDirectDependenciesFor( Artifact artifact, List<ArtifactMatchPolicy> matchPolicies )
-        throws ArtifactException
-    {
-        if ( artifact == null )
-        {
-            throw new ArtifactException( "NMAVEN-000-001: Cannot get dependenct artifacts of a null artifact" );
-        }
-
-        if ( matchPolicies == null )
-        {
-            matchPolicies = new ArrayList<ArtifactMatchPolicy>();
-        }
-
-        List<Artifact> dependencies = new ArrayList<Artifact>();
-        ArtifactResolutionResult result;
-        ArtifactRepository ar = new DefaultArtifactRepository( "local", "file://" + localRepository, layout );
-
-        Set depSet = new HashSet();
-        List<Dependency> dep = project.getDependencies();
-
-        for ( Dependency dependency : dep )
-        {
-            String scope = ( dependency.getScope() == null ) ? Artifact.SCOPE_COMPILE : dependency.getScope();
-            Artifact art = artifactFactory.createDependencyArtifact( dependency.getGroupId(),
-                                                                     dependency.getArtifactId(),
-                                                                     VersionRange.createFromVersion(
-                                                                         dependency.getVersion() ),
-                                                                     dependency.getType(), dependency.getClassifier(),
-                                                                     scope, null );
-            if ( !art.getType().startsWith( "gac" ) )
-            {
-                depSet.add( art );
-            }
-        }
-
-        try
-        {
-            result = artifactResolver.resolveTransitively( depSet, project.getArtifact(),
-                                                           project.getRemoteArtifactRepositories(), ar, metadata );
-        }
-        catch ( ArtifactResolutionException e )
-        {
-            throw new ArtifactException( "NMAVEN-000-002: Failed to Resolve Artifact: File = " + artifact.getFile() +
-                ", Local Repository = " + localRepository, e );
-        }
-        catch ( ArtifactNotFoundException e )
-        {
-            throw new ArtifactException( "NMAVEN-000-003: Artifact Not Found: File = " + artifact.getFile() +
-                ", Local Repository = " + localRepository, e );
-        }
-        Set<ResolutionNode> nodes = result.getArtifactResolutionNodes();
-        if ( nodes.size() == 0 )
-        {
-            logger.debug(
-                "NMAVEN-000-004: Project has no direct or transitive dependencies. " + project.getArtifacts().size() );
-        }
-
-        for ( ResolutionNode node : nodes )
-        {
-            Artifact nodeArtifact = node.getArtifact();
-            boolean isMatched = matchArtifacts( nodeArtifact, matchPolicies );
-            logger.debug( "NMAVEN-000-005: Artifact = " + nodeArtifact.getFile().getAbsolutePath() + ", Depth = " +
-                node.getDepth() + ", Matches Policies = " + isMatched );
-            if ( isMatched && node.getDepth() == 1 )
-            {
-                dependencies.add( nodeArtifact );
-            }
-        }
-
-        logger.debug( "NMAVEN-000-006: Resolved Artifact Dependencies: Count = " + dependencies.size() );
-        return dependencies;
-    }
-
-    /**
      * @see ArtifactContext#getNetModulesFor(org.apache.maven.artifact.Artifact)
      */
+    //TODO: support temporarily removed
     public List<Artifact> getNetModulesFor( Artifact artifact )
         throws ArtifactException
     {
@@ -261,7 +169,8 @@
         }
         List<ArtifactMatchPolicy> matchPolicies = new ArrayList<ArtifactMatchPolicy>();
         matchPolicies.add( new NetModuleMatchPolicy() );
-        return getDirectDependenciesFor( artifact, matchPolicies );
+        return null;
+        //return getDirectDependenciesFor( artifact, matchPolicies );
     }
 
     public List<Artifact> getAllNetArtifactsFromRepository( File repository )
@@ -277,7 +186,7 @@
     {
         this.project = mavenProject;
         this.localRepository = localRepository.getAbsolutePath();
-        artifactInstaller.init( this, mavenProject, remoteArtifactRepositories, localRepository );
+        artifactInstaller.init( this, remoteArtifactRepositories, localRepository );
         Map<String, ArtifactHandler> map = new HashMap<String, ArtifactHandler>();
         for ( ArtifactHandler artifactHandler : artifactHandlers )
         {

Modified: incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java Wed Jul 25 06:34:15 2007
@@ -18,25 +18,22 @@
  */
 package org.apache.maven.dotnet.artifact.impl;
 
-import org.apache.maven.dotnet.artifact.ArtifactException;
 import org.apache.maven.dotnet.artifact.ArtifactContext;
-import org.apache.maven.dotnet.artifact.AssemblyRepositoryLayout;
 import org.apache.maven.dotnet.artifact.ApplicationConfig;
 import org.apache.maven.dotnet.artifact.ArtifactType;
 import org.apache.maven.dotnet.artifact.NetDependencyMatchPolicy;
 import org.apache.maven.dotnet.artifact.NetDependenciesRepository;
 import org.apache.maven.dotnet.artifact.AssemblyResolver;
+import org.apache.maven.dotnet.artifact.PathUtil;
 import org.apache.maven.dotnet.registry.RepositoryRegistry;
 import org.apache.maven.dotnet.model.netdependency.NetDependency;
+import org.apache.maven.dotnet.dao.ProjectDao;
 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.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolver;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.metadata.ArtifactMetadata;
 import org.apache.maven.artifact.metadata.ArtifactMetadataSource;
 import org.apache.maven.artifact.factory.ArtifactFactory;
 import org.apache.maven.artifact.installer.ArtifactInstallationException;
@@ -57,7 +54,6 @@
 import java.io.IOException;
 import java.io.FileWriter;
 import java.io.FileReader;
-import java.io.FileNotFoundException;
 import java.util.List;
 import java.util.ArrayList;
 import java.util.Set;
@@ -78,11 +74,6 @@
     private org.apache.maven.artifact.installer.ArtifactInstaller mavenInstaller;
 
     /**
-     * The maven project
-     */
-    private MavenProject project;
-
-    /**
      * Root path of the local Maven repository
      */
     private File localRepository;
@@ -99,11 +90,6 @@
     private ArtifactRepository artifactRepository;
 
     /**
-     * The default repository layout for .NET artifacts. This is used in the construction of the artifact repository.
-     */
-    private AssemblyRepositoryLayout assemblyRepositoryLayout;
-
-    /**
      * A logger for writing log messages
      */
     private Logger logger;
@@ -130,6 +116,11 @@
 
     private List<ArtifactRepository> remoteArtifactRepositories;
 
+    private org.apache.maven.dotnet.registry.DataAccessObjectRegistry daoRegistry;
+
+    private org.apache.maven.artifact.manager.WagonManager wagonManager;
+
+
     /**
      * Constructor. This method is intended to by invoked by the plexus-container, not by the application developer.
      */
@@ -137,6 +128,12 @@
     {
     }
 
+    protected void initTest( ArtifactFactory artifactFactory, Logger logger )
+    {
+        this.artifactFactory = artifactFactory;
+        this.logger = logger;
+    }
+
     /**
      * @see LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger)
      */
@@ -159,92 +156,122 @@
         matchPolicies.add( new ProfileMatchPolicy( profile ) );
         dependencies.addAll( repository.getDependenciesFor( matchPolicies ) );
 
-        ArtifactRepository localArtifactRepository = new DefaultArtifactRepository( "local", "file://" +
-            localRepository.getAbsolutePath(), new AssemblyRepositoryLayout() );
-
-        assemblyResolver.resolveTransitivelyFor( project, project.getArtifact(), dependencies,
-                                                 remoteArtifactRepositories, localArtifactRepository, false );
+        assemblyResolver.resolveTransitivelyFor( new MavenProject(), dependencies, remoteArtifactRepositories,
+                                                 localRepository, false );
 
         //Do Library Installs for Net Dependencies
         matchPolicies = new ArrayList<NetDependencyMatchPolicy>();
         matchPolicies.add( new ProfileMatchPolicy( profile ) );
         matchPolicies.add( new ExecutableAndNetPluginAndAddinMatchPolicy() );
-        for ( Dependency dependency : repository.getDependenciesFor( matchPolicies ) )
+
+        for ( Dependency dependency : dependencies )
         {
-            resolveAndInstallLibraryDependenciesFor( dependency );
+            Artifact sourceArtifact = artifactFactory.createBuildArtifact( dependency.getGroupId(),
+                                                                           dependency.getArtifactId(),
+                                                                           dependency.getVersion(),
+                                                                           dependency.getType() );
+            //Resolve the JavaBinding for the .NET plugin
+            ArtifactRepository localArtifactRepo =
+                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, remoteArtifactRepositories, localArtifactRepo );
+                }
+                catch ( ArtifactResolutionException e )
+                {
+                    throw new ArtifactNotFoundException( "", sourceArtifact );
+                }
+            }
         }
+
+        installArtifactAndDependenciesIntoPrivateApplicationBase( new File( localRepository.getParentFile(), "pab" ),
+                                                                  null,
+                                                                  repository.getDependenciesFor( matchPolicies ) );
     }
 
-    /**
-     * @see org.apache.maven.dotnet.artifact.ArtifactInstaller#installArtifact(org.apache.maven.artifact.Artifact,java.io.File,boolean)
-     */
-    public void installArtifact( Artifact artifact, File pomFile, boolean modifyProjectMetadata )
+    public void installArtifactAndDependenciesIntoPrivateApplicationBase( File applicationBase, Artifact artifact,
+                                                                          List<Dependency> dependencies )
         throws ArtifactInstallationException
     {
-        installNetModules( artifact );
-        ApplicationConfig applicationConfig = artifactContext.getApplicationConfigFor( artifact );
-        File configExeFile = new File( applicationConfig.getConfigDestinationPath() );
-        //TODO: Remove GAC dependencies before installing. This should be removed and replaced with solution in the core.
-        artifact.getMetadataList().clear();
-        if ( modifyProjectMetadata )
+
+        Set<Artifact> artifactDependencies = new HashSet<Artifact>();
+        for ( Dependency dependency : dependencies )
         {
-            try
+            String scope = ( dependency.getScope() == null ) ? Artifact.SCOPE_COMPILE : dependency.getScope();
+            Artifact artifactDependency = artifactFactory.createDependencyArtifact( dependency.getGroupId(),
+                                                                                    dependency.getArtifactId(),
+                                                                                    VersionRange.createFromVersion(
+                                                                                        dependency.getVersion() ),
+                                                                                    dependency.getType(),
+                                                                                    dependency.getClassifier(), scope,
+                                                                                    null );
+            artifactDependency.setFile( PathUtil.getUserAssemblyCacheFileFor( artifactDependency, localRepository ) );
+            artifactDependencies.add( artifactDependency );
+        }
+
+        if ( artifact != null )
+        {
+            artifactDependencies.add( artifact );
+        }
+        System.out.println( "Copying into PAB. Count = " + artifactDependencies.size() );
+        for ( Artifact artifactDependency : artifactDependencies )
+        {
+            if ( !artifactDependency.getType().startsWith( "gac" ) )
             {
-                List<Dependency> dependencies = project.getDependencies();
-                List<Dependency> newDependencies = new ArrayList<Dependency>();
-                for ( Dependency dependency : dependencies )
+                try
                 {
-                    if ( !dependency.getType().startsWith( "gac" ) )
+                    logger.info( "NMAVEN-002-018: Installing file into repository: File = " +
+                        artifactDependency.getFile().getAbsolutePath() );
+                    try
                     {
-                        newDependencies.add( dependency );
+                        FileUtils.copyFileToDirectory( artifactDependency.getFile(), applicationBase );
+                    }
+                    catch ( IOException e )
+                    {
+                        throw new ArtifactInstallationException( "NMAVEN-002-003a: Failed to install artifact: ID = " +
+                            artifactDependency.getId() + ", File = " + ( ( artifactDependency.getFile() != null )
+                            ? artifactDependency.getFile().getAbsolutePath() : "" ), e );
                     }
                 }
-                project.setDependencies( newDependencies );
-                artifact.addMetadata( createArtifactMetadataFor( artifact, pomFile, project.getDependencies() ) );
-            }
-            catch ( IOException e )
-            {
-                throw new ArtifactInstallationException( "NMAVEN-002-001: Unable to add metadata to artifact", e );
+                catch ( ArtifactInstallationException e )
+                {
+                    throw new ArtifactInstallationException( "NMAVEN-002-003: Failed to install artifact: ID = " +
+                        artifactDependency.getId() + ", File = " + ( ( artifactDependency.getFile() != null )
+                        ? artifactDependency.getFile().getAbsolutePath() : "" ), e );
+                }
             }
-            //End GAC HACK
         }
+    }
 
+    /**
+     * @see org.apache.maven.dotnet.artifact.ArtifactInstaller#installArtifactWithPom(org.apache.maven.artifact.Artifact,java.io.File,boolean)
+     */
+    public void installArtifactWithPom( Artifact artifact, File pomFile, boolean modifyProjectMetadata )
+        throws ArtifactInstallationException
+    {
+        ApplicationConfig applicationConfig = artifactContext.getApplicationConfigFor( artifact );
+        File configExeFile = new File( applicationConfig.getConfigDestinationPath() );
         if ( configExeFile.exists() )
         {
-            logger.info( "NMAVEN-002-000: Found config executable: File = " + configExeFile.getAbsolutePath() );
-            Dependency configExeDependency = new Dependency();
-            configExeDependency.setArtifactId( project.getArtifactId() );
-            configExeDependency.setGroupId( project.getGroupId() );
-            configExeDependency.setVersion( project.getVersion() );
-            configExeDependency.setType( "exe.config" );
-            configExeDependency.setScope( Artifact.SCOPE_RUNTIME );
-            List<Dependency> dep = new ArrayList<Dependency>();
-            dep.add( configExeDependency );
-            project.setDependencies( dep );
-            artifact.getMetadataList().clear();
-            try
-            {
-                artifact.addMetadata( createArtifactMetadataFor( artifact, pomFile, dep ) );
-            }
-            catch ( IOException e )
-            {
-                throw new ArtifactInstallationException( "NMAVEN-002-001: Unable to add metadata to artifact", e );
-            }
-            File targetDirectory =
-                new File( localRepository, assemblyRepositoryLayout.pathOf( artifact ) ).getParentFile();
             try
             {
-                FileUtils.copyFileToDirectory( configExeFile, targetDirectory );
+                FileUtils.copyFileToDirectory( configExeFile, PathUtil.getUserAssemblyCacheFileFor( artifact,
+                                                                                                    localRepository ).getParentFile() );
             }
             catch ( IOException e )
             {
-                throw new ArtifactInstallationException( "NMAVEN-002-002: Failed to copy config.exe file", e );
+                throw new ArtifactInstallationException( "NMAVEN-002-003b: Failed to install artifact: ID = " +
+                    artifact.getId() + ", File = " +
+                    ( ( artifact.getFile() != null ) ? artifact.getFile().getAbsolutePath() : "" ), e );
             }
         }
-        else
-        {
-            logger.debug( "NMAVEN-002-014: No exe.config file found: File = " + configExeFile.getAbsolutePath() );
-        }
 
         try
         {
@@ -253,18 +280,10 @@
                 logger.info(
                     "NMAVEN-002-018: Installing file into repository: File = " + artifact.getFile().getAbsolutePath() );
                 File artifactFile = artifact.getFile();
-
-                if(!modifyProjectMetadata)
-                {
-                    artifact.addMetadata( new ArtifactMetadataImpl( artifact, pomFile ) );
-                }
-
-                mavenInstaller.install( artifactFile, artifact, artifactRepository );
-               //This extra copy needed in using of SNAPSHOTS
                 try
                 {
                     FileUtils.copyFile( artifactFile,
-                                        new File( localRepository, new DefaultRepositoryLayout().pathOf( artifact ) ) );
+                                        PathUtil.getUserAssemblyCacheFileFor( artifact, localRepository ) );
                 }
                 catch ( IOException e )
                 {
@@ -272,7 +291,6 @@
                         artifact.getId() + ", File = " +
                         ( ( artifact.getFile() != null ) ? artifact.getFile().getAbsolutePath() : "" ), e );
                 }
-
             }
             else
             {
@@ -286,392 +304,79 @@
                 artifact.getId() + ", File = " +
                 ( ( artifact.getFile() != null ) ? artifact.getFile().getAbsolutePath() : "" ), e );
         }
-    }
-
-    /**
-     * @see org.apache.maven.dotnet.artifact.ArtifactInstaller#installFileWithGeneratedPom(String, String, String, String, java.io.File)
-     */
-    public void installFileWithGeneratedPom( String groupId, String artifactId, String version, String packaging,
-                                             File artifactFile )
-        throws ArtifactInstallationException
-    {
-        Artifact artifact =
-            artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, null );
-        artifact.setFile( artifactFile );
-
-        FileWriter fileWriter = null;
-        try
-        {
-            File tempFile = File.createTempFile( "mvninstall", ".pom" );
-            tempFile.deleteOnExit();
-            fileWriter = new FileWriter( tempFile );
-
-            Model model = new Model();
-            model.setModelVersion( "4.0.0" );
-            model.setGroupId( groupId );
-            model.setArtifactId( artifactId );
-            model.setVersion( version );
-            model.setPackaging( packaging );
-            new MavenXpp3Writer().write( fileWriter, model );
-            artifact.addMetadata( new ArtifactMetadataImpl( artifact, tempFile ) );
-        }
-        catch ( IOException e )
-        {
-            throw new ArtifactInstallationException( "NMAVEN-002-004: Failed to create pom file: Group Id = " +
-                groupId + ", artifactId = " + artifactId + ", Version = " + version + ", packaging = " + packaging, e );
-        }
-        finally
-        {
-            IOUtil.close( fileWriter );
-        }
-
-        try
-        {
-            mavenInstaller.install( artifact.getFile(), artifact, artifactRepository );
-        }
-        catch ( ArtifactInstallationException e )
-        {
-            throw new ArtifactInstallationException( "NMAVEN-002-005: Failed to install artifact: ID = " +
-                artifact.getId() + ", File = " + artifact.getFile().getAbsolutePath(), e );
-        }
-
-    }
-
-    public void installFileWithNoPom( String groupId, String artifactId, String version, File installFile )
-        throws ArtifactInstallationException
-    {
-        StringBuffer path = new StringBuffer();
-        path.append( localRepository.getAbsolutePath() ).append( File.separator );
-        for ( String id : groupId.split( "[.]" ) )
-        {
-            path.append( id ).append( File.separator );
-        }
-
-        path.append( artifactId ).append( File.separator )
-            .append( version ).append( File.separator );
-
-        logger.info( "NMAVEN-002-014: Installing File: From = " + installFile.getAbsolutePath() + ", To = " +
-            path.toString() + artifactId + ".dll" );
-        try
-        {
-            FileUtils.copyFileToDirectory( installFile, new File( path.toString() ) );
-        }
-        catch ( IOException e )
-        {
-            throw new ArtifactInstallationException( "NMAVEN-002-015: Failed to copy artifact to local repository", e );
-        }
-    }
-
-    public void installLibraryDependencies( Artifact projectArtifact, List<Dependency> dependencies )
-        throws ArtifactInstallationException
-    {
-        StringBuffer path = new StringBuffer();
-        path.append( localRepository.getAbsolutePath() ).append( File.separator );
-        for ( String id : projectArtifact.getGroupId().split( "[.]" ) )
-        {
-            path.append( id ).append( File.separator );
-        }
-
-        path.append( projectArtifact.getArtifactId() ).append( File.separator )
-            .append( projectArtifact.getBaseVersion() ).append( File.separator );
-
-        for ( Dependency dependency : dependencies )
-        {
-            if ( ! ( dependency.getType().equals( "library" ) || dependency.getType().equals( "netplugin" ) ) )
-            {
-                continue;
-            }
-            StringBuffer depPath = new StringBuffer();
-            depPath.append( localRepository.getAbsolutePath() ).append( File.separator );
-            for ( String id : dependency.getGroupId().split( "[.]" ) )
-            {
-                depPath.append( id ).append( File.separator );
-            }
-
-            depPath.append( dependency.getArtifactId() ).append( File.separator )
-                .append( dependency.getVersion() ).append( File.separator );
-            String extension = ArtifactType.getArtifactTypeForPackagingName( dependency.getType() ).getExtension();
-            File file = new File( depPath.toString() + dependency.getArtifactId() + "." + extension );
-
-            try
-            {
-                logger.info( "NMAVEN-002-016: Installing File: From = " + file.getAbsolutePath() + ", To = " +
-                    path.toString() + dependency.getArtifactId() + "." + extension );
-                FileUtils.copyFileToDirectory( file, new File( path.toString() ) );
-            }
-            catch ( IOException e )
-            {
-                throw new ArtifactInstallationException(
-                    "NMAVEN-002-017: Failed to install file into repo: File Name = " + file.getAbsolutePath() +
-                        ", Extension = " + extension + ", Type = " + dependency.getType(), e );
-            }
-        }
-    }
-
-    public void resolveAndInstallLibraryDependenciesFor( Dependency dependency )
-        throws ArtifactInstallationException, ArtifactNotFoundException
-    {
-
-        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, remoteArtifactRepositories, localArtifactRepository );
-            }
-            catch ( ArtifactResolutionException e )
-            {
-                throw new ArtifactNotFoundException( "", sourceArtifact );
-            }
-        }
 
-        //Resolve all the specified dependencies
-        Artifact pomArtifact = artifactFactory.createProjectArtifact( dependency.getGroupId(),
-                                                                      dependency.getArtifactId(),
-                                                                      dependency.getVersion() );
-        File pomArtifactFile = new File( localRepository, new AssemblyRepositoryLayout().pathOf( pomArtifact ) );
-        FileReader fileReader;
-        try
-        {
-            fileReader = new FileReader( pomArtifactFile );
-        }
-        catch ( FileNotFoundException e )
-        {
-            throw new ArtifactNotFoundException( "NMAVEN-000-000: Unable to read pom", sourceArtifact );
-        }
         MavenXpp3Reader reader = new MavenXpp3Reader();
         Model model;
         try
         {
-            model = reader.read( fileReader );
+            model = reader.read( new FileReader( pomFile ) );
         }
         catch ( XmlPullParserException e )
         {
-            throw new ArtifactNotFoundException( "NMAVEN-000-000: Unable to read model", sourceArtifact );
-
+            throw new ArtifactInstallationException( "NMAVEN-002-013: Unable to read pom file" );
         }
         catch ( IOException e )
         {
-            throw new ArtifactNotFoundException( "NMAVEN-000-000: Unable to read model", sourceArtifact );
-        }
-        List<Dependency> sourceArtifactDependencies = model.getDependencies();
-        localArtifactRepository =
-            new DefaultArtifactRepository( "local", "file://" + localRepository, new AssemblyRepositoryLayout() );
-        Set<Artifact> artifactDependencies = new HashSet<Artifact>();
-        for ( Dependency d : sourceArtifactDependencies )
-        {
-            String scope = ( d.getScope() == null ) ? Artifact.SCOPE_COMPILE : d.getScope();
-            Artifact artifact1 = artifactFactory.createDependencyArtifact( d.getGroupId(), d.getArtifactId(),
-                                                                           VersionRange.createFromVersion(
-                                                                               d.getVersion() ), d.getType(),
-                                                                                                 d.getClassifier(),
-                                                                                                 scope, null );
-            artifactDependencies.add( artifact1 );
-
+            throw new ArtifactInstallationException( "NMAVEN-002-013: Unable to read pom file" );
         }
+        //TODO: Add this back in: since this is already done in the resolve phase, don't redo it for perf reasons.
 
-        ArtifactMetadataImpl meta = new ArtifactMetadataImpl( sourceArtifact, null );
-        sourceArtifact.addMetadata( meta );
-        ArtifactResolutionResult result;
+        ProjectDao dao = (ProjectDao) daoRegistry.find( "dao:project" );
+        dao.openConnection();
         try
         {
-            result = resolver.resolveTransitively( artifactDependencies, sourceArtifact, localArtifactRepository,
-                                                   remoteArtifactRepositories, metadata, new ArtifactFilter()
-            {
-                public boolean include( org.apache.maven.artifact.Artifact artifact )
-                {
-                    return !artifact.getType().startsWith( "gac" );
-                }
-            } );
+            dao.storeModelAndResolveDependencies( model, pomFile.getParentFile(), null,
+                                                  new ArrayList<ArtifactRepository>() );
         }
-        catch ( ArtifactResolutionException e )
+        catch ( java.io.IOException e )
         {
-            throw new ArtifactNotFoundException( "NMAVEN-000-000: ", sourceArtifact );
+            throw new ArtifactInstallationException( e.getMessage() );
         }
-
-        //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();
-        for ( Artifact artifact : artifacts )
+        finally
         {
-            File destFile = new File( destDir, artifact.getFile().getName() );
-            if ( !destFile.exists() || destFile.lastModified() < artifact.getFile().lastModified() )
-            {
-                try
-                {
-                    FileUtils.copyFileToDirectory( artifact.getFile(), destDir );
-                }
-                catch ( IOException e )
-                {
-                    e.printStackTrace();
-                }
-            }
+            dao.closeConnection();
         }
+        
     }
 
     /**
-     * @see org.apache.maven.dotnet.artifact.ArtifactInstaller#installNetModulesToTargetDirectory(org.apache.maven.artifact.Artifact)
+     * @see org.apache.maven.dotnet.artifact.ArtifactInstaller#installFileWithoutPom(String, String, String, String, java.io.File)
      */
-    public void installNetModulesToTargetDirectory( Artifact projectArtifact )
+    public void installFileWithoutPom( String groupId, String artifactId, String version, String packaging,
+                                       File artifactFile )
         throws ArtifactInstallationException
     {
-        String targetDirectory = project.getBuild().getDirectory();
-        List<Artifact> dependencies;
+        Artifact artifact =
+            artifactFactory.createArtifactWithClassifier( groupId, artifactId, version, packaging, null );
+        artifact.setFile( artifactFile );
+        Model model = new Model();
+        model.setGroupId( groupId );
+        model.setArtifactId( artifactId );
+        model.setVersion( version );
+        model.setPackaging( packaging );
+        File tempFile;
+        FileWriter fileWriter;
         try
         {
-            dependencies = artifactContext.getNetModulesFor( projectArtifact );
-        }
-        catch ( ArtifactException e )
-        {
-            throw new ArtifactInstallationException( "NMAVEN-002-006: Unable to obtain .NET Modules: ", e );
-        }
-
-        if ( dependencies.isEmpty() )
-        {
-            logger.info( "NMAVEN-002-007: No dependencies to install into the target directory." );
-            return;
+            tempFile = File.createTempFile( "mvninstall", ".pom" );
+            tempFile.deleteOnExit();
+            fileWriter = new FileWriter( tempFile );
+            new MavenXpp3Writer().write( fileWriter, model );
         }
-
-        for ( Artifact artifact : dependencies )
+        catch ( IOException e )
         {
-            logger.info( "NMAVEN-002-008: Copying .NET module dependency into project's target directory: Module = " +
-                targetDirectory + File.separator + artifact.getFile().getName() );
-            try
-            {
-                File targetDirectoryFile = new File( targetDirectory );
-                if ( new File( targetDirectoryFile, artifact.getFile().getName() ).lastModified() <
-                    artifact.getFile().lastModified() )
-                {
-                    FileUtils.copyFileToDirectory( artifact.getFile(), targetDirectoryFile );
-                }
-            }
-            catch ( IOException e )
-            {
-                throw new ArtifactInstallationException(
-                    "NMAVEN-002-009: Failed to copy artifacts to target directory: " + "Target Directory = " +
-                        targetDirectory, e );
-            }
+            throw new ArtifactInstallationException( e.getMessage() );
         }
+        IOUtil.close( fileWriter );
+        installArtifactWithPom( artifact, tempFile, false );
     }
 
-    /**
-     * @see org.apache.maven.dotnet.artifact.ArtifactInstaller#init(org.apache.maven.dotnet.artifact.ArtifactContext,org.apache.maven.project.MavenProject,java.util.List, File
-     */
-    public void init( ArtifactContext artifactContext, MavenProject mavenProject,
-                      List<ArtifactRepository> remoteArtifactRepositories, File localRepository )
+    public void init( ArtifactContext artifactContext, List<ArtifactRepository> remoteArtifactRepositories,
+                      File localRepository )
     {
-        this.project = mavenProject;
         this.remoteArtifactRepositories = remoteArtifactRepositories;
         this.localRepository = localRepository;
         this.artifactContext = artifactContext;
-        this.assemblyRepositoryLayout = new AssemblyRepositoryLayout();
-        artifactRepository = new DefaultArtifactRepository( "local", "file://" + localRepository.getAbsolutePath(),
-                                                            assemblyRepositoryLayout );
-    }
-
-    /**
-     * Installs .netmodule artifacts into the local maven repository
-     *
-     * @param projectArtifact the artifact to install
-     * @throws ArtifactInstallationException if there is a problem installing the artifact
-     */
-    private void installNetModules( Artifact projectArtifact )
-        throws ArtifactInstallationException
-    {
-        StringBuffer path = new StringBuffer();
-        path.append( localRepository.getAbsolutePath() ).append( File.separator );
-        for ( String id : projectArtifact.getGroupId().split( "[.]" ) )
-        {
-            path.append( id ).append( File.separator );
-        }
-
-        path.append( projectArtifact.getArtifactId() ).append( File.separator )
-            .append( projectArtifact.getBaseVersion() ).append( File.separator );
-        List<Artifact> artifacts;
-        try
-        {
-            artifacts = artifactContext.getNetModulesFor( project.getArtifact() );
-        }
-        catch ( ArtifactException e )
-        {
-            throw new ArtifactInstallationException( "NMAVEN-002-010: Unable to obtain .NET Modules: ", e );
-        }
-
-        for ( Artifact artifact : artifacts )
-        {
-            logger.info( "NMAVEN-002-011: Installing .NET Module Dependency: From = " +
-                artifact.getFile().getAbsolutePath() + ", To = " + path.toString() + artifact.getArtifactId() +
-                ".netmodule" );
-            try
-            {
-                FileUtils.copyFileToDirectory( artifact.getFile(), new File( path.toString() ) );
-            }
-            catch ( IOException e )
-            {
-                throw new ArtifactInstallationException( "NMAVEN-002-012: Failed to copy artifacts to local repository",
-                                                         e );
-            }
-        }
-    }
-
-    /**
-     * Creates the artifact metadata file for the specified artifact.
-     *
-     * @param artifact     the artifact associated with the artifact metadata
-     * @param pomFile      the pom file of the specified artifact
-     * @param dependencies the dependencies of the specified artifact
-     * @return the artifact metadata file for the specified artifact.
-     * @throws IOException if there is a problem reading the pom file
-     */
-    private ArtifactMetadata createArtifactMetadataFor( Artifact artifact, File pomFile, List<Dependency> dependencies )
-        throws IOException
-    {
-        FileReader fileReader = new FileReader( pomFile );
-        MavenXpp3Reader reader = new MavenXpp3Reader();
-        Model model;
-        try
-        {
-            model = reader.read( fileReader );
-        }
-        catch ( XmlPullParserException e )
-        {
-            e.printStackTrace();
-            throw new IOException( "NMAVEN-002-013: Unable to read pom file" );
-        }
-        List<Dependency> dest = new ArrayList<Dependency>();
-        dest.addAll( model.getDependencies() );
-        for ( Dependency dependency : dest )
-        {
-            model.removeDependency( dependency );
-        }
-
-        for ( Dependency dependency : dependencies )
-        {
-            //TODO: This condition is only here since transitive gac dependencies break the build. This needs to be fixed
-            //within the core.
-            if ( !dependency.getType().startsWith( "gac" ) )
-            {
-                model.addDependency( dependency );
-            }
-        }
-
-        File tempFile = File.createTempFile( "mvninstall", ".pom" );
-        tempFile.deleteOnExit();
-        FileWriter fileWriter = new FileWriter( tempFile );
-        new MavenXpp3Writer().write( fileWriter, model );
-        IOUtil.close( fileWriter );
-        return new ArtifactMetadataImpl( artifact, tempFile );
     }
 
     private class ExecutableAndNetPluginAndAddinMatchPolicy

Modified: incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java Wed Jul 25 06:34:15 2007
@@ -19,34 +19,25 @@
 package org.apache.maven.dotnet.artifact.impl;
 
 import org.apache.maven.dotnet.artifact.AssemblyResolver;
-import org.apache.maven.dotnet.artifact.AssemblyRepositoryLayout;
+import org.apache.maven.dotnet.dao.ProjectDao;
+import org.apache.maven.dotnet.repository.Project;
+import org.apache.maven.dotnet.repository.ProjectDependency;
 import org.apache.maven.project.MavenProject;
 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.resolver.ArtifactResolutionResult;
 import org.apache.maven.artifact.resolver.ArtifactResolutionException;
 import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
-import org.apache.maven.artifact.repository.DefaultArtifactRepository;
-import org.apache.maven.artifact.repository.layout.DefaultRepositoryLayout;
-import org.apache.maven.artifact.versioning.VersionRange;
 import org.apache.maven.model.Dependency;
 
 import org.codehaus.plexus.logging.LogEnabled;
 import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.util.FileUtils;
 
 import java.util.Set;
 import java.util.HashSet;
 import java.util.List;
-import java.util.ArrayList;
-
 import java.io.File;
-import java.io.IOException;
 
 /**
  * Provides a way to resolve transitive assemblies that do not have versions within their file name.
@@ -57,17 +48,6 @@
     implements AssemblyResolver, LogEnabled
 {
     /**
-     * An artifact resolver component for locating artifacts and pulling them into the local repo if they do not
-     * already exist.
-     */
-    private ArtifactResolver resolver;
-
-    /**
-     * Metadata component used by the <code>ArtifactResolver</code>.
-     */
-    private ArtifactMetadataSource metadata;
-
-    /**
      * The artifact factory component, which is used for creating artifacts.
      */
     private ArtifactFactory artifactFactory;
@@ -82,6 +62,10 @@
      */
     private Logger logger;
 
+    private org.apache.maven.dotnet.registry.DataAccessObjectRegistry daoRegistry;
+
+    private org.apache.maven.artifact.manager.WagonManager wagonManager;
+
     /**
      * Constructor. This method is intended to by invoked by the plexus-container, not by the application developer.
      */
@@ -97,124 +81,154 @@
         this.logger = logger;
     }
 
-    /**
-     * @see AssemblyResolver#resolveTransitivelyFor
-     */
-    public void resolveTransitivelyFor( MavenProject project, Artifact sourceArtifact, List<Dependency> dependencies,
-                                        List<ArtifactRepository> remoteArtifactRepositories,
-                                        ArtifactRepository localArtifactRepository,
-                                        boolean addResolvedDependenciesToProject )
-        throws ArtifactResolutionException, ArtifactNotFoundException
+    private Set<ProjectDependency> subtractProjectDependencies( List<Dependency> b, Set<ProjectDependency> a )
     {
-        List<ArtifactRepository> releaseRepositories = new ArrayList<ArtifactRepository>();
-        List<ArtifactRepository> snapshotRepositories = new ArrayList<ArtifactRepository>();
-        for ( ArtifactRepository artifactRepository : remoteArtifactRepositories )
+        Set<Dependency> d = new HashSet<Dependency>( b );
+
+        for ( Dependency dependency : b )
         {
-            if ( artifactRepository.getSnapshots().isEnabled() )
+            if ( containsDependency( a, dependency ) )
             {
-                snapshotRepositories.add( artifactRepository );
+                d.remove( dependency );
             }
-            if ( artifactRepository.getReleases().isEnabled() )
+        }
+        Set<ProjectDependency> projectDependencies = new HashSet<ProjectDependency>();
+        for ( Dependency dependency : d )
+        {
+            ProjectDependency projectDependency = new ProjectDependency();
+            projectDependency.setGroupId( dependency.getGroupId() );
+            projectDependency.setArtifactId( dependency.getArtifactId() );
+            projectDependency.setVersion( dependency.getVersion() );
+            projectDependencies.add( projectDependency );
+        }
+        return projectDependencies;
+    }
+
+    private Set<ProjectDependency> substractDependencies( Set<ProjectDependency> a, List<Dependency> b )
+    {
+        Set<ProjectDependency> pd = new HashSet<ProjectDependency>( a );
+        for ( ProjectDependency projectDependency : a )
+        {
+            if ( containsProjectDependency( b, projectDependency ) )
             {
-                releaseRepositories.add( artifactRepository );
+                pd.remove( projectDependency );
             }
         }
+        return pd;
+    }
 
-        Set<Artifact> artifactDependencies = new HashSet<Artifact>();
-        Set<Artifact> snapshotArtifactDependencies = new HashSet<Artifact>();
-        Set<Artifact> gacDependencies = new HashSet<Artifact>();
-
-        ArtifactFilter gacFilter = new GacFilter();
+    private boolean containsProjectDependency( List<Dependency> dependencies, ProjectDependency projectDependency )
+    {
         for ( Dependency dependency : dependencies )
         {
-            String scope = ( dependency.getScope() == null ) ? Artifact.SCOPE_COMPILE : dependency.getScope();
-            Artifact artifact = artifactFactory.createDependencyArtifact( dependency.getGroupId(),
-                                                                          dependency.getArtifactId(),
-                                                                          VersionRange.createFromVersion(
-                                                                              dependency.getVersion() ),
-                                                                          dependency.getType(),
-                                                                          dependency.getClassifier(), scope, null );
-            if ( artifact.getType().startsWith( "gac" ) )
-            {
-                logger.debug(
-                    "NMAVEN-000-000: GAC Dependency = " + artifact.getType() + ", ID = " + artifact.getArtifactId() );
-                gacDependencies.add( artifact );
-            }
-            else if ( artifact.isSnapshot() )
-            {
-                logger.debug( "NMAVEN-000-000: Snapshot Dependency: Type  = " + artifact.getType() +
-                    ", Artifact ID = " + artifact.getArtifactId() );
-                snapshotArtifactDependencies.add( artifact );
-            }
-            else
+            if ( isEqual( projectDependency, dependency ) )
             {
-                logger.debug( "NMAVEN-000-000: Dependency: Type  = " + artifact.getType() + ", Artifact ID = " +
-                    artifact.getArtifactId() );
-                artifactDependencies.add( artifact );
+                return true;
             }
         }
-        //Releases
-        ArtifactResolutionResult result = resolver.resolveTransitively( artifactDependencies, sourceArtifact,
-                                                                        localArtifactRepository, releaseRepositories,
-                                                                        metadata, gacFilter );
-        Set<Artifact> resolvedReleaseDependencies = result.getArtifacts();
-
-        //Snapshots
-        ArtifactRepository artifactRepository = new DefaultArtifactRepository( "local", "file://" +
-            localArtifactRepository.getBasedir(), new DefaultRepositoryLayout() );
-
-        ArtifactResolutionResult snapshotResult = resolver.resolveTransitively( snapshotArtifactDependencies,
-                                                                                sourceArtifact, artifactRepository,
-                                                                                snapshotRepositories, metadata,
-                                                                                gacFilter );
-        Set<Artifact> resolvedSnapshotDependencies = snapshotResult.getArtifacts();
-        AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
-        for ( Artifact artifact : resolvedSnapshotDependencies )
+        return false;
+    }
+
+    private boolean containsDependency( Set<ProjectDependency> projectDependencies, Dependency dependency )
+    {
+        for ( ProjectDependency projectDependency : projectDependencies )
         {
-            File originalFileWithVersion = artifact.getFile();
-            if ( artifact.isSnapshot() )
+            if ( isEqual( projectDependency, dependency ) )
             {
-                artifact.setVersion( artifact.getBaseVersion() );
+                return true;
             }
-            File targetFileWithoutVersion =
-                new File( localArtifactRepository.getBasedir() + "/" + layout.pathOf( artifact ) );
-            if ( originalFileWithVersion.lastModified() > targetFileWithoutVersion.lastModified() )
-            {
-                logger.debug( "Original = " + originalFileWithVersion.getAbsolutePath() + ", Target = " +
-                    targetFileWithoutVersion.getAbsolutePath() );
+        }
+        return false;
+    }
+
+    private boolean isEqual( ProjectDependency projectDependency, Dependency dependency )
+    {
+        return ( projectDependency.getArtifactId().equals( dependency.getArtifactId() ) &&
+            projectDependency.getGroupId().equals( dependency.getGroupId() ) &&
+            projectDependency.getVersion().equals( dependency.getVersion() ) );
+    }
+
+    /**
+     * @see AssemblyResolver#resolveTransitivelyFor
+     */
+    public void resolveTransitivelyFor( MavenProject mavenProject, List<Dependency> dependencies,
+                                        List<ArtifactRepository> remoteArtifactRepositories,
+                                        File localArtifactRepository, boolean addResolvedDependenciesToProject )
+        throws ArtifactResolutionException, ArtifactNotFoundException
+    {
+        //Check that the list of dependencies matches the first level RDF Repo
+        //If not, resolve missing dependencies and add to repo or delete additional dependencies from repo
+
+
+        Project project = new Project();
+        project.setGroupId( mavenProject.getGroupId() );
+        project.setArtifactId( mavenProject.getArtifactId() );
+        project.setVersion( mavenProject.getVersion() );
+        project.setArtifactType(
+            ( mavenProject.getArtifact() != null ) ? mavenProject.getArtifact().getType() : "library" );
+
+        project.setPublicKeyTokenId(
+            ( mavenProject.getArtifact() != null ) ? mavenProject.getArtifact().getClassifier() : null );
+
+        for ( Dependency dependency : dependencies )
+        {
+            ProjectDependency projectDependency = new ProjectDependency();
+            projectDependency.setGroupId( dependency.getGroupId() );
+            projectDependency.setArtifactId( dependency.getArtifactId() );
+            projectDependency.setVersion( dependency.getVersion() );
+            projectDependency.setPublicKeyTokenId( dependency.getClassifier() );
+            projectDependency.setArtifactType( dependency.getType() );
+            project.addProjectDependency( projectDependency );
+        }
+
+        /*
                 try
                 {
-                    FileUtils.copyFile( originalFileWithVersion, targetFileWithoutVersion );
+                    project = dao.getProjectFor( mavenProject );
                 }
-                catch ( IOException e )
+                catch ( java.io.IOException e )
                 {
                     e.printStackTrace();
                 }
-            }
-            if ( originalFileWithVersion.length() != 0 && targetFileWithoutVersion.length() == 0 )
-            {
-                throw new ArtifactResolutionException( "NMAVEN-000-000: Artifact is corrupted:", artifact );
-            }
+        */
 
-            if ( targetFileWithoutVersion.exists() )
-            {
-                artifact.setFile( targetFileWithoutVersion.getAbsoluteFile() );
-            }
+        //Set<ProjectDependency> projectDependencies = project.getProjectDependencies();
+
+        /*
+                Set<ProjectDependency> pd = new HashSet<ProjectDependency>( CollectionUtils.subtract( projectDependencies,
+                                                                                                      substractDependencies(
+                                                                                                          projectDependencies,
+                                                                                                          dependencies ) ) );
+                pd.addAll( subtractProjectDependencies( dependencies, projectDependencies ) );
+        */
+        ProjectDao dao = (ProjectDao) daoRegistry.find( "dao:project" );
+        dao.init( artifactFactory, wagonManager );
+        dao.openConnection();
+
+        Set<Artifact> artifactDependencies = new HashSet<Artifact>();
+        try
+        {
+            artifactDependencies =
+                dao.storeProjectAndResolveDependencies( project, localArtifactRepository, remoteArtifactRepositories );
         }
-        if ( addResolvedDependenciesToProject )
+        catch ( java.io.IOException e )
         {
-            resolvedReleaseDependencies.addAll( gacDependencies );
-            resolvedReleaseDependencies.addAll( resolvedSnapshotDependencies );
-            project.setDependencyArtifacts( resolvedReleaseDependencies );
+            e.printStackTrace();
+        }
+        finally
+        {
+            dao.closeConnection();
         }
-    }
 
-    private static class GacFilter
-        implements ArtifactFilter
-    {
-        public boolean include( org.apache.maven.artifact.Artifact artifact )
+        //Resolve content
+
+        //Resolve and store pom
+
+        //Add rdf info to mavenProject
+        System.out.println( "Dependencies = " + artifactDependencies.size() );
+        if ( addResolvedDependenciesToProject )
         {
-            return !artifact.getType().startsWith( "gac" );
+            mavenProject.setDependencyArtifacts( artifactDependencies );
         }
     }
 }

Modified: incubator/nmaven/trunk/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-artifact/src/main/resources/META-INF/plexus/components.xml Wed Jul 25 06:34:15 2007
@@ -103,9 +103,6 @@
       <implementation>org.apache.maven.dotnet.artifact.impl.ArtifactContextImpl</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
-        </requirement>
-        <requirement>
           <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
         </requirement>
         <requirement>
@@ -118,10 +115,6 @@
           <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
-          <role-hint>net</role-hint>
-        </requirement>
-        <requirement>
           <role>org.apache.maven.artifact.handler.manager.ArtifactHandlerManager</role>
         </requirement>
         <requirement>
@@ -152,30 +145,40 @@
         <requirement>
           <role>org.apache.maven.dotnet.registry.RepositoryRegistry</role>
         </requirement>
+        <requirement>
+          <role>org.apache.maven.dotnet.registry.DataAccessObjectRegistry</role>
+        </requirement>        
       </requirements>
     </component>
     <component>
-      <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
-      <implementation>org.apache.maven.dotnet.artifact.AssemblyRepositoryLayout</implementation>
-      <role-hint>net</role-hint>
-    </component>
-    <component>
       <role>org.apache.maven.dotnet.artifact.AssemblyResolver</role>
       <implementation>org.apache.maven.dotnet.artifact.impl.AssemblyResolverImpl</implementation>
       <requirements>
         <requirement>
-          <role>org.apache.maven.artifact.resolver.ArtifactResolver</role>
+          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+          <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.artifact.metadata.ArtifactMetadataSource</role>
+          <role>org.apache.maven.dotnet.registry.DataAccessObjectRegistry</role>
         </requirement>
         <requirement>
-          <role>org.apache.maven.artifact.repository.ArtifactRepositoryFactory</role>
+          <role>org.apache.maven.artifact.manager.WagonManager</role>
         </requirement>
       </requirements>
     </component>
+    <component>
+      <role>org.apache.maven.dotnet.dao.ProjectDao</role>
+      <implementation>org.apache.maven.dotnet.dao.impl.ProjectDaoImpl</implementation>
+      <requirements>
+        <requirement>
+          <role>org.apache.maven.artifact.manager.WagonManager</role>
+        </requirement>
+        <requirement>
+          <role>org.apache.maven.artifact.factory.ArtifactFactory</role>
+        </requirement>
+      </requirements>
+    </component>    
   </components>
 </component-set>

Modified: incubator/nmaven/trunk/components/dotnet-assembler/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-assembler/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-assembler/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-assembler/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-components</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-core/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-core/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-core/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-core/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-components</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Added: incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/null.properties
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/null.properties?view=auto&rev=559454
==============================================================================
    (empty)

Propchange: incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/null.properties
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-core/src/main/resources/META-INF/nmaven/registry-config.xml Wed Jul 25 06:34:15 2007
@@ -40,7 +40,16 @@
       <repository-config>/META-INF/nmaven/net-dependencies.xml</repository-config>
       <init-param>
         <param-name>nmaven.version</param-name>
-        <param-value>0.14-SNAPSHOT</param-value>
+        <param-value>0.14</param-value>
+      </init-param>
+    </repository>
+    <repository>
+      <repository-name>connections</repository-name>
+      <repository-class>org.apache.maven.dotnet.registry.ConnectionsRepository</repository-class>
+      <repository-config>/META-INF/nmaven/null.properties</repository-config>
+      <init-param>
+        <param-name>dao:project</param-name>
+        <param-value>org.apache.maven.dotnet.dao.impl.ProjectDaoImpl</param-value>
       </init-param>
     </repository>
     <repository>

Modified: incubator/nmaven/trunk/components/dotnet-embedder/README.txt
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-embedder/README.txt?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-embedder/README.txt (original)
+++ incubator/nmaven/trunk/components/dotnet-embedder/README.txt Wed Jul 25 06:34:15 2007
@@ -1,6 +1,6 @@
 Axis Plugin for Maven (Java2Wsdl) does not work, so here the manual steps to generate a WSDL:
 1) Install Axis2
 2) mvn install from the dotnet-embedder directory
-3) java2wsdl -cn org.apache.maven.dotnet.embedder.MavenEmbedderService -cp target/dotnet-embedder-0.14-SNAPSHOT.jar -o src/main/resources
+3) java2wsdl -cn org.apache.maven.dotnet.embedder.MavenEmbedderService -cp target/dotnet-embedder-0.14.jar -o src/main/resources
 
 wsdl2java -o . -uri src\main\resources\MavenEmbedder.wsdl -s -S src\main\java -ss -sd

Modified: incubator/nmaven/trunk/components/dotnet-embedder/build.bat
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-embedder/build.bat?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-embedder/build.bat (original)
+++ incubator/nmaven/trunk/components/dotnet-embedder/build.bat Wed Jul 25 06:34:15 2007
@@ -1,2 +1,2 @@
 call mvn install
-call java2wsdl -cn org.apache.maven.dotnet.embedder.ITest -cp target/dotnet-embedder-0.14-SNAPSHOT.jar -o src/main/resources
\ No newline at end of file
+call java2wsdl -cn org.apache.maven.dotnet.embedder.ITest -cp target/dotnet-embedder-0.14.jar -o src/main/resources
\ No newline at end of file

Modified: incubator/nmaven/trunk/components/dotnet-embedder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-embedder/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-embedder/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-embedder/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-components</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-executable/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-components</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/compiler/impl/DefaultCompiler.java Wed Jul 25 06:34:15 2007
@@ -65,7 +65,7 @@
         commands.add( "/out:" + artifactFilePath );
         commands.add( "/target:" + targetArtifactType );
         commands.add( "/recurse:" + sourceDirectory + File.separator + "**" );
-        if ( !modules.isEmpty() )
+        if ( modules != null && !modules.isEmpty() )
         {
             StringBuffer sb = new StringBuffer();
             for ( Iterator i = modules.iterator(); i.hasNext(); )

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/CompilerContextImpl.java Wed Jul 25 06:34:15 2007
@@ -134,7 +134,7 @@
         catch ( ArtifactException e )
         {
             logger.error( "NMAVEN-061-000: Improper Initialization of the Net Modules", e );
-            return null;
+            return new ArrayList<Artifact>();
             //TODO: How to handle this: usually implies improper init of ArtifactContext
         }
         if ( config.isTestCompile() && config.getArtifactType().equals( ArtifactType.MODULE ) )
@@ -301,62 +301,65 @@
         artifactContext.init( project, project.getRemoteArtifactRepositories(), config.getLocalRepository() );
 
         Set<Artifact> artifacts = project.getDependencyArtifacts();//Can add WFC deps prior
-        for ( Artifact artifact : artifacts )
+        if ( artifacts != null )
         {
-            String type = artifact.getType();
-            if ( type.equals( "module" ) )
+            for ( Artifact artifact : artifacts )
             {
-                modules.add( artifact );
-            }
-            else if ( type.equals( "library" ) || type.equals( "exe" ) )
-            {
-                libraries.add( artifact );
-            }
-            //Resolving here since the GAC path is vendor and framework aware
-            else if ( type.equals( "gac_generic" ) )
-            {
-                String gacRoot = null;
-                if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && (
-                    compilerRequirement.getFrameworkVersion().equals( "2.0.50727" ) ||
-                        compilerRequirement.getFrameworkVersion().equals( "3.0" ) ) )
+                String type = artifact.getType();
+                if ( type.equals( "module" ) )
                 {
-                    gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
+                    modules.add( artifact );
                 }
-                else if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) &&
-                    compilerRequirement.getFrameworkVersion().equals( "1.1.4322" ) )
+                else if ( type.equals( "library" ) || type.equals( "exe" ) )
                 {
-                    gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC\\";
+                    libraries.add( artifact );
                 }
-                else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) )
+                //Resolving here since the GAC path is vendor and framework aware
+                else if ( type.equals( "gac_generic" ) )
                 {
-                    gacRoot = getGacRootForMono();
+                    String gacRoot = null;
+                    if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) && (
+                        compilerRequirement.getFrameworkVersion().equals( "2.0.50727" ) ||
+                            compilerRequirement.getFrameworkVersion().equals( "3.0" ) ) )
+                    {
+                        gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
+                    }
+                    else if ( compilerRequirement.getVendor().equals( Vendor.MICROSOFT ) &&
+                        compilerRequirement.getFrameworkVersion().equals( "1.1.4322" ) )
+                    {
+                        gacRoot = System.getenv( "SystemRoot" ) + "\\assembly\\GAC\\";
+                    }
+                    else if ( compilerRequirement.getVendor().equals( Vendor.MONO ) )
+                    {
+                        gacRoot = getGacRootForMono();
+                    }
+                    if ( gacRoot != null )
+                    {
+                        setArtifactGacFile( gacRoot, artifact );
+                        libraries.add( artifact );
+                    }
                 }
-                if ( gacRoot != null )
+                else if ( type.equals( "gac" ) )
                 {
+                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
+                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC\\";
+                    setArtifactGacFile( gacRoot, artifact );
+                    libraries.add( artifact );
+                }
+                else if ( type.equals( "gac_32" ) )
+                {
+                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
+                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_32\\";
+                    setArtifactGacFile( gacRoot, artifact );
+                    libraries.add( artifact );
+                }
+                else if ( type.equals( "gac_msil" ) )
+                {
+                    String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
+                        : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
                     setArtifactGacFile( gacRoot, artifact );
                     libraries.add( artifact );
                 }
-            }
-            else if ( type.equals( "gac" ) )
-            {
-                String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
-                    : System.getenv( "SystemRoot" ) + "\\assembly\\GAC\\";
-                setArtifactGacFile( gacRoot, artifact );
-                libraries.add( artifact );
-            }
-            else if ( type.equals( "gac_32" ) )
-            {
-                String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
-                    : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_32\\";
-                setArtifactGacFile( gacRoot, artifact );
-                libraries.add( artifact );
-            }
-            else if ( type.equals( "gac_msil" ) )
-            {
-                String gacRoot = ( compilerRequirement.getVendor().equals( Vendor.MONO ) ) ? getGacRootForMono()
-                    : System.getenv( "SystemRoot" ) + "\\assembly\\GAC_MSIL\\";
-                setArtifactGacFile( gacRoot, artifact );
-                libraries.add( artifact );
             }
         }
 
@@ -414,8 +417,8 @@
     private void setArtifactGacFile( String gacRoot, Artifact artifact )
         throws PlatformUnsupportedException
     {
-        File gacFile = new File( gacRoot, artifact.getArtifactId() + File.separator + artifact.getVersion() + File
-            .separator + artifact.getArtifactId() + ".dll" );
+        File gacFile = new File( gacRoot, artifact.getArtifactId() + File.separator + artifact.getVersion() + "__" +
+            artifact.getClassifier() + File.separator + artifact.getArtifactId() + ".dll" );
         if ( !gacFile.exists() )
         {
             throw new PlatformUnsupportedException(

Modified: incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java (original)
+++ incubator/nmaven/trunk/components/dotnet-executable/src/main/java/org/apache/maven/dotnet/executable/impl/NetExecutableFactoryImpl.java Wed Jul 25 06:34:15 2007
@@ -27,7 +27,7 @@
 import org.apache.maven.dotnet.vendor.IllegalStateException;
 import org.apache.maven.dotnet.registry.RepositoryRegistry;
 import org.apache.maven.dotnet.artifact.ArtifactContext;
-import org.apache.maven.dotnet.artifact.AssemblyRepositoryLayout;
+import org.apache.maven.dotnet.artifact.PathUtil;
 import org.apache.maven.dotnet.InitializationException;
 import org.apache.maven.dotnet.PlatformUnsupportedException;
 import org.apache.maven.project.MavenProject;
@@ -150,8 +150,8 @@
             Artifact artifact = artifactContext.getArtifactByID( netDependencyId );
             if ( artifact != null )
             {
-                AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
-                File artifactPath = new File( compilerConfig.getLocalRepository(), layout.pathOf( artifact ) );
+                File artifactPath =
+                    PathUtil.getPrivateApplicationBaseFileFor( artifact, compilerConfig.getLocalRepository() );
                 executionPaths.add( artifactPath.getParentFile().getAbsolutePath() );
             }
         }
@@ -188,8 +188,9 @@
                 "NMAVEN-066-021: Could not locate the plugin: GroupId = " + groupId + ", ArtifactId = " + artifactId );
         }
 
-        AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
-        File artifactPath = new File( localRepository + File.separator + layout.pathOf( artifact ) );
+        //AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
+        File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, new File( localRepository ) );
+
         List<String> commands = new ArrayList<String>();
         commands.add( "parameterFile=" + parameterFile.getAbsolutePath() );
         commands.add( "assemblyFile=" + artifactPath.getAbsolutePath() );
@@ -197,16 +198,13 @@
 
         Artifact pluginLoaderArtifact =
             artifactContext.getArtifactsFor( "NMaven.Plugin", "NMaven.Plugin.Loader", null, null ).get( 0 );
-        artifactPath = new File( localRepository + File.separator + layout.pathOf( pluginLoaderArtifact ) );
+        artifactPath = PathUtil.getPrivateApplicationBaseFileFor( pluginLoaderArtifact, new File( localRepository ) );
         commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() );
 
         return getNetExecutableFromRepository( "NMaven.Plugin", "NMaven.Plugin.Runner", vendorInfo,
                                                new File( localRepository ), commands, false );
     }
 
-    /**
-     * @see NetExecutableFactory#getNetExecutableFromRepository(String, String, org.apache.maven.dotnet.vendor.VendorInfo, String, java.util.List<java.lang.String>, boolean)
-     */
     public NetExecutable getNetExecutableFromRepository( String groupId, String artifactId, VendorInfo vendorInfo,
                                                          File localRepository, List<String> commands,
                                                          boolean isIsolatedAppDomain )
@@ -229,13 +227,12 @@
                     groupId + ", ArtifactId = " + artifactId );
             }
 
-            AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
-            File artifactPath = new File( localRepository + File.separator + layout.pathOf( artifact ) );
+            File artifactPath = PathUtil.getPrivateApplicationBaseFileFor( artifact, localRepository );
             commands.add( "startProcessAssembly=" + artifactPath.getAbsolutePath() );
-
-            String pluginArtifactPath = new File( localRepository + File.separator + layout.pathOf(
-                artifactContext.getArtifactsFor( "NMaven.Plugin", "NMaven.Plugin", null, null ).get(
-                    0 ) ) ).getAbsolutePath();
+            //TODO: Replace
+            String pluginArtifactPath = PathUtil.getPrivateApplicationBaseFileFor(
+                artifactContext.getArtifactsFor( "NMaven.Plugin", "NMaven.Plugin", null, null ).get( 0 ),
+                localRepository ).getAbsolutePath();
 
             commands.add( "pluginArtifactPath=" + pluginArtifactPath );
             return getNetExecutableFromRepository( "NMaven.Plugin", "NMaven.Plugin.Runner", vendorInfo, localRepository,
@@ -271,8 +268,7 @@
 
         logger.debug( "NMAVEN-066-003: Found Vendor: " + vendorInfo );
 
-        AssemblyRepositoryLayout layout = new AssemblyRepositoryLayout();
-        File artifactPath = new File( localRepository + File.separator + layout.pathOf( artifact ) );
+        File artifactPath =  PathUtil.getPrivateApplicationBaseFileFor( artifact, localRepository );
         List<String> modifiedCommands = new ArrayList<String>();
         String exe = null;
         if ( vendorInfo.getVendor().equals( Vendor.MONO ) )
@@ -285,7 +281,7 @@
                     if ( new File( executablePath.getAbsolutePath(), "mono.exe" ).exists() )
                     {
                         exe = new File( executablePath.getAbsolutePath(), "mono.exe" ).getAbsolutePath();
-                        commands.add( "vendor=MONO");//if forked process, it needs to know.
+                        commands.add( "vendor=MONO" );//if forked process, it needs to know.
                         break;
                     }
                 }
@@ -297,7 +293,7 @@
                     "NMAVEN-066-005: Executable path for mono does not exist. Will attempt to execute MONO using" +
                         " the main PATH variable." );
                 exe = "mono";
-                commands.add( "vendor=MONO");//if forked process, it needs to know.
+                commands.add( "vendor=MONO" );//if forked process, it needs to know.
             }
             modifiedCommands.add( artifactPath.getAbsolutePath() );
             for ( String command : commands )

Modified: incubator/nmaven/trunk/components/dotnet-jetty/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-jetty/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-jetty/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-jetty/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-components</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-jetty/src/main/java/org/apache/maven/dotnet/jetty/JettyStarter.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-jetty/src/main/java/org/apache/maven/dotnet/jetty/JettyStarter.java?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-jetty/src/main/java/org/apache/maven/dotnet/jetty/JettyStarter.java (original)
+++ incubator/nmaven/trunk/components/dotnet-jetty/src/main/java/org/apache/maven/dotnet/jetty/JettyStarter.java Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
     {
         try
         {
-            logger.addHandler( new FileHandler(System.getProperty( "user.home" ) + "\\.m2\\jetty-log.xml" ) );
+            logger.addHandler( new FileHandler(System.getProperty( "user.home" ) + "\\.m2\\embedder-logs\\jetty-log.xml" ) );
         }
         catch ( IOException e )
         {

Modified: incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-model/assembly-plugins/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-model</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-model/compiler-plugins/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-model</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-model/configuration-appenders/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/configuration-appenders/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-model/configuration-appenders/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-model/configuration-appenders/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-model</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>

Modified: incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml?view=diff&rev=559454&r1=559453&r2=559454
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-model/entries/pom.xml Wed Jul 25 06:34:15 2007
@@ -20,7 +20,7 @@
          xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <parent>
     <groupId>org.apache.maven.dotnet</groupId>
-    <version>0.14-SNAPSHOT</version>
+    <version>0.14</version>
     <artifactId>dotnet-model</artifactId>
   </parent>
   <modelVersion>4.0.0</modelVersion>



Mime
View raw message