Author: tchemit Date: 2008-07-22 20:06:35 +0000 (Tue, 22 Jul 2008) New Revision: 760 Modified: trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorGoal.java Log: utilisation d'un r?\195?\169pertoire de compilation dans le projet Modified: trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorGoal.java =================================================================== --- trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorGoal.java 2008-07-22 18:03:24 UTC (rev 759) +++ trunk/lutinjaxx/maven/src/main/java/org/codelutin/jaxx/JaxxGeneratorGoal.java 2008-07-22 20:06:35 UTC (rev 760) @@ -25,6 +25,7 @@ import org.apache.maven.plugin.MojoExecutionException; import org.apache.maven.plugin.MojoFailureException; import org.apache.maven.plugin.logging.Log; +import org.apache.maven.project.MavenProject; import org.codehaus.plexus.util.DirectoryScanner; import java.io.File; @@ -38,8 +39,16 @@ * @phase process-resources */ public class JaxxGeneratorGoal extends AbstractMojo { - /** + * The maven project. + * + * @parameter expression="${project}" + * @read-only + * @required + */ + private MavenProject project; + + /** * @description R�pertoire sources des fichiers jaxx � g�n�rer. * @parameter expression="${jaxx.src}" default-value="${basedir}/src/uimodel" */ @@ -83,7 +92,12 @@ private static final String[] INCLUDES = {"**\\/*.jaxx"}; public void execute() throws MojoExecutionException, MojoFailureException { + if (!out.exists()) { + out.mkdirs(); + } + fixCompileSourceRoots(); + DirectoryScanner ds; ds = new DirectoryScanner(); ds.setBasedir(getSrc()); @@ -194,4 +208,10 @@ public String[] getFiles() { return files; } + + protected void fixCompileSourceRoots() { + if (!project.getCompileSourceRoots().contains(out.getPath())) { + project.addCompileSourceRoot(out.getPath()); + } + } } \ No newline at end of file
participants (1)
-
tchemit@users.labs.libre-entreprise.org