incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r564445 - in /incubator/nmaven/trunk: ./ assemblies/NMaven.VisualStudio.ProjectWizard/src/main/csharp/ components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ components/dotnet-repository/src/main/java/org/apache/mav...
Date Fri, 10 Aug 2007 01:00:14 GMT
Author: sisbell
Date: Thu Aug  9 18:00:12 2007
New Revision: 564445

URL: http://svn.apache.org/viewvc?view=rev&rev=564445
Log:
Fixed deploying of artifacts. The converter needed to reset the correct artifact handler.

Added:
    incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryConverterForArtifactMojo.java
  (with props)
Modified:
    incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.ProjectWizard/src/main/csharp/WindowsApplication2.suo
    incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactContextImpl.java
    incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/RepositoryConverter.java
    incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImpl.java
    incubator/nmaven/trunk/components/dotnet-repository/src/test/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImplTest.java
    incubator/nmaven/trunk/misc/dotnet-repository-builder/pom-dotnet.xml
    incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
    incubator/nmaven/trunk/plugins/maven-deploy-plugin/src/main/java/org/apache/maven/dotnet/plugins/DeployMojo.java
    incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
    incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryRdfExporterMojo.java
    incubator/nmaven/trunk/pom-dotnet.xml
    incubator/nmaven/trunk/pom.xml

Modified: incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.ProjectWizard/src/main/csharp/WindowsApplication2.suo
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/assemblies/NMaven.VisualStudio.ProjectWizard/src/main/csharp/WindowsApplication2.suo?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
Binary files - no diff available.

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=564445&r1=564444&r2=564445
==============================================================================
--- 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
Thu Aug  9 18:00:12 2007
@@ -183,6 +183,7 @@
         this.localRepository = localRepository.getAbsolutePath();
         artifactInstaller.init( this, remoteArtifactRepositories, localRepository );
         Map<String, ArtifactHandler> map = new HashMap<String, ArtifactHandler>();
+
         for ( ArtifactHandler artifactHandler : artifactHandlers )
         {
             //If I add a handler that already exists, the runtime breaks.

Modified: incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/RepositoryConverter.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/RepositoryConverter.java?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/RepositoryConverter.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/RepositoryConverter.java
Thu Aug  9 18:00:12 2007
@@ -19,6 +19,7 @@
 package org.apache.maven.dotnet.repository;
 
 import org.openrdf.repository.Repository;
+import org.apache.maven.artifact.Artifact;
 
 import java.io.File;
 import java.io.IOException;
@@ -41,6 +42,9 @@
      *                        format, should be placed
      * @throws IOException if there is a problem in converting the repository
      */
-    void convert( Repository repository, File mavenRepository )
+    void convertRepositoryFormat( Repository repository, File mavenRepository )
+        throws IOException;
+
+    void convertRepositoryFormatFor( Artifact artifact, Repository repository, File mavenRepository)
         throws IOException;
 }

Modified: incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImpl.java?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImpl.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-repository/src/main/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImpl.java
Thu Aug  9 18:00:12 2007
@@ -83,9 +83,9 @@
     }
 
     /**
-     * @see RepositoryConverter#convert(org.openrdf.repository.Repository, java.io.File)
+     * @see RepositoryConverter#convertRepositoryFormat(org.openrdf.repository.Repository,
java.io.File)
      */
-    public void convert( Repository repository, File mavenRepository )
+    public void convertRepositoryFormat( Repository repository, File mavenRepository )
         throws IOException
     {
         ProjectDao dao = (ProjectDao) daoRegistry.find( "dao:project" );
@@ -117,15 +117,65 @@
                     continue;
                 }
             }
