maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jdca...@apache.org
Subject svn commit: r1149307 - in /maven/sandbox/trunk/mae: mae-api/src/main/java/org/apache/maven/mae/ mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/
Date Thu, 21 Jul 2011 18:33:00 GMT
Author: jdcasey
Date: Thu Jul 21 18:32:58 2011
New Revision: 1149307

URL: http://svn.apache.org/viewvc?rev=1149307&view=rev
Log:
adding ability to control pom validation level to the ProjectToolsSession interface, and eliminating
unnecessary constructors from MAEException.

Modified:
    maven/sandbox/trunk/mae/mae-api/src/main/java/org/apache/maven/mae/MAEException.java
    maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/DefaultSessionInjector.java
    maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
    maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java

Modified: maven/sandbox/trunk/mae/mae-api/src/main/java/org/apache/maven/mae/MAEException.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-api/src/main/java/org/apache/maven/mae/MAEException.java?rev=1149307&r1=1149306&r2=1149307&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-api/src/main/java/org/apache/maven/mae/MAEException.java (original)
+++ maven/sandbox/trunk/mae/mae-api/src/main/java/org/apache/maven/mae/MAEException.java Thu
Jul 21 18:32:58 2011
@@ -31,18 +31,6 @@ public class MAEException
 
     private String formattedMessage;
 
-    public MAEException( final String message, final Throwable cause )
-    {
-        super( message, cause );
-        params = null;
-    }
-
-    public MAEException( final String message )
-    {
-        super( message );
-        params = null;
-    }
-
     public MAEException( final String message, final Throwable cause, final Object... params
)
     {
         super( message, cause );

Modified: maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/DefaultSessionInjector.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/DefaultSessionInjector.java?rev=1149307&r1=1149306&r2=1149307&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/DefaultSessionInjector.java
(original)
+++ maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/DefaultSessionInjector.java
Thu Jul 21 18:32:58 2011
@@ -64,6 +64,7 @@ public class DefaultSessionInjector
             {
                 pbr = embedder.serviceManager().createProjectBuildingRequest();
 
+                pbr.setValidationLevel( session.getPomValidationLevel() );
                 pbr.setProcessPlugins( session.isProcessPomPlugins() );
                 pbr.setResolveDependencies( false );
                 pbr.setSystemProperties( System.getProperties() );
@@ -113,13 +114,13 @@ public class DefaultSessionInjector
 
             // session.setWorkspaceReader( new ImportWorkspaceReader( workspace ) );
             rss.setConfigProperty( ProjectToolsSession.SESSION_KEY, session );
-            
+
             if ( localRepo != null )
             {
                 localRepo.mkdirs();
                 rss.setLocalRepositoryManager( new EnhancedLocalRepositoryManager( localRepo
) );
             }
-            
+
             rss.setWorkspaceReader( new SessionWorkspaceReader( session ) );
 
             sess = rss;

Modified: maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java?rev=1149307&r1=1149306&r2=1149307&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
(original)
+++ maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/ProjectToolsSession.java
Thu Jul 21 18:32:58 2011
@@ -92,14 +92,19 @@ public interface ProjectToolsSession
 
     ProjectToolsSession setDependencyFilter( DependencyFilter filter );
 
-    void connectProjectHierarchy( Artifact parent, boolean parentPreResolved, Artifact child,
boolean childPreResolved );
-    
+    ProjectToolsSession connectProjectHierarchy( Artifact parent, boolean parentPreResolved,
Artifact child,
+                                                 boolean childPreResolved );
+
     <T> T setState( T state );
-    
+
     <T> T getState( Class<T> stateType );
-    
+
     <T> T clearState( Class<T> stateType );
-    
+
     void clearStates();
-    
+
+    int getPomValidationLevel();
+
+    ProjectToolsSession setPomValidationLevel( int pomValidationLevel );
+
 }

Modified: maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
URL: http://svn.apache.org/viewvc/maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java?rev=1149307&r1=1149306&r2=1149307&view=diff
==============================================================================
--- maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
(original)
+++ maven/sandbox/trunk/mae/mae-components/mae-project-tools/src/main/java/org/apache/maven/mae/project/session/SimpleProjectToolsSession.java
Thu Jul 21 18:32:58 2011
@@ -21,6 +21,7 @@ import static org.apache.maven.artifact.
 import org.apache.maven.artifact.repository.ArtifactRepository;
 import org.apache.maven.execution.MavenExecutionRequest;
 import org.apache.maven.model.Repository;
+import org.apache.maven.model.building.ModelBuildingRequest;
 import org.apache.maven.project.DefaultProjectBuildingRequest;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.ProjectBuildingRequest;
@@ -67,8 +68,10 @@ public class SimpleProjectToolsSession
 
     private DependencyFilter filter;
 
+    private int pomValidationLevel = ModelBuildingRequest.VALIDATION_LEVEL_MAVEN_2_0;
+
     private transient Map<Class<?>, Object> states = new HashMap<Class<?>,
Object>();
-    
+
     public SimpleProjectToolsSession()
     {
     }
@@ -284,7 +287,7 @@ public class SimpleProjectToolsSession
     {
         final SimpleProjectToolsSession copy = new SimpleProjectToolsSession();
         copy.resolveRepositories = resolveRepositories;
-        
+
         copy.localRepositoryDirectory = localRepositoryDirectory;
 
         copy.projectBuildingRequest =
@@ -427,13 +430,16 @@ public class SimpleProjectToolsSession
 
     /**
      * {@inheritDoc}
-     * @see org.apache.maven.mae.project.session.ProjectToolsSession#connectProjectHierarchy(org.sonatype.aether.artifact.Artifact,
boolean, org.sonatype.aether.artifact.Artifact, boolean)
+     * 
+     * @see org.apache.maven.mae.project.session.ProjectToolsSession#connectProjectHierarchy(org.sonatype.aether.artifact.Artifact,
+     *      boolean, org.sonatype.aether.artifact.Artifact, boolean)
      */
     @Override
-    public void connectProjectHierarchy( Artifact parent, boolean parentPreResolved, Artifact
child,
-                                         boolean childPreResolved )
+    public ProjectToolsSession connectProjectHierarchy( final Artifact parent, final boolean
parentPreResolved,
+                                                        final Artifact child, final boolean
childPreResolved )
     {
         // NOP.
+        return this;
     }
 
     @SuppressWarnings( "unchecked" )
@@ -443,7 +449,7 @@ public class SimpleProjectToolsSession
         {
             return (T) states.put( state.getClass(), state );
         }
-        
+
         return null;
     }
 
@@ -464,14 +470,26 @@ public class SimpleProjectToolsSession
         return state == null ? null : type.cast( state );
     }
 
-    public void setResolveRepositories( Repository...resolveRepositories )
+    public void setResolveRepositories( final Repository... resolveRepositories )
     {
         this.resolveRepositories = resolveRepositories;
     }
 
-    public void setLocalRepositoryDirectory( File localRepositoryDirectory )
+    public void setLocalRepositoryDirectory( final File localRepositoryDirectory )
     {
         this.localRepositoryDirectory = localRepositoryDirectory;
     }
 
+    @Override
+    public int getPomValidationLevel()
+    {
+        return pomValidationLevel;
+    }
+
+    public ProjectToolsSession setPomValidationLevel( final int pomValidationLevel )
+    {
+        this.pomValidationLevel = pomValidationLevel;
+        return this;
+    }
+
 }



Mime
View raw message