incubator-nmaven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From sisb...@apache.org
Subject svn commit: r518318 [2/2] - in /incubator/nmaven/branches/SI_IDE/components: dotnet-embedder/ dotnet-embedder/src/ dotnet-embedder/src/main/ dotnet-embedder/src/main/java/ dotnet-embedder/src/main/java/org/ dotnet-embedder/src/main/java/org/apache/ dot...
Date Wed, 14 Mar 2007 20:48:00 GMT
Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/pom.xml?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/pom.xml (added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/pom.xml Wed Mar 14 13:47:58
2007
@@ -0,0 +1,38 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <parent>
+    <groupId>org.apache.maven.dotnet</groupId>
+    <version>0.14-SNAPSHOT</version>
+    <artifactId>dotnet-components</artifactId>
+  </parent>
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.dotnet</groupId>
+  <artifactId>dotnet-embedder</artifactId>
+  <version>0.14-SNAPSHOT</version>
+  <name>dotnet-embedder</name>
+  <description>
+    NMaven
+  </description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven</groupId>
+      <artifactId>maven-embedder</artifactId>
+      <version>2.0.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.xfire</groupId>
+      <artifactId>xfire-plexus</artifactId>
+      <version>1.2</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.xfire</groupId>
+      <artifactId>xfire-java5</artifactId>
+      <version>1.2.4</version>
+    </dependency>
+    <dependency>
+      <groupId>org.codehaus.xfire</groupId>
+      <artifactId>javax.ws</artifactId>
+      <version>1.0.0</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,18 @@
+package org.apache.maven.dotnet.embedder;
+
+public interface MavenEmbedderService
+{
+
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = MavenEmbedderService.class.getName();
+
+    /**
+     *
+     * @param request
+     */
+    void execute( MavenExecutionRequest request );
+
+    
+}

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenEmbedderService.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,19 @@
+package org.apache.maven.dotnet.embedder;
+
+import org.codehaus.xfire.aegis.type.java5.*;
+
+@XmlType(namespace="urn:maven-embedder")
+public interface MavenExecutionRequest
+{
+
+    /**
+     * Role used to register component implementations with the container.
+     */
+    String ROLE = MavenExecutionRequest.class.getName();
+
+    @XmlElement(name="pomFile", namespace="urn:maven-embedder")
+    String getPomFile();
+
+    void setPomFile(java.lang.String string);
+
+}

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/MavenExecutionRequest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,159 @@
+package org.apache.maven.dotnet.embedder.impl;
+
+import org.apache.maven.dotnet.embedder.MavenEmbedderService;
+import org.apache.maven.dotnet.embedder.MavenExecutionRequest;
+import org.apache.maven.embedder.MavenEmbedder;
+import org.apache.maven.embedder.MavenEmbedderException;
+import org.apache.maven.embedder.MavenEmbedderConsoleLogger;
+import org.apache.maven.embedder.PlexusLoggerAdapter;
+import org.apache.maven.embedder.MavenEmbedderLogger;
+import org.apache.maven.BuildFailureException;
+import org.apache.maven.cli.ConsoleDownloadMonitor;
+import org.apache.maven.cli.MavenCli;
+import org.apache.maven.monitor.event.EventMonitor;
+import org.apache.maven.monitor.event.DefaultEventMonitor;
+import org.apache.maven.lifecycle.LifecycleExecutionException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.ProjectBuildingException;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
+import org.codehaus.plexus.personality.plexus.lifecycle.phase.Disposable;
+import org.codehaus.plexus.util.dag.CycleDetectedException;
+import org.codehaus.plexus.logging.LogEnabled;
+import org.codehaus.plexus.logging.Logger;
+import org.codehaus.classworlds.ClassWorld;
+import org.codehaus.classworlds.DuplicateRealmException;
+
+import java.util.List;
+import java.util.ArrayList;
+import java.util.Properties;
+import java.io.File;
+
+public final class MavenEmbedderServiceImpl
+    implements MavenEmbedderService, Initializable, Disposable, LogEnabled
+{
+
+    private MavenEmbedder embedder;
+
+    private Logger logger;
+
+    private MavenEmbedderConsoleLogger embedderLogger;
+
+    public MavenEmbedderServiceImpl()
+    {
+    }
+
+    public void enableLogging( Logger logger )
+    {
+        this.logger = logger;
+    }
+
+    /*
+     *  Uses the CLI
+     */
+    public void execute( MavenExecutionRequest request )
+    {
+        String args[] = new String[3];
+        args[0] = "install";
+        File pomFile = new File( "..\\dotnet-artifact\\pom.xml" );
+        args[1] = "-f";
+        args[2] = pomFile.getAbsolutePath();
+        ClassWorld classWorld = new ClassWorld();
+        try
+        {
+            classWorld.newRealm( "plexus.core", Thread.currentThread().getContextClassLoader()
);
+        }
+        catch ( DuplicateRealmException e )
+        {
+            e.printStackTrace();
+        }
+        MavenCli.main( args, classWorld );
+
+    }
+
+    /*
+     * Uses the embedder
+     */
+    public void execute1( MavenExecutionRequest request )
+    {
+
+        MavenProject mavenProject = null;
+        try
+        {
+            mavenProject = embedder.readProject( new File( request.getPomFile() ) );
+        }
+        catch ( ProjectBuildingException e )
+        {
+            logger.info( "", e );
+        }
+        List<String> goals = new ArrayList<String>();
+        goals.add( "install" );
+        File executionRootDirectory =
+            new File(new File( request.getPomFile() ).getParent());
+        EventMonitor eventMonitor =
+            new DefaultEventMonitor( new PlexusLoggerAdapter( new MavenEmbedderConsoleLogger()
) );
+
+        try
+        {
+            embedder.execute( mavenProject, goals, eventMonitor, new ConsoleDownloadMonitor(),
new Properties(),
+                              executionRootDirectory );
+        }
+        catch ( CycleDetectedException e )
+        {
+            e.printStackTrace();
+        }
+        catch ( LifecycleExecutionException e )
+        {
+            e.printStackTrace();
+        }
+        catch ( BuildFailureException e )
+        {
+            printFullTrace( e );
+        }
+        catch ( org.apache.maven.project.DuplicateProjectException e )
+        {
+            e.printStackTrace();
+        }
+    }
+
+    private void printFullTrace( Throwable t )
+    {
+        Throwable cause = t.getCause();
+        if ( cause != null )
+        {
+            printFullTrace( cause );
+        }
+    }
+
+    public void initialize()
+    {
+        embedderLogger = new MavenEmbedderConsoleLogger();
+        embedderLogger.setThreshold( MavenEmbedderLogger.LEVEL_DEBUG );
+        embedder = new MavenEmbedder();
+
+        embedder.setClassLoader( Thread.currentThread().getContextClassLoader() );
+        embedder.setLogger( embedderLogger );
+        embedder.setAlignWithUserInstallation( true );
+        embedder.setLocalRepositoryDirectory( new File( System.getProperty( "user.home" )
+ File.separator + ".m2" ) );
+
+        try
+        {
+            embedder.start();
+        }
+        catch ( MavenEmbedderException e )
+        {
+            e.printStackTrace();
+        }
+    }
+
+    public void dispose()
+    {
+        try
+        {
+            embedder.stop();
+        }
+        catch ( MavenEmbedderException e )
+        {
+            e.printStackTrace();
+        }
+    }
+}

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenEmbedderServiceImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,18 @@
+package org.apache.maven.dotnet.embedder.impl;
+
+import org.apache.maven.dotnet.embedder.MavenExecutionRequest;
+
+public class MavenExecutionRequestImpl
+    implements MavenExecutionRequest
+{
+
+    public void setPomFile( java.lang.String string )
+    {
+
+    }
+
+    public String getPomFile()
+    {
+          return "";
+    }
+}

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/java/org/apache/maven/dotnet/embedder/impl/MavenExecutionRequestImpl.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,31 @@
+<component-set>
+  <components>
+    <component>
+      <role>org.apache.maven.dotnet.embedder.MavenEmbedderService</role>
+      <implementation>org.apache.maven.dotnet.embedder.impl.MavenEmbedderServiceImpl</implementation>
+    </component>
+    <component>
+      <role>org.apache.maven.dotnet.embedder.MavenExecutionRequest</role>
+      <implementation>org.apache.maven.dotnet.embedder.impl.MavenExecutionRequestImpl</implementation>
+    </component>
+    <component>
+      <role>org.codehaus.xfire.plexus.config.ConfigurationService</role>
+      <implementation>org.codehaus.xfire.plexus.config.DefaultConfigurationService</implementation>
+      <configuration>
+        <services>
+          <service>
+            <name>MavenEmbedderService</name>
+            <namespace>http://incubator.apache.org/nmaven/MavenEmbedderService</namespace>
+            <serviceClass>org.apache.maven.dotnet.embedder.MavenEmbedderService</serviceClass>
+          </service>
+        </services>
+      </configuration>
+      <requirements>
+        <requirement>
+          <role>org.codehaus.xfire.plexus.config.Configurator</role>
+          <role-hint>org.codehaus.xfire.service.object.ObjectService</role-hint>
+        </requirement>
+      </requirements>
+    </component>
+  </components>
+</component-set>

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/main/resources/META-INF/plexus/components.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/test/java/ServiceTest.java
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/test/java/ServiceTest.java?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/test/java/ServiceTest.java
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/test/java/ServiceTest.java
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,17 @@
+import junit.framework.TestCase;
+import org.apache.maven.dotnet.embedder.MavenEmbedderService;
+import org.apache.maven.dotnet.embedder.MavenExecutionRequest;
+import org.apache.maven.dotnet.embedder.impl.MavenEmbedderServiceImpl;
+import org.apache.maven.dotnet.embedder.impl.MavenExecutionRequestImpl;
+
+public class ServiceTest
+    extends TestCase
+{
+    public void testA()
+    {
+        MavenEmbedderServiceImpl service = new MavenEmbedderServiceImpl();
+        service.initialize();
+        MavenExecutionRequest request = new MavenExecutionRequestImpl();
+        //service.execute( request );
+    }
+}

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-embedder/src/test/java/ServiceTest.java
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/pom.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/pom.xml?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/pom.xml (added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/pom.xml Wed Mar 14
13:47:58 2007
@@ -0,0 +1,19 @@
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+  <modelVersion>4.0.0</modelVersion>
+  <groupId>org.apache.maven.dotnet</groupId>
+  <artifactId>dotnet-service-embedder</artifactId>
+  <version>0.14-SNAPSHOT</version>
+  <packaging>war</packaging>
+  <name>dotnet-service-embedder</name>
+  <description>
+    NMaven
+  </description>
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.maven.dotnet</groupId>
+      <artifactId>dotnet-embedder</artifactId>
+      <version>0.14-SNAPSHOT</version>
+    </dependency>
+  </dependencies>
+</project>
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/pom.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<plexus>
+  <load-on-start>
+    <component>
+      <role>org.codehaus.xfire.plexus.config.ConfigurationService</role>
+    </component>
+  </load-on-start>
+</plexus>
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/plexus.xml
------------------------------------------------------------------------------
    svn:eol-style = native

Added: incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/web.xml
URL: http://svn.apache.org/viewvc/incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/web.xml?view=auto&rev=518318
==============================================================================
--- incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/web.xml
(added)
+++ incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/web.xml
Wed Mar 14 13:47:58 2007
@@ -0,0 +1,25 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<web-app xmlns="http://java.sun.com/xml/ns/j2ee"
+         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+         xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd"
+         version="2.4">
+  <display-name>Maven Embedder Service</display-name>
+  <listener>
+    <listener-class>org.codehaus.plexus.servlet.PlexusServletContextListener</listener-class>
+  </listener>
+  <servlet>
+    <servlet-name>XFire</servlet-name>
+    <display-name>XFire Servlet</display-name>
+    <servlet-class>
+      org.codehaus.xfire.plexus.PlexusXFireServlet
+    </servlet-class>
+  </servlet>
+  <servlet-mapping>
+    <servlet-name>XFire</servlet-name>
+    <url-pattern>/servlet/XFireServlet/*</url-pattern>
+  </servlet-mapping>
+  <servlet-mapping>
+    <servlet-name>XFire</servlet-name>
+    <url-pattern>/services/*</url-pattern>
+  </servlet-mapping>
+</web-app>
\ No newline at end of file

Propchange: incubator/nmaven/branches/SI_IDE/components/dotnet-service/embedder/src/main/webapp/WEB-INF/web.xml
------------------------------------------------------------------------------
    svn:eol-style = native



Mime
View raw message