~ubuntu-branches/ubuntu/trusty/build-helper-maven-plugin/trusty-proposed

« back to all changes in this revision

Viewing changes to src/main/java/org/codehaus/mojo/buildhelper/AddTestSourceMojo.java

  • Committer: Package Import Robot
  • Author(s): tony mancill, Emmanuel Bourg, tony mancill
  • Date: 2013-06-01 20:19:34 UTC
  • mfrom: (1.1.1)
  • Revision ID: package-import@ubuntu.com-20130601201934-hzv7zmdcgazfyupp
Tags: 1.7-1
[ Emmanuel Bourg ]
* Team upload.
* New upstream release
* Set the compiler source/target to 1.5
* Updated Standards-Version to 3.9.4 (no changes)
* debian/copyright:
  - Updated the Format URI to 1.0
  - Removed the duplicate Copyright fields

[ tony mancill ]
* debian/control:
  - Add libmaven-invoker-plugin-java to build-depends-indep.
  - Wrap long lines.
  - Update Vcs-Git URL.

Show diffs side-by-side

added added

removed removed

Lines of Context:
24
24
 * SOFTWARE.
25
25
 */
26
26
 
 
27
import java.io.File;
 
28
 
27
29
import org.apache.maven.plugin.AbstractMojo;
28
 
import org.apache.maven.plugin.MojoExecutionException;
29
30
import org.apache.maven.project.MavenProject;
30
31
 
31
 
import java.io.File;
32
 
 
33
32
/**
34
33
 * Add test source directories to the POM.
35
34
 *
36
35
 * @goal add-test-source
37
36
 * @phase generate-test-sources
38
37
 * @author <a href="dantran@gmail.com">Dan T. Tran</a>
39
 
 * @version $Id: AddTestSourceMojo.java 7305 2008-07-24 14:34:13Z dantran $
 
38
 * @version $Id: AddTestSourceMojo.java 14206 2011-06-21 21:14:29Z rfscholte $
40
39
 * @since 1.0
 
40
 * @threadSafe
41
41
 */
42
42
public class AddTestSourceMojo
43
43
    extends AbstractMojo
62
62
 
63
63
 
64
64
    public void execute()
65
 
        throws MojoExecutionException
66
65
    {        
67
 
        for ( int i = 0; i < sources.length; ++i )
 
66
        for ( File source : sources )
68
67
        {
69
 
            this.project.addTestCompileSourceRoot( this.sources[i].getAbsolutePath() );
70
 
                
71
 
            this.getLog().info( "Test Source directory: " + this.sources[i] + " added." );              
 
68
            this.project.addTestCompileSourceRoot( source.getAbsolutePath() );
 
69
            if( getLog().isInfoEnabled() )
 
70
            {
 
71
                getLog().info( "Test Source directory: " + source + " added." );              
 
72
            }
72
73
        }
73
74
    }
74
75
}