-
Notifications
You must be signed in to change notification settings - Fork 157
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
narSystemDirectory violates 'Convention over configuration' principle #156
Comments
Please clarify. The statement
and the statement
seem to contradict each other. Second, if the statement
is true, then the suggestion to "do it the Maven way" would introduce a serious bug instead of solving one. Lastly, IMHO
needs a conclusive answer before going any further with this ticket, given that Eclipse is the most popular Java IDE of them all, by far. |
Sorry, I didn't use Eclipse for many years and my assumptions can be wrong. It seems that all folders in Eclipse project can have only two states: "source folder" or not (please correct me if I'm wrong). Intellj IDEA has more advanced project structure. It distinguishes different types of folders: "source", "resources", "test source", "test resources", "generated sources" and "excluded". When you import/update maven project in Eclipse, it detects all sources in 'target ' regardless of relative path and adds them to "Java Build Path". When you do the same in Intellij IDEA, it sets "target" directory type to "Excluded" and content of directory is excluded from search, refactoring and other actions. On the other hand Intellij knows that maven plugins typically put generated source code to So here is the main difference between Eclipse and Intellij: Although 48% of developers use Eclipse, according to the same survey 49% would prefer to use Intellij IDEA. So users of this IDE should not be ignored. |
This is incorrect. The NAR plugin has to do extra work to let Eclipse know about the
I am absolutely, utterly uninterested in a discussion which IDE is better. The point is that a fix for IntelliJ that breaks Eclipse support is not a fix. If you want to support IntelliJ better, that is a laudable goal; You just have to find a way that does not break things that are Working Right Now. |
I agree that
I also agree with @dscho that after this change, testing should be done in Eclipse, NetBeans, IntelliJ and CLI to verify that everything works in all four. @ponomandr I would also suggest being careful with your analysis of such issues; my understanding is that both NetBeans and IDEA lean heavily on Maven CLI tools to do the build, so things are supposed to work the same as on the CLI in those IDEs. If IDEA currently has problems, it would be good to have an MCVE illustrating otherwise, rather than jumping straight to a proposed solution. |
@ponomandr I pushed a patch that implements your suggestion—which which I agree, BTW: using Could you please test it, and see if it fixes your issue with IntelliJ IDEA? |
@ctrueden It looks like When I tested this configuration:
I got the source generated in Then I added `narSystemDirectory' configuration:
The code was generated at To make sure I use correct version of the plugin, I removed @Parameter(defaultValue = "${project.build.dir}/generated-sources/nar", required = true)
private String narSystemDirectory = "zzz"; // Modified this value And the resulting output dir became |
@ponomandr OK, so the |
tl;dr
Change default value of
narSystemDirectory
fromtarget/nar/nar-generated
totarget/generated-sources/nar
Rationale
By convention Maven plugins put generated sources to
target/generated-sources/<something>
directory. This value is so common that many IDEs recognize it by default and attach this directory as a source dir to the project. I'm not sure about Eclipse, but Intellij and Netbeans do this. Intellij IDEA even warns you if you try to modify a file in the 'generated-sources' dir.On the other hand, Intellij IDEA marks
target
directory as "excluded". So the content of the directory is completely ignored (except 'generated-sources' subdirectory). Because of that,NarSystem.java
is not visible for IDE and the project cannot compile.Moreover, it's not possible to configure
narSystemDirectory
to point to `target/generated-sources'The text was updated successfully, but these errors were encountered: