On Tue, Nov 27, 2012 at 9:44 AM, Javier Ortiz <javier.ortiz...@gmail.com> wrote: > I did go through all that documentation previous to posting the question > but in Stackoverflow and in the list. I replied to your answer and will do > here as well: > > I did read it and tried that as well, but the getCompileSourceRoots() > returns empty list. I was expecting the src/main/java at leaset but no > luck. I already took a look at the maven-compiler-plugin and the way they > do it but is equivalent to getting the MavenProject and calling > getCompileSourceRoots() but also gives an empty list. The project I'm > trying has one source file in the default src/main/java path.
Is your mojo bound to a phase correctly? Its been a while since I've gone hacking in this space. Have a look at https://svn.apache.org/repos/asf/maven/plugins/trunk/maven-eclipse-plugin/src/main/java/org/apache/maven/plugin/eclipse/EclipsePlugin.java in the buildDirectoryList(): extractSourceDirs( mainDirectories, project.getCompileSourceRoots(), basedir, projectBaseDir, false, null ); Why dont you check out the maven-eclipse-plugin project and * attach some debug output at the spots that are similar to where it doesn't work in your code and see if you can figure out what is not working. * morph it to a skeleton of what you are trying to do. That should give you enough to work out how to build your own mojo. --------------------------------------------------------------------- To unsubscribe, e-mail: users-unsubscr...@maven.apache.org For additional commands, e-mail: users-h...@maven.apache.org