Git Product home page Git Product logo

Comments (9)

ctubbsii avatar ctubbsii commented on September 21, 2024

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.

ctubbsii avatar ctubbsii commented on September 21, 2024

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.

mirkoscotti avatar mirkoscotti commented on September 21, 2024

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.

mirkoscotti avatar mirkoscotti commented on September 21, 2024

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.

ctubbsii avatar ctubbsii commented on September 21, 2024

@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.

mirkoscotti avatar mirkoscotti commented on September 21, 2024

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.

mirkoscotti avatar mirkoscotti commented on September 21, 2024

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.

ctubbsii avatar ctubbsii commented on September 21, 2024

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.

ctubbsii avatar ctubbsii commented on September 21, 2024

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)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.