You are viewing a plain text version of this content. The canonical link for it is here.
Posted to nmaven-commits@incubator.apache.org by si...@apache.org on 2007/07/24 07:05:13 UTC
svn commit: r558941 - in /incubator/nmaven/branches/SI_GAC:
assemblies/NMaven.IDE/ assemblies/NMaven.VisualStudio.Addin/
assemblies/NMaven.VisualStudio.ProjectWizard/
assemblies/NMaven.VisualStudio/ components/dotnet-artifact/
components/dotnet-artifac...
Author: sisbell
Date: Tue Jul 24 00:05:11 2007
New Revision: 558941
URL: http://svn.apache.org/viewvc?view=rev&rev=558941
Log:
Added support for gac installed dependencies.
Added:
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactFactoryTestStub.java (with props)
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImplTest.java (with props)
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/DummyLogger.java (with props)
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Model.Pom/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/NMaven.Model.Pom.dll (with props)
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Test/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Test/1.0__NMaven/
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Test/1.0__NMaven/NMaven.Test.dll (with props)
Modified:
incubator/nmaven/branches/SI_GAC/assemblies/NMaven.IDE/pom.xml
incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.Addin/pom.xml
incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.ProjectWizard/pom.xml
incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio/pom.xml
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/pom.xml
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/UacRepositoryLayout.java
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java
incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectFactory.java
incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ArtifactFactoryTestStub.java
incubator/nmaven/branches/SI_GAC/components/dotnet-registry/src/main/java/org/apache/maven/dotnet/registry/ConnectionsRepository.java
incubator/nmaven/branches/SI_GAC/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java
Modified: incubator/nmaven/branches/SI_GAC/assemblies/NMaven.IDE/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/assemblies/NMaven.IDE/pom.xml?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/assemblies/NMaven.IDE/pom.xml (original)
+++ incubator/nmaven/branches/SI_GAC/assemblies/NMaven.IDE/pom.xml Tue Jul 24 00:05:11 2007
@@ -32,30 +32,34 @@
<dependency>
<groupId>NMaven.Service</groupId>
<artifactId>NMaven.Service.Embedder</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>NMaven.Logging</groupId>
<artifactId>NMaven.Logging</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>NMaven.Artifact</groupId>
<artifactId>NMaven.Artifact</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>EnvDTE</groupId>
<artifactId>EnvDTE</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<dependency>
<groupId>EnvDTE80</groupId>
<artifactId>EnvDTE80</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
</dependencies>
</project>
Modified: incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.Addin/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.Addin/pom.xml?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.Addin/pom.xml (original)
+++ incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.Addin/pom.xml Tue Jul 24 00:05:11 2007
@@ -25,66 +25,74 @@
<modelVersion>4.0.0</modelVersion>
<groupId>NMaven.VisualStudio</groupId>
<artifactId>NMaven.VisualStudio.Addin</artifactId>
- <version>0.14</version>
+ <version>0.14</version>
<packaging>visual-studio-addin</packaging>
<name>NMaven.VisualStudio.Addin</name>
<dependencies>
<dependency>
<groupId>NMaven.IDE</groupId>
<artifactId>NMaven.IDE</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>NMaven.Plugin</groupId>
<artifactId>NMaven.Plugin</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>NMaven.Logging</groupId>
<artifactId>NMaven.Logging</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>NMaven.VisualStudio</groupId>
<artifactId>NMaven.VisualStudio</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>NMaven.Service</groupId>
<artifactId>NMaven.Service.Embedder</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
<scope>runtime</scope>
</dependency>
<dependency>
<groupId>NMaven.Artifact</groupId>
<artifactId>NMaven.Artifact</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>Microsoft.VisualStudio.CommandBars</groupId>
<artifactId>Microsoft.VisualStudio.CommandBars</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<dependency>
<groupId>EnvDTE</groupId>
<artifactId>EnvDTE</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<dependency>
<groupId>EnvDTE80</groupId>
<artifactId>EnvDTE80</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<dependency>
<groupId>Extensibility</groupId>
<artifactId>Extensibility</artifactId>
<type>gac</type>
+ <version>7.0.3300.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<dependency>
<groupId>Castle</groupId>
Modified: incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.ProjectWizard/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.ProjectWizard/pom.xml?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.ProjectWizard/pom.xml (original)
+++ incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio.ProjectWizard/pom.xml Tue Jul 24 00:05:11 2007
@@ -37,17 +37,23 @@
<groupId>EnvDTE</groupId>
<artifactId>EnvDTE</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<dependency>
<groupId>EnvDTE80</groupId>
<artifactId>EnvDTE80</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
<!--remmove-->
<dependency>
<groupId>Microsoft.VisualStudio.CommandBars</groupId>
<artifactId>Microsoft.VisualStudio.CommandBars</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
</dependencies>
<build>
@@ -69,6 +75,6 @@
<isGacInstall>true</isGacInstall>
</configuration>
</plugin>
- </plugins>
+ </plugins>
</build>
</project>
Modified: incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio/pom.xml?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio/pom.xml (original)
+++ incubator/nmaven/branches/SI_GAC/assemblies/NMaven.VisualStudio/pom.xml Tue Jul 24 00:05:11 2007
@@ -32,13 +32,15 @@
<dependency>
<groupId>NMaven.Logging</groupId>
<artifactId>NMaven.Logging</artifactId>
- <version>${pom.version}</version>
+ <version>0.14</version>
<type>library</type>
</dependency>
<dependency>
<groupId>EnvDTE</groupId>
<artifactId>EnvDTE</artifactId>
<type>gac</type>
+ <version>8.0.0.0</version>
+ <classifier>b03f5f7f11d50a3a</classifier>
</dependency>
</dependencies>
</project>
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/pom.xml?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/pom.xml (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/pom.xml Tue Jul 24 00:05:11 2007
@@ -54,4 +54,12 @@
<version>${pom.version}</version>
</dependency>
</dependencies>
+ <build>
+ <testResources>
+ <testResource>
+ <directory>src/test/resources/uac</directory>
+ <targetPath>../test-repo/uac</targetPath>
+ </testResource>
+ </testResources>
+ </build>
</project>
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java Tue Jul 24 00:05:11 2007
@@ -52,8 +52,8 @@
* <code>MavenProject.getArtifact</code>. In those cases where the MavenProject object is unavailable, then
* you can use the <code>installFile</code> method from this interface.
*
- * @param artifact the artifact to install
- * @param pomFile the pom file of the installed artifact
+ * @param artifact the artifact to install
+ * @param pomFile the pom file of the installed artifact
* @param modifyProjectMetadata
* @throws ArtifactInstallationException if there is a problem installing the artifact
*/
@@ -71,24 +71,23 @@
* @param artifactFile the artifact to install
* @throws ArtifactInstallationException if there is a problem installing the artifact
*/
- void installFileWithoutPom( String groupId, String artifactId, String version, String packaging,
- File artifactFile )
+ void installFileWithoutPom( String groupId, String artifactId, String version, String packaging, File artifactFile )
throws ArtifactInstallationException;
void resolveAndInstallNetDependenciesForProfile( String profile, List<Dependency> dependencies )
- throws ArtifactResolutionException, ArtifactNotFoundException, ArtifactInstallationException;
+ throws ArtifactResolutionException, ArtifactNotFoundException, ArtifactInstallationException;
+
+ void installArtifactAndDependenciesIntoPrivateApplicationBase( File applicationBase, Artifact artifact,
+ List<Dependency> dependencies )
+ throws ArtifactInstallationException;
/**
* Initializes the installer.
*
- * @param artifactContext the artifact context associated with this installer
-
-
- @param mavenProject the maven project associated with the invoking plugin
-
-
- * @param remoteArtifactRepositories
- * @param localRepository the location of the local maven repository
+ * @param artifactContext the artifact context associated with this installer
+ * @param mavenProject the maven project associated with the invoking plugin
+ * @param remoteArtifactRepositories
+ * @param localRepository the location of the local maven repository
*/
void init( ArtifactContext artifactContext, MavenProject mavenProject,
List<ArtifactRepository> remoteArtifactRepositories, File localRepository );
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/UacRepositoryLayout.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/UacRepositoryLayout.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/UacRepositoryLayout.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/UacRepositoryLayout.java Tue Jul 24 00:05:11 2007
@@ -5,12 +5,15 @@
import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
import org.apache.maven.artifact.metadata.ArtifactMetadata;
-public class UacRepositoryLayout implements ArtifactRepositoryLayout
+public class UacRepositoryLayout
+ implements ArtifactRepositoryLayout
{
+
public String pathOf( Artifact artifact )
- {
- return "uac\\gac_msil\\" + artifact.getArtifactId() + "\\" + artifact.getVersion() +
- "__" + artifact.getGroupId() + "\\" + artifact.getArtifactId() + ".dll";
+ {
+ return "uac\\gac_msil\\" + artifact.getArtifactId() + "\\" + artifact.getVersion() + "__" +
+ artifact.getGroupId() + "\\" + artifact.getArtifactId() + "." +
+ ArtifactType.getArtifactTypeForPackagingName( artifact.getType() ).getExtension();
}
public String pathOfLocalRepositoryMetadata( ArtifactMetadata artifactMetadata,
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java Tue Jul 24 00:05:11 2007
@@ -143,6 +143,12 @@
{
}
+ protected void initTest( ArtifactFactory artifactFactory, Logger logger )
+ {
+ this.artifactFactory = artifactFactory;
+ this.logger = logger;
+ }
+
/**
* @see LogEnabled#enableLogging(org.codehaus.plexus.logging.Logger)
*/
@@ -178,6 +184,60 @@
for ( Dependency dependency : repository.getDependenciesFor( matchPolicies ) )
{
resolveAndInstallLibraryDependenciesFor( dependency );
+ }
+ }
+
+ public void installArtifactAndDependenciesIntoPrivateApplicationBase( File applicationBase, Artifact artifact,
+ List<Dependency> dependencies )
+ throws ArtifactInstallationException
+ {
+ //File pab = new File( System.getProperty( "user.home" ), ".m2/pab" );
+
+ Set<Artifact> artifactDependencies = new HashSet<Artifact>();
+ for ( Dependency dependency : dependencies )
+ {
+ 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(
+ new File( localRepository.getParentFile(), new UacRepositoryLayout().pathOf( artifactDependency ) ) );
+
+ artifactDependencies.add( artifactDependency );
+ }
+
+ artifactDependencies.add( artifact );
+ System.out.println( "Copying into PAB. Count = " + artifactDependencies.size() );
+ for ( Artifact artifactDependency : artifactDependencies )
+ {
+ if ( !artifactDependency.getType().startsWith( "gac" ) )
+ {
+ try
+ {
+ logger.info( "NMAVEN-002-018: Installing file into repository: File = " +
+ artifactDependency.getFile().getAbsolutePath() );
+ try
+ {
+ 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 );
+ }
+ }
+ catch ( ArtifactInstallationException e )
+ {
+ throw new ArtifactInstallationException( "NMAVEN-002-003: Failed to install artifact: ID = " +
+ artifactDependency.getId() + ", File = " + ( ( artifactDependency.getFile() != null )
+ ? artifactDependency.getFile().getAbsolutePath() : "" ), e );
+ }
+ }
}
}
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/AssemblyResolverImpl.java Tue Jul 24 00:05:11 2007
@@ -20,7 +20,6 @@
import org.apache.maven.dotnet.artifact.AssemblyResolver;
import org.apache.maven.dotnet.dao.ProjectDao;
-import org.apache.maven.dotnet.dao.impl.ProjectFactory;
import org.apache.maven.dotnet.repository.Project;
import org.apache.maven.dotnet.repository.ProjectDependency;
import org.apache.maven.project.MavenProject;
@@ -35,7 +34,6 @@
import org.codehaus.plexus.logging.LogEnabled;
import org.codehaus.plexus.logging.Logger;
-import org.codehaus.plexus.util.CollectionUtils;
import java.util.Set;
import java.util.HashSet;
@@ -212,7 +210,7 @@
}
catch ( java.io.IOException e )
{
- e.printStackTrace(); //To change body of catch statement use File | Settings | File Templates.
+ e.printStackTrace();
}
//Resolve content
Added: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactFactoryTestStub.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactFactoryTestStub.java?view=auto&rev=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactFactoryTestStub.java (added)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactFactoryTestStub.java Tue Jul 24 00:05:11 2007
@@ -0,0 +1,135 @@
+package org.apache.maven.dotnet.artifact.impl;
+
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.DefaultArtifact;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+import org.apache.maven.artifact.versioning.VersionRange;
+
+public class ArtifactFactoryTestStub
+ implements ArtifactFactory
+{
+
+ public Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type )
+ {
+ return createArtifact( groupId, artifactId, version, scope, type, null, null );
+ }
+
+ public Artifact createArtifactWithClassifier( String groupId, String artifactId, String version, String type,
+ String classifier )
+ {
+ return createArtifact( groupId, artifactId, version, null, type, classifier, null );
+ }
+
+ public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type,
+ String classifier, String scope )
+ {
+ return createArtifact( groupId, artifactId, versionRange, type, classifier, null, null );
+ }
+
+ public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type,
+ String classifier, String scope, boolean optional )
+ {
+ return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, null, optional );
+ }
+
+ public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type,
+ String classifier, String scope, String inheritedScope )
+ {
+ return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope );
+ }
+
+ public Artifact createDependencyArtifact( String groupId, String artifactId, VersionRange versionRange, String type,
+ String classifier, String scope, String inheritedScope, boolean optional )
+ {
+ return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, optional );
+ }
+
+ public Artifact createBuildArtifact( String groupId, String artifactId, String version, String packaging )
+ {
+ return createArtifact( groupId, artifactId, version, null, packaging, null, null );
+ }
+
+ public Artifact createProjectArtifact( String groupId, String artifactId, String version )
+ {
+ return createProjectArtifact( groupId, artifactId, version, null );
+ }
+
+ public Artifact createParentArtifact( String groupId, String artifactId, String version )
+ {
+ return createProjectArtifact( groupId, artifactId, version );
+ }
+
+ public Artifact createPluginArtifact( String groupId, String artifactId, VersionRange versionRange )
+ {
+ return createArtifact( groupId, artifactId, versionRange, "maven-plugin", null, Artifact.SCOPE_RUNTIME, null );
+ }
+
+ public Artifact createProjectArtifact( String groupId, String artifactId, String version, String scope )
+ {
+ return createArtifact( groupId, artifactId, version, scope, "pom" );
+ }
+
+ public Artifact createExtensionArtifact( String groupId, String artifactId, VersionRange versionRange )
+ {
+ return createArtifact( groupId, artifactId, versionRange, "jar", null, Artifact.SCOPE_RUNTIME, null );
+ }
+
+ private Artifact createArtifact( String groupId, String artifactId, String version, String scope, String type,
+ String classifier, String inheritedScope )
+ {
+ VersionRange versionRange = null;
+ if ( version != null )
+ {
+ versionRange = VersionRange.createFromVersion( version );
+ }
+ return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope );
+ }
+
+ private Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String type,
+ String classifier, String scope, String inheritedScope )
+ {
+ return createArtifact( groupId, artifactId, versionRange, type, classifier, scope, inheritedScope, false );
+ }
+
+ private Artifact createArtifact( String groupId, String artifactId, VersionRange versionRange, String type,
+ String classifier, String scope, String inheritedScope, boolean optional )
+ {
+ // TODO: can refactor - inherited scope calculation belongs in the collector, use scope handler
+
+ String desiredScope = Artifact.SCOPE_RUNTIME;
+ if ( inheritedScope == null )
+ {
+ desiredScope = scope;
+ }
+ else if ( Artifact.SCOPE_TEST.equals( scope ) || Artifact.SCOPE_PROVIDED.equals( scope ) )
+ {
+ return null;
+ }
+ else if ( Artifact.SCOPE_COMPILE.equals( scope ) && Artifact.SCOPE_COMPILE.equals( inheritedScope ) )
+ {
+ // added to retain compile scope. Remove if you want compile inherited as runtime
+ desiredScope = Artifact.SCOPE_COMPILE;
+ }
+
+ if ( Artifact.SCOPE_TEST.equals( inheritedScope ) )
+ {
+ desiredScope = Artifact.SCOPE_TEST;
+ }
+
+ if ( Artifact.SCOPE_PROVIDED.equals( inheritedScope ) )
+ {
+ desiredScope = Artifact.SCOPE_PROVIDED;
+ }
+
+ if ( Artifact.SCOPE_SYSTEM.equals( scope ) )
+ {
+ // system scopes come through unchanged...
+ desiredScope = Artifact.SCOPE_SYSTEM;
+ }
+
+ return new DefaultArtifact( groupId, artifactId, versionRange, desiredScope, type, classifier,
+ new DefaultArtifactHandler(type), optional );
+ }
+}
+
Propchange: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactFactoryTestStub.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImplTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImplTest.java?view=auto&rev=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImplTest.java (added)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImplTest.java Tue Jul 24 00:05:11 2007
@@ -0,0 +1,51 @@
+package org.apache.maven.dotnet.artifact.impl;
+
+import junit.framework.TestCase;
+
+import java.util.ArrayList;
+import java.util.List;
+import java.io.File;
+
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.installer.ArtifactInstallationException;
+import org.apache.maven.model.Dependency;
+
+public class ArtifactInstallerImplTest
+ extends TestCase
+{
+
+ public void testInstallArtifactAndDependenciesIntoPrivateApplicationBase()
+ {
+ File testRepo = new File( System.getProperty( "basedir" ), "target/test-repo/repository" );
+ ArtifactInstallerImpl artifactInstaller = new ArtifactInstallerImpl();
+ artifactInstaller.init( null, null, new ArrayList<ArtifactRepository>(), testRepo );
+ ArtifactFactory stub = new ArtifactFactoryTestStub();
+ artifactInstaller.initTest( stub, new DummyLogger() );
+ Artifact artifact = stub.createArtifact( "NMaven.Model", "NMaven.Model.Pom", "1.0", "compile", "library" );
+ artifact.setFile( new File( System.getProperty( "basedir" ),
+ "target/test-repo/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/NMaven.Model.Pom.dll" ) );
+ Dependency dependency = new Dependency();
+ dependency.setGroupId( "NMaven" );
+ dependency.setArtifactId( "NMaven.Test" );
+ dependency.setVersion( "1.0" );
+ dependency.setType( "library" );
+
+ List<Dependency> dependencies = new ArrayList<Dependency>();
+ dependencies.add( dependency );
+ try
+ {
+ artifactInstaller.installArtifactAndDependenciesIntoPrivateApplicationBase(
+ new File( testRepo.getParentFile(), "pab" ), artifact, dependencies );
+ }
+ catch ( ArtifactInstallationException e )
+ {
+ e.printStackTrace();
+ fail("Unable to install artifact");
+ }
+
+ assertTrue("Could not find main artifact", new File("target/test-repo/pab/NMaven.Model.Pom.dll").exists());
+ assertTrue("Could not find dependent artifact", new File("target/test-repo/pab/NMaven.Test.dll").exists());
+ }
+}
Propchange: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImplTest.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/DummyLogger.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/DummyLogger.java?view=auto&rev=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/DummyLogger.java (added)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/DummyLogger.java Tue Jul 24 00:05:11 2007
@@ -0,0 +1,101 @@
+package org.apache.maven.dotnet.artifact.impl;
+
+import org.codehaus.plexus.logging.Logger;
+
+public class DummyLogger implements Logger
+{
+ public void setThreshold(int i)
+ {
+
+ }
+
+ public void debug( String string )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void debug( String string, Throwable throwable )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isDebugEnabled()
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void info( String string )
+ {
+ System.out.println(string);
+ }
+
+ public void info( String string, Throwable throwable )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isInfoEnabled()
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void warn( String string )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void warn( String string, Throwable throwable )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isWarnEnabled()
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void error( String string )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void error( String string, Throwable throwable )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isErrorEnabled()
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void fatalError( String string )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public void fatalError( String string, Throwable throwable )
+ {
+ //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public boolean isFatalErrorEnabled()
+ {
+ return false; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public Logger getChildLogger( String string )
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public int getThreshold()
+ {
+ return 0; //To change body of implemented methods use File | Settings | File Templates.
+ }
+
+ public String getName()
+ {
+ return null; //To change body of implemented methods use File | Settings | File Templates.
+ }
+}
Propchange: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/java/org/apache/maven/dotnet/artifact/impl/DummyLogger.java
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/NMaven.Model.Pom.dll
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/NMaven.Model.Pom.dll?view=auto&rev=558941
==============================================================================
Binary file - no diff available.
Propchange: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/NMaven.Model.Pom.dll
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Added: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Test/1.0__NMaven/NMaven.Test.dll
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Test/1.0__NMaven/NMaven.Test.dll?view=auto&rev=558941
==============================================================================
Binary file - no diff available.
Propchange: incubator/nmaven/branches/SI_GAC/components/dotnet-artifact/src/test/resources/uac/gac_msil/NMaven.Test/1.0__NMaven/NMaven.Test.dll
------------------------------------------------------------------------------
svn:mime-type = application/octet-stream
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectDaoImpl.java Tue Jul 24 00:05:11 2007
@@ -65,6 +65,10 @@
*/
private org.apache.maven.artifact.factory.ArtifactFactory artifactFactory;
+ private int getProjectForCounter = 0;
+
+ private int storeCounter = 0;
+
public void init( ArtifactFactory artifactFactory, WagonManager wagonManager )
{
this.artifactFactory = artifactFactory;
@@ -75,6 +79,8 @@
String publicKeyTokenId )
throws IOException
{
+ long startTime = System.currentTimeMillis();
+
RepositoryConnection repositoryConnection;
try
{
@@ -106,7 +112,7 @@
projectUris.add( ProjectUri.PARENT );
String query = "SELECT * FROM " + this.constructQueryFragmentFor( "{x}", projectUris );
- System.out.println( query );
+ // System.out.println( query );
// "SELECT * FROM {x} <http://maven.apache.org/artifact/groupId> {groupIdValue}; <http://maven.apache.org/artifact/artifactId> {artifactIdValue}; <http://maven.apache.org/artifact/version> {versionValue}; [<http://maven.apache.org/artifact/dependency> {dependency}]";
TupleQuery tupleQuery = repositoryConnection.prepareTupleQuery( QueryLanguage.SERQL, query );
@@ -142,7 +148,7 @@
for ( Iterator<Binding> i = set.iterator(); i.hasNext(); )
{
Binding b = i.next();
- System.out.println( b.getName() + ":" + b.getValue() );
+ //System.out.println( b.getName() + ":" + b.getValue() );
}
if ( set.getBinding( ProjectUri.IS_RESOLVED.getObjectBinding() ).getValue().toString().equalsIgnoreCase(
@@ -153,7 +159,7 @@
project.setArtifactType(
set.getBinding( ProjectUri.ARTIFACT_TYPE.getObjectBinding() ).getValue().toString() );
-
+ /*
if ( set.hasBinding( ProjectUri.PARENT.getObjectBinding() ) )
{
String pid = set.getBinding( ProjectUri.PARENT.getObjectBinding() ).getValue().toString();
@@ -161,7 +167,7 @@
Project parentProject = getProjectFor( tokens[0], tokens[1], tokens[2], null, null );
project.setParentProject( parentProject );
}
-
+ */
if ( set.hasBinding( ProjectUri.DEPENDENCY.getObjectBinding() ) )
{
Binding binding = set.getBinding( ProjectUri.DEPENDENCY.getObjectBinding() );
@@ -174,20 +180,6 @@
addClassifiersToProject( project, repositoryConnection, binding.getValue() );
}
}
- /*
- String query = "CONSTRUCT * FROM {x} p {y} ";
- GraphQueryResult graphResult = repositoryConnection.prepareGraphQuery( QueryLanguage.SERQL, query ).evaluate();
- Map<String, String> map = graphResult.getNamespaces();
- System.out.println( map );
- while ( graphResult.hasNext() )
- {
- Statement st = graphResult.next();
-
- System.out.println(
- "RESULT = " + st.getSubject() + " : " + st.getPredicate() + " : " + st.getObject() );
- }
- */
-
}
catch ( QueryEvaluationException e )
{
@@ -212,7 +204,9 @@
e.printStackTrace();
}
}
-
+ //TODO: If has parent, then need to modify dependencies, etc of returned project
+ logger.info( "ProjectDao.GetProjectFor - Artifact Id = " + project.getArtifactId() + ", Time = " +
+ ( System.currentTimeMillis() - startTime ) + ", Count = " + getProjectForCounter++ );
return project;
}
@@ -227,6 +221,8 @@
List<ArtifactRepository> artifactRepositories )
throws IOException, IllegalArgumentException
{
+ long startTime = System.currentTimeMillis();
+
if ( project == null )
{
throw new IllegalArgumentException( "NMAVEN-000-000: Project is null" );
@@ -272,7 +268,7 @@
BNode classifierNode = valueFactory.createBNode();
for ( Requirement requirement : project.getRequirements() )
{
- System.out.println( "Add requirement: " + requirement.getUri() );
+ //System.out.println( "Add requirement: " + requirement.getUri() );
URI uri = valueFactory.createURI( requirement.getUri().toString() );
repositoryConnection.add( classifierNode, uri,
valueFactory.createLiteral( requirement.getValue() ) );
@@ -297,27 +293,36 @@
projectDependency.getVersion() + ", Artifact Type = " + projectDependency.getArtifactType() );
if ( !projectDependency.isResolved() )
{
- try
+ if ( projectDependency.getArtifactType().startsWith( "gac" ) )
{
- Project dep = this.getProjectFor( projectDependency.getGroupId(),
- projectDependency.getArtifactId(),
- projectDependency.getVersion(),
- projectDependency.getArtifactType(),
- projectDependency.getPublicKeyTokenId() );
- if ( dep.isResolved() )
- {
- projectDependency = (ProjectDependency) dep;
- Artifact assembly =
- ProjectFactory.createArtifactFrom( projectDependency, artifactFactory );
- artifactDependencies.add( assembly );
- artifactDependencies.addAll(
- this.storeProjectAndResolveDependencies( projectDependency, artifactRepositories ) );
- }
+ projectDependency.setResolved( true );
+ artifactDependencies.add(
+ ProjectFactory.createArtifactFrom( projectDependency, artifactFactory ) );
}
- catch ( IOException e )
+ else
{
- e.printStackTrace();
- //safe to ignore: dependency not found
+ try
+ {
+ Project dep = this.getProjectFor( projectDependency.getGroupId(),
+ projectDependency.getArtifactId(),
+ projectDependency.getVersion(),
+ projectDependency.getArtifactType(),
+ projectDependency.getPublicKeyTokenId() );
+ if ( dep.isResolved() )
+ {
+ projectDependency = (ProjectDependency) dep;
+ Artifact assembly =
+ ProjectFactory.createArtifactFrom( projectDependency, artifactFactory );
+ artifactDependencies.add( assembly );
+ artifactDependencies.addAll( this.storeProjectAndResolveDependencies(
+ projectDependency, artifactRepositories ) );
+ }
+ }
+ catch ( IOException e )
+ {
+ //e.printStackTrace();
+ //safe to ignore: dependency not found
+ }
}
}
@@ -333,18 +338,22 @@
try
{
+ logger.info( "NMAVEN-000-000: Retrieving artifact: Artifact ID = " +
+ projectDependency.getArtifactId() );
wagonManager.getArtifact( pomArtifact, artifactRepositories );
wagonManager.getArtifact( assembly, artifactRepositories );
}
catch ( TransferFailedException e )
{
throw new IOException(
- "NMAVEN-000-000: Problem in resolving artifact: Message = " + e.getMessage() );
+ "NMAVEN-000-000: Problem in resolving artifact: Assembly Artifact Id = " +
+ assembly.getArtifactId() + ", Message = " + e.getMessage() );
}
catch ( ResourceDoesNotExistException e )
{
throw new IOException(
- "NMAVEN-000-000: Problem in resolving artifact: Message = " + e.getMessage() );
+ "NMAVEN-000-000: Problem in resolving artifact: Assembly Artifact Id = " +
+ assembly.getArtifactId() + ", Message = " + e.getMessage() );
}
File pomArtifactFile = pomArtifact.getFile();
@@ -401,11 +410,12 @@
for ( Model model : modelDependencies )
{
- System.out.println( "Storing dependency: Artifact Id = " + model.getArtifactId() );
+ //System.out.println( "Storing dependency: Artifact Id = " + model.getArtifactId() );
artifactDependencies.addAll( storeProjectAndResolveDependencies(
ProjectFactory.createProjectFrom( model, null ), artifactRepositories ) );
}
-
+ logger.info( "ProjectDao.storeProjectAndResolveDependencies - Artifact Id = " + project.getArtifactId() +
+ ", Time = " + ( System.currentTimeMillis() - startTime ) + ", Count = " + storeCounter++ );
return artifactDependencies;
}
@@ -460,7 +470,7 @@
throws RepositoryException, MalformedQueryException, QueryEvaluationException
{
String query = "SELECT * FROM {x} p {y}";
- System.out.println( query );
+ //System.out.println( query );
TupleQuery tq = repositoryConnection.prepareTupleQuery( QueryLanguage.SERQL, query );
tq.setBinding( "x", classifierUri );
TupleQueryResult result = tq.evaluate();
@@ -470,7 +480,7 @@
for ( Iterator<Binding> i = set.iterator(); i.hasNext(); )
{
Binding binding = i.next();
- System.out.println( "-" + binding.getName() + ":" + binding.getValue() );
+ // System.out.println( "-" + binding.getName() + ":" + binding.getValue() );
if ( binding.getValue().toString().startsWith( "http://maven.apache.org/artifact/requirement" ) )
{
try
@@ -500,7 +510,7 @@
projectUris.add( ProjectUri.DEPENDENCY );
String query = "SELECT * FROM " + this.constructQueryFragmentFor( "{x}", projectUris );
- System.out.println( query );
+ // System.out.println( query );
Set<ProjectDependency> projectDependencies = new HashSet<ProjectDependency>();
// String dependencyQuery =
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectFactory.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectFactory.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectFactory.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/main/java/org/apache/maven/dotnet/dao/impl/ProjectFactory.java Tue Jul 24 00:05:11 2007
@@ -28,7 +28,7 @@
project.setVersion( model.getVersion() );
project.setArtifactType( model.getPackaging() );
Parent parent = model.getParent();
- if ( parent != null && pomFileDirectory != null)
+ if ( parent != null && pomFileDirectory != null )
{
String parentPomName = FileUtils.filename( parent.getRelativePath() );
File parentPomFile = new File( pomFileDirectory, parentPomName );
@@ -45,8 +45,8 @@
throw new IOException( "NMAVEN-000-000: Unable to read model: Message = " + e.getMessage() );
}
- System.out.println("Pom File: " + pomFileDirectory.getAbsolutePath());
- System.out.println("Parent: " + parentPomFile.getParentFile().getAbsolutePath());
+ System.out.println( "Pom File: " + pomFileDirectory.getAbsolutePath() );
+ System.out.println( "Parent: " + parentPomFile.getParentFile().getAbsolutePath() );
Project parentProject = createProjectFrom( parentModel, parentPomFile.getParentFile() );
project.setParentProject( parentProject );
}
@@ -82,15 +82,17 @@
projectDependency.getPublicKeyTokenId(), scope,
null );
- File artifactFile = ( ( projectDependency.getArtifactType().startsWith( "gac") ) ) ? new File(
- "C:\\WINDOWS\\assembly\\gac_msil\\", projectDependency.getArtifactId() + "\\" +
- projectDependency.getVersion() + "__" + projectDependency.getPublicKeyTokenId() + "\\" +
- projectDependency.getArtifactId() + ".dll" ) : new File( System.getProperty( "user.home" ),
- "\\.m2\\uac\\gac_msil\\" +
- projectDependency.getArtifactId() + "\\" +
- projectDependency.getVersion() + "__" +
- projectDependency.getGroupId() + "\\" +
- projectDependency.getArtifactId() + ".dll" );
+ File artifactFile = ( ( projectDependency.getArtifactType().startsWith( "gac" ) ) ) ? new File(
+ "C:\\WINDOWS\\assembly\\" + projectDependency.getArtifactType() + "\\" + projectDependency.getArtifactId() +
+ "\\" + projectDependency.getVersion() + "__" + projectDependency.getPublicKeyTokenId() + "\\" +
+ projectDependency.getArtifactId() + ".dll" ) : new File( System.getProperty( "user.home" ),
+ "\\.m2\\uac\\gac_msil\\" +
+ projectDependency.getArtifactId() + "\\" +
+ projectDependency.getVersion() + "__" +
+ projectDependency.getGroupId() + "\\" +
+
+ projectDependency.getArtifactId() +
+ ".dll" );
assembly.setFile( artifactFile );
return assembly;
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ArtifactFactoryTestStub.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ArtifactFactoryTestStub.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ArtifactFactoryTestStub.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-dao/project/src/test/java/org/apache/maven/dotnet/dao/impl/ArtifactFactoryTestStub.java Tue Jul 24 00:05:11 2007
@@ -3,7 +3,6 @@
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.Artifact;
import org.apache.maven.artifact.DefaultArtifact;
-import org.apache.maven.artifact.handler.ArtifactHandler;
import org.apache.maven.artifact.handler.DefaultArtifactHandler;
import org.apache.maven.artifact.versioning.VersionRange;
Modified: incubator/nmaven/branches/SI_GAC/components/dotnet-registry/src/main/java/org/apache/maven/dotnet/registry/ConnectionsRepository.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/components/dotnet-registry/src/main/java/org/apache/maven/dotnet/registry/ConnectionsRepository.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/components/dotnet-registry/src/main/java/org/apache/maven/dotnet/registry/ConnectionsRepository.java (original)
+++ incubator/nmaven/branches/SI_GAC/components/dotnet-registry/src/main/java/org/apache/maven/dotnet/registry/ConnectionsRepository.java Tue Jul 24 00:05:11 2007
@@ -34,7 +34,7 @@
}
long start = System.currentTimeMillis();
- File dataDir = new File( "c:\\temp\\myRepository\\" );
+ File dataDir = new File( System.getProperty( "user.home"), ".m2/uac/rdfRepository" );
MemoryStore store = new MemoryStore( dataDir );
store.setPersist( true );
store.setSyncDelay( 0 );
Modified: incubator/nmaven/branches/SI_GAC/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_GAC/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java?view=diff&rev=558941&r1=558940&r2=558941
==============================================================================
--- incubator/nmaven/branches/SI_GAC/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java (original)
+++ incubator/nmaven/branches/SI_GAC/plugins/maven-install-plugin/src/main/java/org/apache/maven/dotnet/plugin/install/InstallerMojo.java Tue Jul 24 00:05:11 2007
@@ -27,6 +27,8 @@
import org.apache.maven.artifact.factory.ArtifactFactory;
import org.apache.maven.artifact.repository.ArtifactRepository;
import org.apache.maven.dotnet.artifact.ArtifactContext;
+import org.apache.maven.dotnet.artifact.ArtifactType;
+import org.apache.maven.dotnet.artifact.UacRepositoryLayout;
import org.apache.maven.dotnet.executable.NetExecutable;
import org.apache.maven.dotnet.executable.ExecutionException;
import org.apache.maven.dotnet.PlatformUnsupportedException;
@@ -122,7 +124,7 @@
*
* @component
*/
- private ArtifactFactory artifactFactory;
+ private ArtifactFactory artifactFactory;
public void execute()
throws MojoExecutionException
@@ -137,7 +139,6 @@
ProjectDao dao = (ProjectDao) daoRegistry.find( "dao:project" );
dao.init( artifactFactory, wagonManager );
-
artifactContext.init( project, project.getRemoteArtifactRepositories(), localRepository );
if ( project.getPackaging().equals( "pom" ) )
{
@@ -176,28 +177,30 @@
{
throw new MojoExecutionException( "NMAVEN-1001-000: Failed to install artifacts", e );
}
-
}
//Use Private Application Base
-/*
- // To allow executables to be runnable from the repo
+
+ // To allow executables to be runnable from the repo
+ Artifact artifact = project.getArtifact();
if ( artifact.getType().equals( ArtifactType.EXE.getPackagingType() ) ||
artifact.getType().equals( ArtifactType.NETPLUGIN.getPackagingType() ) ||
artifact.getType().equals( ArtifactType.VISUAL_STUDIO_ADDIN.getPackagingType() ) ||
- artifact.getType().equals( ArtifactType.SHARP_DEVELOP_ADDIN.getPackagingType() ))
+ artifact.getType().equals( ArtifactType.SHARP_DEVELOP_ADDIN.getPackagingType() ) )
{
+ File pab = new File( System.getProperty( "user.home" ),
+ ".m2/pab/" + new UacRepositoryLayout().pathOf( artifact ) ).getParentFile();
List<Dependency> dependencies = project.getDependencies();
try
{
- artifactContext.getArtifactInstaller().installLibraryDependencies( artifact, dependencies );
+ artifactContext.getArtifactInstaller()
+ .installArtifactAndDependenciesIntoPrivateApplicationBase( pab, artifact, dependencies );
}
catch ( ArtifactInstallationException e )
{
throw new MojoExecutionException( "NMAVEN-1001-002: Failed to install artifact file", e );
}
}
- */
long endTime = System.currentTimeMillis();
getLog().info( "Mojo Execution Time = " + ( endTime - startTime ) );