Bug 404633 - tycho-compiler-plugin should not fail if org.eclipse.jdt.core.prefs not present
Summary: tycho-compiler-plugin should not fail if org.eclipse.jdt.core.prefs not present
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: Tycho (show other bugs)
Version: unspecified   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Jan Sievers CLA
QA Contact:
URL:
Whiteboard:
Keywords: contributed
Depends on:
Blocks:
 
Reported: 2013-03-30 15:29 EDT by David Williams CLA
Modified: 2021-04-28 16:51 EDT (History)
3 users (show)

See Also:


Attachments
project settings (67.71 KB, image/png)
2014-10-06 04:48 EDT, Jan Sievers CLA
no flags Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Williams CLA 2013-03-30 15:29:38 EDT
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.).
Comment 1 Jan Sievers CLA 2013-10-21 06:45:18 EDT
also see related bug 414718
Comment 2 Jan Sievers CLA 2014-09-10 08:49:50 EDT
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.
Comment 3 Martin Schreiber CLA 2014-09-17 08:55:13 EDT
Submitted a patch for review: https://git.eclipse.org/r/33498
Comment 5 Tobias Oberlies CLA 2014-10-06 04:26:31 EDT
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"?
Comment 6 Jan Sievers CLA 2014-10-06 04:48:42 EDT
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.
Comment 7 Tobias Oberlies CLA 2014-10-06 07:49:26 EDT
(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.