maven-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From bentm...@apache.org
Subject svn commit: r683938 - in /maven/plugins/trunk/maven-invoker-plugin/src: main/java/org/apache/maven/plugin/invoker/ test/java/org/apache/maven/plugin/invoker/
Date Fri, 08 Aug 2008 11:14:40 GMT
Author: bentmann
Date: Fri Aug  8 04:14:39 2008
New Revision: 683938

URL: http://svn.apache.org/viewvc?rev=683938&view=rev
Log:
o Reduced visibility of classes/methods that are implementation details
o Fixed some problems reported by Checkstyle

Modified:
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/CompositeMap.java
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/FileLogger.java
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
    maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
    maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/CompositeMap.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/CompositeMap.java?rev=683938&r1=683937&r2=683938&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/CompositeMap.java
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/CompositeMap.java
Fri Aug  8 04:14:39 2008
@@ -28,6 +28,8 @@
 import org.codehaus.plexus.util.introspection.ReflectionValueExtractor;
 
 /**
+ * A map-like source to interpolate expressions.
+ * 
  * @author <a href="mailto:olamy@apache.org">olamy</a>
  * @since 22 nov. 07
  * @version $Id$
@@ -36,12 +38,29 @@
     implements Map
 {
 
+    /**
+     * The Maven project from which to extract interpolated values, never <code>null</code>.
+     */
     private MavenProject mavenProject;
 
+    /**
+     * The set of additional properties from which to extract interpolated values, never
<code>null</code>.
+     */
     private Properties properties;
 
+    /**
+     * Creates a new interpolation source backed by the specified Maven project and some
user-specified properties.
+     * 
+     * @param mavenProject The Maven project from which to extract interpolated values, must
not be <code>null</code>.
+     * @param properties The set of additional properties from which to extract interpolated
values, may be
+     *            <code>null</code>.
+     */
     protected CompositeMap( MavenProject mavenProject, Properties properties )
     {
+        if ( mavenProject == null )
+        {
+            throw new IllegalArgumentException( "no project specified" );
+        }
         this.mavenProject = mavenProject;
         this.properties = properties == null ? new Properties() : properties;
     }

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/FileLogger.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/FileLogger.java?rev=683938&r1=683937&r2=683938&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/FileLogger.java
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/FileLogger.java
Fri Aug  8 04:14:39 2008
@@ -31,7 +31,7 @@
 /**
  * @version $Id$
  */
-public class FileLogger
+class FileLogger
     implements InvocationOutputHandler
 {
 

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java?rev=683938&r1=683937&r2=683938&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InstallMojo.java
Fri Aug  8 04:14:39 2008
@@ -79,7 +79,7 @@
      * @required
      * @readonly
      */
-    protected ArtifactRepository localRepository;
+    private ArtifactRepository localRepository;
 
     /**
      * The path to the local repository into which the project artifacts should be installed
for the integration tests.

Modified: maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java?rev=683938&r1=683937&r2=683938&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/main/java/org/apache/maven/plugin/invoker/InvokerMojo.java
Fri Aug  8 04:14:39 2008
@@ -1098,7 +1098,7 @@
         return interpreter;
     }
 
-    protected List getGoals( final File basedir )
+    List getGoals( final File basedir )
     {
         List invocationGoals = goals;
 
@@ -1121,7 +1121,7 @@
         return invocationGoals;
     }
 
-    protected String[] getPoms()
+    String[] getPoms()
         throws IOException
     {
         String[] poms;
@@ -1281,7 +1281,7 @@
         return result;
     }
 
-    protected File buildInterpolatedFile( File originalFile, File targetDirectory, String
targetFileName )
+    File buildInterpolatedFile( File originalFile, File targetDirectory, String targetFileName
)
         throws MojoExecutionException
     {
         File interpolatedFile = new File( targetDirectory, targetFileName );
@@ -1349,7 +1349,7 @@
         return interpolatedFile;
     }
 
-    protected List getProfiles( File projectDirectory )
+    List getProfiles( File projectDirectory )
         throws MojoExecutionException
     {
         if ( profilesFile == null )

Modified: maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java
URL: http://svn.apache.org/viewvc/maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java?rev=683938&r1=683937&r2=683938&view=diff
==============================================================================
--- maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java
(original)
+++ maven/plugins/trunk/maven-invoker-plugin/src/test/java/org/apache/maven/plugin/invoker/InvokerMojoTest.java
Fri Aug  8 04:14:39 2008
@@ -47,8 +47,12 @@
     public void testReadGoalsFromFile()
         throws Exception
     {
+        MavenProjectStub project = new MavenProjectStub();
+        project.setTestClasspathElements( Collections.EMPTY_LIST );
+
         InvokerMojo invokerMojo = new InvokerMojo();
         setVariableValueToObject( invokerMojo, "goalsFile", "goals.txt" );
+        setVariableValueToObject( invokerMojo, "project", project );
         String dirPath = getBasedir() + "/src/test/resources/unit/goals-from-file/";
         List goals = invokerMojo.getGoals( new File( dirPath ) );
         assertEquals( 3, goals.size() );
@@ -57,8 +61,12 @@
     public void testSimpleRunValidate()
         throws Exception
     {
+        MavenProjectStub project = new MavenProjectStub();
+        project.setTestClasspathElements( Collections.EMPTY_LIST );
+
         InvokerMojo invokerMojo = new InvokerMojo();
         setVariableValueToObject( invokerMojo, "goalsFile", "validate-goal.txt" );
+        setVariableValueToObject( invokerMojo, "project", project );
         String dirPath = getBasedir() + "/src/test/resources/unit/goals-from-file/";
         List goals = invokerMojo.getGoals( new File( dirPath ) );
         assertEquals( 1, goals.size() );
@@ -74,9 +82,6 @@
             FileUtils.deleteDirectory( cloneProjectsTo );
         }
         //cloneProjectsTo.getParent()
-        MavenProjectStub project = new MavenProjectStub();
-        project.setTestClasspathElements( Collections.EMPTY_LIST );
-        setVariableValueToObject( invokerMojo, "project", project );
         setVariableValueToObject( invokerMojo, "cloneProjectsTo", cloneProjectsTo );
         setVariableValueToObject( invokerMojo, "postBuildHookScript", "verify.bsh" );
         setVariableValueToObject( invokerMojo, "settings", new Settings() );



Mime
View raw message