Skip to content
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

eclipse: Let IDE compile into a different directory than target/ #365

Closed
vorburger opened this issue Aug 21, 2018 · 3 comments · Fixed by #366
Closed

eclipse: Let IDE compile into a different directory than target/ #365

vorburger opened this issue Aug 21, 2018 · 3 comments · Fixed by #366

Comments

@vorburger
Copy link
Member

vorburger commented Aug 21, 2018

Following up on #340 (and my various PRs related to that), I'm still regularly hitting another Eclipse IDE related problem when working on this project: Having both the IDE and a CLI Terminal for mvn open, one gets those annoying "conflicts" when Eclipse (M2E) seems to Build at the wrong time and interfere with a Maven build running on the CLI. For example, I've just hit the problem below, which of course makes no sense at all, and goes away after I disable Project > Build Automatically and then rebuild on the CLI:

[INFO] --- maven-compiler-plugin:3.8.0:testCompile (default-testCompile) @ jetcd-core ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 22 source files to /home/vorburger/dev/ODL/git.etcd/jetcd/jetcd-core/target/test-classes
[INFO] Some messages have been simplified; recompile with -Xdiags:verbose to get full output
[INFO] -------------------------------------------------------------
[ERROR] COMPILATION ERROR : 
[INFO] -------------------------------------------------------------
[ERROR] /home/vorburger/dev/ODL/git.etcd/jetcd/jetcd-core/src/test/java/io/etcd/jetcd/internal/impl/AuthClientTest.java:[113,9] cannot access Permission.Type
  class file for Permission.Type not found
[ERROR] /home/vorburger/dev/ODL/git.etcd/jetcd/jetcd-core/src/test/java/io/etcd/jetcd/internal/impl/AuthClientTest.java:[116,88] incompatible types: io.etcd.jetcd.auth.Permission.Type cannot be converted to Permission.Type
[INFO] 2 errors 

But one should not have to manually work around this of course, this isn't productive. In other projects I have worked on, I've solved this by configuring Eclipse (via a change to a projects POM) to use target-ide/ instead of target/, so that the two build environments don't step onto each others foot.

If there is no objection, I'll raise a PR which proposes the same for this project as well.

PS: Some days I wonder if we shouldn't have a better global parent POM for this - @fbricon ?

@fbricon
Copy link

fbricon commented Aug 23, 2018

this is the right solution for this problem. As for having a global parent pom.xml? YMMV. Some projects using hot-reload benefit from having the build output shared between the IDE and CLI.
For a local development workflow requiring regular CLI builds, I think skipping the clean part of the build is usually acceptable and doesn't cause problems. Because you're not actually performing production deployment from your machine, are you? ;-)

@vorburger
Copy link
Member Author

vorburger commented Aug 23, 2018 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging a pull request may close this issue.

2 participants