incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r561095 - in /incubator/nmaven/trunk: ./ components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ components/dotnet-service/embedder/ plugins/...
Date Mon, 30 Jul 2007 19:06:25 GMT
Author: sisbell
Date: Mon Jul 30 12:06:24 2007
New Revision: 561095

URL: http://svn.apache.org/viewvc?view=rev&rev=561095
Log:
Fixes for packaging of repo tar. Fixed incorrect versions of plexus in WAR file that caused
the IDE builds to break.

Modified:
    incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
    incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/impl/ArtifactInstallerImpl.java
    incubator/nmaven/trunk/components/dotnet-service/embedder/pom.xml
    incubator/nmaven/trunk/plugins/maven-embedder-plugin/src/main/java/org/apache/maven/dotnet/plugin/embedder/EmbedderStarterMojo.java
    incubator/nmaven/trunk/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
    incubator/nmaven/trunk/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
    incubator/nmaven/trunk/pom.xml

Modified: incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java?view=diff&rev=561095&r1=561094&r2=561095
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
(original)
+++ incubator/nmaven/trunk/components/dotnet-artifact/src/main/java/org/apache/maven/dotnet/artifact/ArtifactInstaller.java
Mon Jul 30 12:06:24 2007
@@ -75,7 +75,8 @@
     void installFileWithoutPom( String groupId, String artifactId, String version, String
packaging, File artifactFile )
         throws ArtifactInstallationException;
 
-    void resolveAndInstallNetDependenciesForProfile( String profile, List<Dependency>
dependencies )
+    void resolveAndInstallNetDependenciesForProfile( String profile, List<Dependency>
dependencies,
+                                                     List<Dependency> javaDependencies
)
         throws IOException;
 
     void installArtifactAndDependenciesIntoPrivateApplicationBase( File applicationBase,
Artifact artifact,

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=561095&r1=561094&r2=561095
==============================================================================
--- 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
Mon Jul 30 12:06:24 2007
@@ -145,21 +145,27 @@
         this.logger = logger;
     }
 
-    public void resolveAndInstallNetDependenciesForProfile( String profile, List<Dependency>
dependencies )
+    public void resolveAndInstallNetDependenciesForProfile( String profile, List<Dependency>
netDependencies,
+                                                            List<Dependency> javaDependencies
)
         throws IOException
     {
-        if ( dependencies == null )
+        if ( netDependencies == null )
         {
-            dependencies = new ArrayList<Dependency>();
+            netDependencies = new ArrayList<Dependency>();
+        }
+
+        if ( javaDependencies == null )
+        {
+            javaDependencies = new ArrayList<Dependency>();
         }
 
         NetDependenciesRepository repository =
             (NetDependenciesRepository) repositoryRegistry.find( "net-dependencies" );
         List<NetDependencyMatchPolicy> matchPolicies = new ArrayList<NetDependencyMatchPolicy>();
         matchPolicies.add( new ProfileMatchPolicy( profile ) );
-        dependencies.addAll( repository.getDependenciesFor( matchPolicies ) );
+        netDependencies.addAll( repository.getDependenciesFor( matchPolicies ) );
 
-        assemblyResolver.resolveTransitivelyFor( new MavenProject(), dependencies, remoteArtifactRepositories,
+        assemblyResolver.resolveTransitivelyFor( new MavenProject(), netDependencies, remoteArtifactRepositories,
                                                  localRepository, false );
 
         //Do Library Installs for Net Dependencies
@@ -167,15 +173,16 @@
         matchPolicies.add( new ProfileMatchPolicy( profile ) );
         matchPolicies.add( new ExecutableAndNetPluginAndAddinMatchPolicy() );
 
-        for ( Dependency dependency : dependencies )
+        ArtifactRepository localArtifactRepo =
+            new DefaultArtifactRepository( "local", "file://" + localRepository, new DefaultRepositoryLayout()
);
+
+        for ( Dependency dependency : netDependencies )
         {
             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(),
@@ -195,6 +202,26 @@
                 {
                     throw new IOException( e.getMessage() );
                 }
+            }
+        }
+
+        for ( Dependency dependency : javaDependencies )
+        {
+            Artifact javaArtifact = artifactFactory.createBuildArtifact( dependency.getGroupId(),
+                                                                         dependency.getArtifactId(),
+                                                                         dependency.getVersion(),
+                                                                         dependency.getType()
);
+            try
+            {
+                resolver.resolve( javaArtifact, remoteArtifactRepositories, localArtifactRepo
);
+            }
+            catch ( ArtifactResolutionException e )
+            {
+                throw new IOException( e.getMessage() );
+            }
+            catch ( ArtifactNotFoundException e )
+            {
+                throw new IOException( e.getMessage() );
             }
         }
 

Modified: incubator/nmaven/trunk/components/dotnet-service/embedder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/components/dotnet-service/embedder/pom.xml?view=diff&rev=561095&r1=561094&r2=561095
==============================================================================
--- incubator/nmaven/trunk/components/dotnet-service/embedder/pom.xml (original)
+++ incubator/nmaven/trunk/components/dotnet-service/embedder/pom.xml Mon Jul 30 12:06:24
2007
@@ -41,5 +41,29 @@
       <artifactId>dotnet-embedder</artifactId>
       <version>${pom.version}</version>
     </dependency>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-core</artifactId>
+      <exclusions>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-component-api</artifactId>
+        </exclusion>
+        <exclusion>
+          <groupId>org.codehaus.plexus</groupId>
+          <artifactId>plexus-component-api</artifactId>
+        </exclusion>
+      </exclusions>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-container-default</artifactId>
+      <version>1.0-alpha-25</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.plexus</groupId>
+      <artifactId>plexus-component-api</artifactId>
+      <version>1.0-alpha-25</version>
+    </dependency>
   </dependencies>
 </project>

Modified: incubator/nmaven/trunk/plugins/maven-embedder-plugin/src/main/java/org/apache/maven/dotnet/plugin/embedder/EmbedderStarterMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-embedder-plugin/src/main/java/org/apache/maven/dotnet/plugin/embedder/EmbedderStarterMojo.java?view=diff&rev=561095&r1=561094&r2=561095
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-embedder-plugin/src/main/java/org/apache/maven/dotnet/plugin/embedder/EmbedderStarterMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-embedder-plugin/src/main/java/org/apache/maven/dotnet/plugin/embedder/EmbedderStarterMojo.java
Mon Jul 30 12:06:24 2007
@@ -31,6 +31,7 @@
 import java.util.logging.Logger;
 import java.io.File;
 import java.io.IOException;
+import java.io.FileOutputStream;
 import java.net.URL;
 import java.net.MalformedURLException;
 import java.net.URLConnection;
@@ -130,8 +131,8 @@
     {
         try
         {
-            logger.addHandler(
-                new FileHandler( System.getProperty( "user.home" ) + "\\.m2\\embedder-logs\\nmaven-embedder-log.xml"
) );
+            logger.addHandler( new FileHandler(
+                System.getProperty( "user.home" ) + "\\.m2\\embedder-logs\\nmaven-embedder-log.xml"
) );
         }
         catch ( IOException e )
         {
@@ -152,18 +153,20 @@
         ArtifactRepository localArtifactRepository =
             new DefaultArtifactRepository( "local", "file://" + localRepository, new DefaultRepositoryLayout()
);
 
+        /*
         artifactContext.init( project, remoteRepositories, localRepository );
 
         try
         {
             artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile(
"VisualStudio2005",
-                                                                                        
      new ArrayList<Dependency>() );
+                                                                                        
      new ArrayList<Dependency>(),
+                                                                                        
      null );
         }
         catch ( IOException e )
         {
-            throw new MojoExecutionException(e.getMessage());
+            throw new MojoExecutionException( e.getMessage() );
         }
-
+        */
         Set<Artifact> artifactDependencies = new HashSet<Artifact>();
         Artifact artifact = artifactFactory.createDependencyArtifact( "org.mortbay.jetty",
"jetty-embedded",
                                                                       VersionRange.createFromVersion(
"6.1.5" ), "jar",
@@ -189,13 +192,44 @@
             throw new MojoExecutionException( "", e );
         }
 
+        String classPath = artifactsToClassPath( result.getArtifacts() );
+
         List<String> commands = new ArrayList<String>();
         commands.add( "-Dport=" + String.valueOf( port ) );
         commands.add( "-DwarFile=" + warFile.getAbsolutePath() );
         commands.add( "-classpath" );
-        commands.add( artifactsToClassPath( result.getArtifacts() ) );
+        commands.add( classPath );
         commands.add( "org.apache.maven.dotnet.jetty.JettyStarter" );
         logger.info( commands.toString() );
+        FileOutputStream commandFile = null;
+        try
+        {
+            //For logging purposes
+            commandFile =
+                new FileOutputStream( System.getProperty( "user.home" ) + "\\.m2\\embedder-logs\\command.txt"
);
+            String command = "java  -classpath " + classPath + " -Dport=" +
+                port + " -DwarFile=\"" + warFile.getAbsolutePath() + "\" org.apache.maven.dotnet.jetty.JettyStarter";
+            commandFile.write( command.getBytes() );
+        }
+        catch ( IOException e )
+        {
+
+        }
+        finally
+        {
+            if ( commandFile != null )
+            {
+                try
+                {
+                    commandFile.close();
+                }
+                catch ( IOException e )
+                {
+
+                }
+            }
+        }
+
         VendorInfo vendorInfo = VendorInfo.Factory.createDefaultVendorInfo();
         if ( vendor != null )
         {

Modified: incubator/nmaven/trunk/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java?view=diff&rev=561095&r1=561094&r2=561095
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-resolver-plugin/src/main/java/org/apache/maven/dotnet/plugin/resolver/NetDependencyResolverMojo.java
Mon Jul 30 12:06:24 2007
@@ -165,7 +165,7 @@
             try
             {
                 artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile(
profile,
-                                                                                        
          dependencies );
+                                                                                        
          dependencies, null );
             }
             catch ( IOException e )
             {

Modified: incubator/nmaven/trunk/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java?view=diff&rev=561095&r1=561094&r2=561095
==============================================================================
--- incubator/nmaven/trunk/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
(original)
+++ incubator/nmaven/trunk/plugins/maven-vsinstaller-plugin/src/main/java/org/apache/maven/dotnet/plugin/vsinstaller/VsInstallerMojo.java
Mon Jul 30 12:06:24 2007
@@ -50,13 +50,6 @@
     private String localRepository;
 
     /**
-     * The remote repository that contains the vsinstaller and NMaven artifacts.
-     *
-     * @parameter expression="${remoteRepository}"
-     */
-    private String remoteRepository;
-
-    /**
      * Provides services for obtaining artifact information and dependencies
      *
      * @component
@@ -64,11 +57,6 @@
     private ArtifactContext artifactContext;
 
     /**
-     * @component
-     */
-    private ArtifactHandlerManager artifactHandlerManager;
-
-    /**
      * Provides access to configuration information used by NMaven.
      *
      * @component
@@ -91,6 +79,12 @@
         throws MojoExecutionException, MojoFailureException
     {
 
+        File logs = new File( localRepository, "embedder-logs" );
+        if ( !logs.exists() )
+        {
+            logs.mkdir();
+        }
+
         RepositoryRegistry repositoryRegistry;
         try
         {
@@ -124,11 +118,18 @@
                                                                    new DefaultRepositoryLayout()
) );
         }
         artifactContext.init( null, remoteRepositories, new File( localRepository ) );
+        List<Dependency> javaDependencies = new ArrayList<Dependency>();
+        Dependency warFile = new Dependency();
+        warFile.setGroupId( "org.apache.maven.dotnet" );
+        warFile.setArtifactId( "dotnet-service-embedder" );
+        warFile.setVersion( "0.14" );
+        warFile.setType( "war" );
+        javaDependencies.add( warFile );
 
         try
         {
-            artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile(
"VisualStudio2005",
-                                                                                        
      new ArrayList<Dependency>() );
+            artifactContext.getArtifactInstaller().resolveAndInstallNetDependenciesForProfile(
"VisualStudio2005", null,
+                                                                                        
      javaDependencies );
         }
         catch ( IOException e )
         {

Modified: incubator/nmaven/trunk/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/trunk/pom.xml?view=diff&rev=561095&r1=561094&r2=561095
==============================================================================
--- incubator/nmaven/trunk/pom.xml (original)
+++ incubator/nmaven/trunk/pom.xml Mon Jul 30 12:06:24 2007
@@ -238,6 +238,11 @@
       </dependency>
       <dependency>
         <groupId>org.apache.maven</groupId>
+        <artifactId>maven-core</artifactId>
+        <version>${mavenVersion}</version>
+      </dependency>
+      <dependency>
+        <groupId>org.apache.maven</groupId>
         <artifactId>maven-artifact</artifactId>
         <version>${mavenVersion}</version>
       </dependency>
@@ -295,6 +300,16 @@
         <groupId>org.codehaus.plexus</groupId>
         <artifactId>plexus-utils</artifactId>
         <version>1.0.4</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-container-default</artifactId>
+        <version>1.0-alpha-25</version>
+      </dependency>
+      <dependency>
+        <groupId>org.codehaus.plexus</groupId>
+        <artifactId>plexus-component-api</artifactId>
+        <version>1.0-alpha-25</version>
       </dependency>
     </dependencies>
   </dependencyManagement>



Mime
View raw message