+            if ( !artifact.getType().equals( "exe.config" ) )//This is attached
+            {
+                handler = new DefaultArtifactHandler( "pom" );
+                artifact.setArtifactHandler( handler );
 
-            handler = new DefaultArtifactHandler( "pom" );
-            artifact.setArtifactHandler( handler );
+                File pomFile = new File( mavenRepository, pathOfPom( artifact ) );
+                FileWriter fileWriter = new FileWriter( pomFile );
+                new MavenXpp3Writer().write( fileWriter, model );
+                IOUtil.close( fileWriter );
+            }
+        }
+        dao.closeConnection();
+    }
+
+    public void convertRepositoryFormatFor( Artifact artifact, Repository repository, File
mavenRepository )
+        throws IOException
+    {
+        ProjectDao dao = (ProjectDao) daoRegistry.find( "dao:project" );
+        dao.init( artifactFactory, wagonManager );
+        dao.setRdfRepository( repository );
+        dao.openConnection();
+        Project project = dao.getProjectFor( artifact.getGroupId(), artifact.getArtifactId(),
artifact.getVersion(),
+                                             artifact.getType(), artifact.getClassifier()
);
+
+        logger.info( "NMAVEN-190-001: Converting Project: Artifact ID = " + project.getArtifactId()
+
+            ", Dependency Count =" + project.getProjectDependencies().size() );
+        Model model = ProjectFactory.createModelFrom( project );
+
+        ArtifactHandler handler = new DefaultArtifactHandler(
+            ArtifactType.getArtifactTypeForPackagingName( artifact.getType() ).getExtension()
);
+        artifact.setArtifactHandler( handler );
+
+        ArtifactRepositoryLayout layout = new DefaultRepositoryLayout();
+        if ( !project.getArtifactType().equals( "pom" ) )
+        {
+            if ( artifact.getFile().exists() )
+            {
+                FileUtils.copyFile( artifact.getFile(), new File( mavenRepository, layout.pathOf(
artifact ) ) );
+            }
+            else
+            {
+                logger.info( "NMAVEN-190-001: Could not find file: " + artifact.getFile().getAbsolutePath()
);
+                return;
+            }
+        }
+
+        if ( !artifact.getType().equals( "exe.config" ) )//This is attached
+        {
+            ArtifactHandler pomhandler = new DefaultArtifactHandler( "pom" );
+            artifact.setArtifactHandler( pomhandler );
 
             File pomFile = new File( mavenRepository, pathOfPom( artifact ) );
             FileWriter fileWriter = new FileWriter( pomFile );
             new MavenXpp3Writer().write( fileWriter, model );
             IOUtil.close( fileWriter );
         }
+        
+        artifact.setArtifactHandler( handler );
+
         dao.closeConnection();
     }
 

Modified: incubator/nmaven/trunk/components/dotnet-repository/src/test/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImplTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-repository/src/test/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImplTest.java?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-repository/src/test/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImplTest.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-repository/src/test/java/org/apache/maven/dotnet/repository/impl/RepositoryConverterImplTest.java
Thu Aug  9 18:00:12 2007
@@ -6,6 +6,8 @@
 import org.apache.maven.dotnet.dao.Project;
 import org.apache.maven.dotnet.dao.ProjectDependency;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.Artifact;
 import org.openrdf.repository.Repository;
 import org.openrdf.repository.RepositoryException;
 import org.openrdf.repository.RepositoryConnection;
@@ -28,7 +30,63 @@
 
     private static File basedir = new File( System.getProperty( "basedir" ) );
 
