Skip to content
This repository has been archived by the owner on Jan 31, 2024. It is now read-only.

Plugin Causes Project Java Version Configuration Issues #43

Open
karlnicholas opened this issue May 27, 2018 · 6 comments
Open

Plugin Causes Project Java Version Configuration Issues #43

karlnicholas opened this issue May 27, 2018 · 6 comments

Comments

@karlnicholas
Copy link

Environment: Eclipse-STS 3.9.4 (Eclipse Neon.3 (4.6.3)). Windows-10. Java 1.8.0_161.
Add the plugin to the feign parent project's pom. Use STS->Maven->Update Project and select the parent project and all module projects. Select project properties->Java Compiler for a module project and it will show Enable project specific settings enabled when it shouldn't be and no project specific settings will persist. It will show the warning "When selecting 9 compliance, make sure to have a compatible JRE installation activated (currently 1.8). Configure the "Installed JRE's" and "Execution Environments," or change the JRE on the "Java Build Path".

Immediately there will be no compile errors but opening a source file will show errors for JRE less than 1.5.

When you do project->clean (with compile automatically enabled) then all the sources will show errors related to JRE less than 1.5.

No changing of any global properties or project properties will solve the problems because every time you "clean" or whatever all the settings will revert to the problem conditions, or not be saved, or whatever.

@velo
Copy link
Owner

velo commented May 28, 2018

In theory, plugin should be reading version from pom properties section.

I just looked at feign/pom.xml and the 2 properties the plugin read seem to be there...
https://github.com/OpenFeign/feign/blob/master/pom.xml#L54

Could would attach eclipse error logs if any log is printed when you run Update Project?

Also, could you try this configuration:

<configuration>
...
  <compilerSource>1.8</compilerSource>
  <compilerCompliance>1.8</compilerCompliance>
  <compilerTargetPlatform>1.8</compilerTargetPlatform>
<configuration>

I used eclipse 4.8 here and don't see the issue you mentioned while building feign.

@karlnicholas
Copy link
Author

I don't see anything about the formatter in the error logs as viewed from Window->Show View->General->Error log.

Tried with this configuration:

  <plugin>
    <groupId>com.marvinformatics.formatter</groupId>
    <artifactId>formatter-maven-plugin</artifactId>
    <version>2.2.0</version>
    <configuration>
      <lineEnding>LF</lineEnding>
      <configFile>${main.basedir}/src/config/eclipse-java-style.xml</configFile>
	  <compilerSource>1.8</compilerSource>
	  <compilerCompliance>1.8</compilerCompliance>
	  <compilerTargetPlatform>1.8</compilerTargetPlatform>
    </configuration>
    <executions>
      <execution>
        <goals>
          <goal>format</goal>
        </goals>
        <phase>verify</phase>
      </execution>
    </executions>
  </plugin>

But it didn't make any difference. I also tried with Eclipse OXYGEN (4.X) and it wasn't different. I was using Eclipse-STS as stated.

Having a plugin change settings in Eclipse seems like a case of the child telling the parent what to do. Seems like a really bad idea.

@velo
Copy link
Owner

velo commented May 28, 2018

Having a plugin change settings in Eclipse seems like a case of the child telling the parent what to do. Seems like a really bad idea.

Really, then I would suggest disabling maven nature, as all it does it tell eclipse what to do.

@karlnicholas
Copy link
Author

Doesn't change the unless you do an Update Project, otherwise it executes maven. A formatter plugin seems like it should be formatting the code not messing with Eclipse settings.

@velo
Copy link
Owner

velo commented May 28, 2018

It does both.

The major goal of the plugin is prevent this mess from happening again
OpenFeign/feign@ad136c3

@karlnicholas
Copy link
Author

Works for me. I'm not arguing per-se about the philosophy of the plugin but I felt the need to add my $.02 worth.

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

No branches or pull requests

2 participants