Hi again,

Yep, it seems the "build-helper" Maven plugin is actually considered [1] and used to return the generated sources URIs.

Also it seems that Maven projects define an _internal_ constant for generated sources (see [2]), whose value is "GeneratedSources".

You can use that as a parameter to Sources [3] to see the appropriate folders. So, if I recall correctly, this should be something like:

----
Project p = ... // however you retrieve the project

Sources sources = ProjectUtils.getSources(p);

SourceGroup [] sourceGroups = sources.getSourceGroups("GeneratedSources");
----

Maybe this constant should be made public in the maven project API. In this case I'd place it somewhere at [4] (and use that constant in [2]). Also this is an API change, so this requires some extra stuff. I don't know if adding the constant is a good idea, though.

Hope this helps,
Antonio



[1]
https://github.com/apache/netbeans/blob/f21769aa59dbad7e6d317e05818babd2895cb8ab/java/maven/src/org/netbeans/modules/maven/NbMavenProjectImpl.java#L615

[2]
https://github.com/apache/netbeans/blob/f21769aa59dbad7e6d317e05818babd2895cb8ab/java/maven/src/org/netbeans/modules/maven/classpath/MavenSourcesImpl.java#L81

[3]
https://bits.netbeans.org/12.0/javadoc/org-netbeans-modules-projectapi/org/netbeans/api/project/Sources.html#getSourceGroups-java.lang.String-

[4]
https://github.com/apache/netbeans/blob/master/java/maven/src/org/netbeans/modules/maven/api/Constants.java




El 02/07/2020 a las 18:30, Antonio escribió:
For instance, you can use the Maven "build-helper" plugin to define any directory you want to store generated sources (https://www.mojohaus.org/build-helper-maven-plugin/usage.html) I don't know if our NbMavenProject is aware of this. You need to investigate it yourself.

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscr...@netbeans.apache.org
For additional commands, e-mail: dev-h...@netbeans.apache.org

For further information about the NetBeans mailing lists, visit:
https://cwiki.apache.org/confluence/display/NETBEANS/Mailing+lists



Reply via email to