On Mon, Nov 26, 2012 at 5:53 PM, Barrie Treloar <[email protected]> wrote:
> On Tue, Nov 27, 2012 at 9:44 AM, Javier Ortiz <[email protected]> > 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? > Yes, it was bounded to process-sources and I tried to change it to generate-resources as the eclipse plugin without any changes. > 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. > I'll give it a try. > > --------------------------------------------------------------------- > To unsubscribe, e-mail: [email protected] > For additional commands, e-mail: [email protected] > >
