uac directory in two locations with non-default localRepository

Developer
May 31, 2010 at 2:58 AM

Hi all,

First time using npanday, and trying to build it from head of trunk, on Windows.

It gets all the way up to building NPanday :: .NET Mdel :: POM and fails at the repository:convert-artifact goal with the exception NPANDAY-180-004: Could not find the project...

I noticed that during the build, two uac/rdfRepository directories were created: one in the same directory as my localRepository override, and the other in ~/m2/

i.e. in my ~/m2/settings.xml file I have <localRepository>c:\maven\repository</localRepository> and during the build, two directories are created, one at c:\maven\uac\rdfRepository and one at h:\.m2\uac\rdfRepository


Any ideas?

 

thanks,

Craig

Developer
May 31, 2010 at 3:52 AM

This patch seemed to fix the problem...

Index: plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java
===================================================================
--- plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java	(revision 52641)
+++ plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/ArtifactManagerMojo.java	(working copy)
@@ -74,15 +74,10 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        if ( localRepository == null )
-        {
-            localRepository = new File( System.getProperty( "user.home" ), ".m2/repository" );
-        }
-
         String artifactValue = System.getProperty( "artifact" );
         String[] tokens = artifactValue.split( "[:]" );
 
-        File dataDir = new File( localRepository.getParentFile(), "/uac/rdfRepository" );
+        File dataDir = new File( System.getProperty( "user.home" ), ".m2/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( new MemoryStore( dataDir ) );
         try
         {
Index: plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java
===================================================================
--- plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java	(revision 52641)
+++ plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryAssemblerMojo.java	(working copy)
@@ -131,7 +131,7 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        File dataDir = new File( localRepository.getParentFile(), "/uac/rdfRepository" );
+      	File dataDir = new File( System.getProperty( "user.home" ), ".m2/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( new MemoryStore( dataDir ) );
         try
         {
Index: plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java
===================================================================
--- plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java	(revision 52641)
+++ plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryConverterForArtifactMojo.java	(working copy)
@@ -65,7 +65,7 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        File dataDir = new File( localRepository.getParentFile(), "/uac/rdfRepository" );
+      	File dataDir = new File( System.getProperty( "user.home" ), ".m2/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( new MemoryStore( dataDir ) );
         try
         {
Index: plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java
===================================================================
--- plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java	(revision 52641)
+++ plugins/maven-repository-plugin/src/main/java/npanday/plugin/repository/RepositoryRdfExporterMojo.java	(working copy)
@@ -53,7 +53,7 @@
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
-        File dataDir = new File( localRepository.getParentFile(), "/uac/rdfRepository" );
+      	File dataDir = new File( System.getProperty( "user.home" ), ".m2/uac/rdfRepository" );
         org.openrdf.repository.Repository rdfRepository = new SailRepository( new MemoryStore( dataDir ) );
         try
         {
@@ -67,7 +67,7 @@
         RDFHandler rdfxmlWriter;
         try
         {
-            File exportFile = new File( localRepository.getParentFile(), "/uac/rdfRepository/rdf-repository-export.xml" );
+            File exportFile = new File( System.getProperty( "user.home" ), ".m2/uac/rdfRepository/rdf-repository-export.xml" );
             rdfxmlWriter = new RDFXMLWriter( new FileOutputStream( exportFile ) );
         }
         catch ( IOException e )