Comments (9)
We haven't yet released a version of this plugin based on 2023-03. Can you try using a snapshot of this plugin, from the head commit of this repo's main branch?
from formatter-maven-plugin.
It would also be helpful to know what you've set your language compliance to in the plugin's configuration, or if you have set maven.compiler.release
property at all.
from formatter-maven-plugin.
This is my plugin configuration, where ${formatter-maven-plugin.version} is 2.22.0:
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>${formatter-maven-plugin.version}</version>
<configuration>
<configFile>${session.executionRootDirectory}/formatter.xml</configFile>
<encoding>UTF-8</encoding>
<lineEnding>LF</lineEnding>
</configuration>
<executions>
<execution>
<id>format</id>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
from formatter-maven-plugin.
Ok, you are right: I see here that Eclipse 4.27 is not supported yet. Heve you already defined a milestone for the new release?
from formatter-maven-plugin.
@mirkoscotti We are about to release... but I don't know if it will fix your issue. You could verify by trying a snapshot, as previously suggested, unless you just want to wait and see. Also consider looking at compiler compliance options to ensure your config is set up correctly. I had thought the options defaulted to maven.compiler.release
, but it seems they might default to maven.compiler.source
. See the config. It's possible that it does actually work, but you aren't setting the compliance level appropriate for the formatter to understand the correct version of the Java source.
from formatter-maven-plugin.
I added compilerCompliance to the configuration, but did not work, so I will wait for the new version
<plugin>
<groupId>net.revelc.code.formatter</groupId>
<artifactId>formatter-maven-plugin</artifactId>
<version>${formatter-maven-plugin.version}</version>
<configuration>
<configFile>${session.executionRootDirectory}/formatter.xml</configFile>
<encoding>UTF-8</encoding>
<lineEnding>LF</lineEnding>
<compilerCompliance>17</compilerCompliance>
</configuration>
<executions>
<execution>
<id>format</id>
<goals>
<goal>format</goal>
</goals>
</execution>
</executions>
</plugin>
from formatter-maven-plugin.
I do not know if this can be useful, but my compiler configuration in pluginManagement is this:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>${maven-compiler-plugin.version}</version>
<configuration>
<release>${java.version}</release>
</configuration>
</plugin>
where ${java.version}
is 17
from formatter-maven-plugin.
This plugin definitely wouldn't be affected by the maven-compiler-plugin's configuration. However, an alternate way of setting maven-compiler-plugin's configuration is through the use of properties, some of which do also affect this plugin.
<properties>
<maven.compiler.release>11</maven.compiler.release>
<maven.compiler.source>11</maven.compiler.source>
<maven.compiler.target>11</maven.compiler.target>
</properties>
I checked our source code, and it seems that we don't yet interpret the release one. It doesn't matter, though, if you set compilerCompliance
explicitly in this plugin's config. I would try setting all three of ours: compilerCompliance
, compilerSource
, and compilerTargetPlatform
. If that still doesn't work, then maybe when the new version is released, it will work.
from formatter-maven-plugin.
You can try using formatter-maven-plugin 2.23.0, which is based on the newer Eclipse, and I just released. I'll close this for now. Please comment here if it still doesn't work, so we can re-open and troubleshoot further.
from formatter-maven-plugin.
Related Issues (20)
- Sealed interfaces are not correctly formatted HOT 3
- Not able to run validate due to ExtensionRegistry return null value HOT 4
- False configuration used for line Indentation HOT 2
- lineEnding=KEEP breaks JSON validation on Windows HOT 6
- Report problematic line number in error message HOT 3
- Tab treated as one space for the purpose of line length HOT 3
- Includes are not honored by includeResources HOT 3
- Rewrite the cache store to match that done on impsort HOT 1
- Please use change log or github releases HOT 3
- Support 'windows' users for contributions HOT 1
- No documentation for 'find-transitive-eclipse-updates.sh' and it does not work on windows without additional software HOT 1
- Next Release: placeholder to prevent release HOT 6
- Java 21 compliance HOT 1
- Incorrect documentation HOT 5
- Formatter no longer formats in version 2.24.0 HOT 10
- Integration Tests needed - Good for first time contributors
- NPE: Cannot invoke "org.eclipse.jdt.internal.compiler.ast.TypeReference.extraDimensions()" with version 2.24 HOT 1
- Allow 'validate' to write violations to a file, and not stop the build HOT 1
- Js Formatter not work HOT 6
- JSON formatting option "spaceBeforeSeparator" is ignored HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from formatter-maven-plugin.