-    private org.openrdf.repository.Repository rdfRepository;
+
+    public void testConvertArtifact()
+    {
+        File testRepo = new File( System.getProperty( "basedir" ), "target/test-repo/repository-1"
);
+        testRepo.mkdir();
+
+        Repository repository = this.createRepository();
+        ProjectDao dao = this.createProjectDao( repository );
+
+        Project project = new Project();
+        project.setGroupId( "NMaven.Model" );
+        project.setArtifactId( "NMaven.Model.Pom" );
+        project.setVersion( "1.0" );
+        project.setArtifactType( "library" );
+        project.setPublicKeyTokenId( "abc" );
+
+        ProjectDependency test2 = createProjectDependency( "NMaven", "NMaven.Test", "1.0"
);
+        test2.setArtifactType( "library" );
+        project.addProjectDependency( test2 );
+
+        try
+        {
+            dao.storeProjectAndResolveDependencies( project, testRepo, new ArrayList<ArtifactRepository>()
);
+        }
+        catch ( java.io.IOException e )
+        {
+            e.printStackTrace();
+            fail( "Could not store the project: " + e.getMessage() );
+        }
+
+        RepositoryConverterImpl repositoryConverter = new RepositoryConverterImpl();
+        repositoryConverter.initTest( new DataAccessObjectRegistryStub(), new ArtifactFactoryTestStub(),
+                                      new WagonManagerTestStub() );
+
+        ArtifactFactory artifactFactory = new ArtifactFactoryTestStub();
+        Artifact artifact = artifactFactory.createArtifactWithClassifier( project.getGroupId(),
project.getArtifactId(),
+                                                                          project.getVersion(),
+                                                                          project.getArtifactType(),
"abc" );
+        File artifactFile = new File( testRepo.getParentFile(),
+                                      "/uac/gac_msil/NMaven.Model.Pom/1.0__NMaven.Model/NMaven.Model.Pom.dll"
);
+
+        artifact.setFile( artifactFile );
+        try
+        {
+            repositoryConverter.convertRepositoryFormatFor( artifact, repository, testRepo
);
+        }
+        catch ( IOException e )
+        {
+            fail( "Could not convert the repository: " + e.getMessage() );
+        }
+        this.exportRepositoryToRdf( "testConvertArtifact-rdf.xml", testRepo, repository );
+
+        assertTrue( new File( testRepo, "/NMaven/Model/NMaven.Model.Pom/1.0/NMaven.Model.Pom-1.0-abc.dll"
).exists() );
+        assertTrue( new File( testRepo, "/NMaven/Model/NMaven.Model.Pom/1.0/NMaven.Model.Pom-1.0.pom"
).exists() );
+        assertFalse( new File( testRepo, "/NMaven/NMaven.Test/1.0/NMaven.Test-1.0.dll" ).exists()
);
+        assertFalse( new File( testRepo, "/NMaven/NMaven.Test/1.0/NMaven.Test-1.0.pom" ).exists()
);
+    }
 
     public void testConvert()
     {
@@ -64,7 +122,7 @@
                                       new WagonManagerTestStub() );
         try
         {
-            repositoryConverter.convert( repository, testRepo );
+            repositoryConverter.convertRepositoryFormat( repository, testRepo );
         }
         catch ( IOException e )
         {

Modified: incubator/nmaven/trunk/misc/dotnet-repository-builder/pom-dotnet.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/misc/dotnet-repository-builder/pom-dotnet.xml?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/misc/dotnet-repository-builder/pom-dotnet.xml (original)
+++ incubator/nmaven/trunk/misc/dotnet-repository-builder/pom-dotnet.xml Thu Aug  9 18:00:12
2007
@@ -132,7 +132,7 @@
       <plugin>
         <groupId>org.apache.maven.dotnet.plugins</groupId>
         <artifactId>maven-repository-plugin</artifactId>
-        <version>0.14</version>
+        <version>0.14-SNAPSHOT</version>
         <executions>
           <execution>
             <phase>package</phase>

Modified: incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
(original)
+++ incubator/nmaven/trunk/plugins/maven-compile-plugin/src/main/resources/META-INF/plexus/components.xml
Thu Aug  9 18:00:12 2007
@@ -67,7 +67,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.plugins:maven-deploy-plugin:deploy
           </deploy>
         </phases>
       </configuration>
@@ -105,7 +106,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy
           </deploy>
         </phases>
       </configuration>
@@ -143,7 +145,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install,
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.plugins:maven-deploy-plugin:deploy
           </deploy>
         </phases>
       </configuration>
@@ -182,7 +185,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.plugins:maven-deploy-plugin:deploy
           </deploy>
         </phases>
       </configuration>
@@ -220,7 +224,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.plugins:maven-deploy-plugin:deploy
           </deploy>
         </phases>
       </configuration>
@@ -258,7 +263,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.plugins:maven-deploy-plugin:deploy
           </deploy>               
         </phases>
       </configuration>
@@ -275,7 +281,8 @@
             org.apache.maven.dotnet.plugins:maven-install-plugin:install
           </install>
           <deploy>
-            org.apache.maven.dotnet.plugins:maven-deploy-plugin:deploy-dotnet
+            org.apache.maven.dotnet.plugins:maven-repository-plugin:convert-artifact,
+            org.apache.maven.plugins:maven-deploy-plugin:deploy
           </deploy>
         </phases>
       </configuration>

Modified: incubator/nmaven/trunk/plugins/maven-deploy-plugin/src/main/java/org/apache/maven/dotnet/plugins/DeployMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-deploy-plugin/src/main/java/org/apache/maven/dotnet/plugins/DeployMojo.java?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-deploy-plugin/src/main/java/org/apache/maven/dotnet/plugins/DeployMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-deploy-plugin/src/main/java/org/apache/maven/dotnet/plugins/DeployMojo.java
Thu Aug  9 18:00:12 2007
@@ -3,17 +3,23 @@
 import org.apache.maven.artifact.deployer.ArtifactDeployer;
 import org.apache.maven.artifact.deployer.ArtifactDeploymentException;
 import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.metadata.ArtifactMetadata;
+import org.apache.maven.artifact.Artifact;
 import org.apache.maven.plugin.AbstractMojo;
 import org.apache.maven.plugin.MojoExecutionException;
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.artifact.ProjectArtifactMetadata;
+import org.apache.maven.dotnet.artifact.ArtifactContext;
+
+import java.io.File;
 
 /**
  * Deploy's dlls
  *
  * @author Evan Worley
  * @author Zak Jacobson
- * @goal deploy-dotnet
+ * @goal deploy
  * @phase deploy
  */
 public class DeployMojo
@@ -39,12 +45,31 @@
      */
     private ArtifactDeployer artifactDeployer;
 
+    /**
+     * @parameter expression="${project.packaging}"
+     * @required
+     * @readonly
+     */
+    private String packaging;
+
+    /**
+     * @component
+     */
+    private ArtifactContext artifactContext;
+
     public void execute()
         throws MojoExecutionException, MojoFailureException
     {
+        Artifact artifact = project.getArtifact();
+
+        if ( ! "pom".equals( packaging ) )
+        {
+            artifact.addMetadata( new ProjectArtifactMetadata( artifact, project.getFile()
) );
+        }
+        
         try
         {
-            artifactDeployer.deploy(  project.getArtifact().getFile(), project.getArtifact(),
+            artifactDeployer.deploy( project.getArtifact().getFile(), artifact,
                                      project.getDistributionManagementArtifactRepository(),
localRepo );
         }
         catch ( ArtifactDeploymentException e )

Modified: incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryAssemblerMojo.java
Thu Aug  9 18:00:12 2007
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.maven.dotnet.plugin.repository;
 
 import org.apache.maven.plugin.AbstractMojo;
@@ -124,7 +142,7 @@
 
         try
         {
-            repositoryConverter.convert( rdfRepository, localRepository );
+            repositoryConverter.convertRepositoryFormat( rdfRepository, localRepository );
         }
         catch ( IOException e )
         {
@@ -132,7 +150,7 @@
         }
     }
 
-    public void assemblyRepository( List<Dependency> dependencies, ArtifactRepositoryLayout
layout )
+    private void assemblyRepository( List<Dependency> dependencies, ArtifactRepositoryLayout
layout )
         throws MojoExecutionException, MojoFailureException
     {
         if ( dependencies.size() == 0 )

Added: incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryConverterForArtifactMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryConverterForArtifactMojo.java?view=auto&rev=564445
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryConverterForArtifactMojo.java
(added)
+++ incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryConverterForArtifactMojo.java
Thu Aug  9 18:00:12 2007
@@ -0,0 +1,82 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.maven.dotnet.plugin.repository;
+
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.dotnet.repository.RepositoryConverter;
+import org.apache.maven.dotnet.artifact.ArtifactContext;
+import org.openrdf.repository.sail.SailRepository;
+import org.openrdf.repository.RepositoryException;
+import org.openrdf.sail.memory.MemoryStore;
+
+import java.io.File;
+import java.io.IOException;
+
+/**
+ * @goal convert-artifact
+ */
+public class RepositoryConverterForArtifactMojo
+    extends AbstractMojo
+{
+    /**
+     * The maven project.
+     *
+     * @parameter expression="${project}"
+     * @required
+     */
+    private MavenProject project;
+
+    /**
+     * @parameter expression="${settings.localRepository}"
+     * @readonly
+     */
+    private File localRepository;
+
+    /**
+     * @component
+     */
+    private RepositoryConverter repositoryConverter;
+
+    public void execute()
+        throws MojoExecutionException, MojoFailureException
+    {
+        File dataDir = new File( localRepository.getParentFile(), "/uac/rdfRepository" );
+        org.openrdf.repository.Repository rdfRepository = new SailRepository( new MemoryStore(
dataDir ) );
+        try
+        {
+            rdfRepository.initialize();
+        }
+        catch ( RepositoryException e )
+        {
+            throw new MojoExecutionException( e.getMessage() );
+        }
+
+        try
+        {
+            repositoryConverter.convertRepositoryFormatFor( project.getArtifact(), rdfRepository,
localRepository );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoExecutionException( e.getMessage() );
+        }
+    }
+}

Propchange: incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryConverterForArtifactMojo.java
------------------------------------------------------------------------------
    svn:eol-style = native

Modified: incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryRdfExporterMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryRdfExporterMojo.java?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryRdfExporterMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-repository-plugin/src/main/java/org/apache/maven/dotnet/plugin/repository/RepositoryRdfExporterMojo.java
Thu Aug  9 18:00:12 2007
@@ -1,3 +1,21 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
 package org.apache.maven.dotnet.plugin.repository;
 
 import org.apache.maven.plugin.AbstractMojo;

Modified: incubator/nmaven/trunk/pom-dotnet.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/pom-dotnet.xml?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/pom-dotnet.xml (original)
+++ incubator/nmaven/trunk/pom-dotnet.xml Thu Aug  9 18:00:12 2007
@@ -210,6 +210,7 @@
       </dependency>
     </dependencies>
   </dependencyManagement>
+  <!--
   <distributionManagement>
     <snapshotRepository>
       <id>nmaven</id>
@@ -217,4 +218,12 @@
       <url>scpexe://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
     </snapshotRepository>
   </distributionManagement>
+  -->
+   <distributionManagement>
+ <snapshotRepository>
+   <id>test</id>
+   <name>Apache Development Snapshot Repository</name>
+   <url>file://C:\arepo</url>
+ </snapshotRepository>
+</distributionManagement>
 </project>

Modified: incubator/nmaven/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/pom.xml?view=diff&rev=564445&r1=564444&r2=564445
==============================================================================
--- incubator/nmaven/trunk/pom.xml (original)
+++ incubator/nmaven/trunk/pom.xml Thu Aug  9 18:00:12 2007
@@ -313,7 +313,7 @@
       </dependency>
     </dependencies>
   </dependencyManagement>
-
+<!--
   <distributionManagement>
     <snapshotRepository>
       <id>nmaven</id>
@@ -321,13 +321,14 @@
       <url>scpexe://people.apache.org/www/people.apache.org/repo/m2-snapshot-repository</url>
     </snapshotRepository>
   </distributionManagement>
+-->
 
-  <!--
  <distributionManagement>
  <snapshotRepository>
+   <id>test</id>
    <name>Apache Development Snapshot Repository</name>
    <url>file://C:\arepo</url>
  </snapshotRepository>
 </distributionManagement>
-  -->
+
 </project>



Mime
View raw message