[
http://jira.andromda.org/browse/MAVEN-64?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Plushnikov Michail closed MAVEN-64.
-----------------------------------
Resolution: Not an issue
Fix Version/s: 3.4-SNAPSHOT
We don't provide our implementation of multi-source-plugin anymore.
You can use codehaus plugin instead:
<groupId>org.codehaus.mojo</groupId>
<artifactId>build-helper-maven-plugin</artifactId>
http://mojo.codehaus.org/build-helper-maven-plugin/usage.html
> Support for test-multi-source in maven
> --------------------------------------
>
> Key: MAVEN-64
> URL: http://jira.andromda.org/browse/MAVEN-64
> Project: Maven Plugins
> Issue Type: New Feature
> Environment: maven 2.0.4, jdk 1.5
> Reporter: Pawel Matras
> Assignee: Plushnikov Michail
> Fix For: 3.4-SNAPSHOT
>
>
> Modified version of
> andromda-all/maven/2/multi-source/src/main/java/org/andromda/maven/plugin/MultiSourceMojo.java
> follows (as I can not see an other way of attaching it). It adds to current
> implementation a possibility for additional test source paths. Usage is
> similar to existing one. In addition or instead of the <sourceDirectories>
> tag you use <testSourceDirectories> tag in plugin configuration.
> I have tested it with maven 2.0.4 and jdk 1.5.
> It would be fine if this or similar patch could be applied on the
> 3.3-SNAPSHOT branch and newer.
> ----------------------------- MultiSourceMojo.java
> -----------------------------------
> package org.andromda.maven.plugin.multisource;
> import java.util.Iterator;
> import java.util.List;
> import org.andromda.core.common.ResourceUtils;
> import org.apache.commons.lang.ObjectUtils;
> import org.apache.maven.plugin.AbstractMojo;
> import org.apache.maven.plugin.MojoExecutionException;
> import org.apache.maven.plugin.MojoFailureException;
> import org.apache.maven.project.MavenProject;
> /**
> * A Mojo who's sole purpose is to allow multiple source roots
> * to be added to the project (since the Maven Compiler Plugin
> * doesn't allow it), this plugin should be removed if they
> * allow it in the future.
> *
> * @author Chad Brandon
> * @goal add-source
> * @phase generate-sources
> */
> public class MultiSourceMojo
> extends AbstractMojo
> {
> /**
> * The source directories containing the sources to be compiled.
> *
> * @parameter
> * @required
> */
> private List sourceDirectories;
> /**
> * The test source directories containing the sources to be compiled for
> test.
> *
> * @parameter
> * @required
> */
> private List testSourceDirectories;
> /**
> * The maven project.
> *
> * @parameter expression="${project}"
> * @required
> * @readonly
> * @description "the maven project to use"
> */
> private MavenProject project;
> /**
> * @see org.apache.maven.plugin.Mojo#execute()
> */
> public void execute()
> throws MojoExecutionException, MojoFailureException
> {
> String baseDirectory =
> ResourceUtils.normalizePath(ObjectUtils.toString(project.getBasedir()) + '/');
> addNormalizedPaths( this.sourceDirectories,
> this.project.getCompileSourceRoots(), baseDirectory );
> addNormalizedPaths( this.testSourceDirectories,
> this.project.getTestCompileSourceRoots(), baseDirectory );
> }
>
> private void addNormalizedPaths( List fromPaths, List toPaths, String
> baseDirectory )
> {
> for (final Iterator iterator = fromPaths.iterator();
> iterator.hasNext();)
> {
> String path =
> ResourceUtils.normalizePath((String)iterator.next());
> if (!path.startsWith(baseDirectory))
> {
> path = ResourceUtils.normalizePath(baseDirectory + path);
> }
> toPaths.add(path);
> }
> }
> }
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.andromda.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
------------------------------------------------------------------------------
This SF.Net email is sponsored by the Verizon Developer Community
Take advantage of Verizon's best-in-class app development support
A streamlined, 14 day to market process makes app distribution fast and easy
Join now and get one step closer to millions of Verizon customers
http://p.sf.net/sfu/verizon-dev2dev