Community
Participate
Working Groups
According to http://wiki.eclipse.org/Tycho/FAQ#How_to_configure_warning.2Ferror_settings_of_the_OSGi_compiler.3F we should be able to configure the JDT compiler using <compilerArguments> <properties>${project.basedir}/.settings/org.eclipse.jdt.core.prefs</properties> </compilerArguments> I thought this was pretty cool and might be an easy way to get "per project" settings, without everyone modifying the POM files for individual deviations from the norm. But, I've learned, if that setting is set in parent pom, then if any project does not have that .settings file, Tycho will "fail" hard and stop compiling. Seems to me it should just print a polite warning in log and continue on, using whatever other defaults it derives (either from project pom, or those inherited.).
also see related bug 414718
JDT compiler itself considers a non-existing prefs file as an error, so we would have to handle this in Tycho code before invoking the compiler. I could imagine a useProjectSettings switch <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-compiler-plugin</artifactId> <version>${tycho-version}</version> <configuration> <useProjectSettings>true</useProjectSettings> </configuration> </plugin> This would use ${project.basedir}/.settings/org.eclipse.jdt.core.prefs if present. If not present, log a warning.
Submitted a patch for review: https://git.eclipse.org/r/33498
http://git.eclipse.org/c/tycho/org.eclipse.tycho.git/commit/?id=424318f9f3124dfd8368f86ee4811435d01ec54c thanks for the patch!
Reading the release notes makes me think that the word "project" in the new switch is not ideal because in the Tycho context "project" is most often used to mean "Maven project". Would you object if I was to change the new switch from "useProjectSettings" to "useEclipseSettings"?
Created attachment 247637 [details] project settings not a better name choice IMHO. eclipse has both project and workspace settings. go ahead and do as you like but please resolve this bug.
(In reply to comment #6) > not a better name choice IMHO. eclipse has both project and workspace settings. Good point. I would not have thought of the workspace settings because Tycho can't know where the workspace is. But this may not be as obvious to others as it is to me. So would "useEclipseProjectSettings" sound better to you? To me not really. But I think that I've now understood what the original name meant. It will simply be enough to mention in the documentation that the prefs file contains the Eclipse settings on project level. I'll do that eventually.