Comments (6)
I just put the following in my parent:
<eclipseFormatterStyle>${project.parent.basedir}/contrib/style.xml</eclipseFormatterStyle>
<plugin>
<groupId>com.googlecode.maven-java-formatter-plugin</groupId>
<artifactId>maven-java-formatter-plugin</artifactId>
<configuration>
<configFile>${eclipseFormatterStyle}</configFile>
</configuration>
</plugin>
And, for any child modules deeper than 1 level, I just override ${eclipseFormatterStyle}
appropriately.
from formatter-maven-plugin.
Just to make sure I understand it correctly: by "And, for any child modules deeper than 1 level, I just override ..." you mean you add this definition to pom.xml
of each module?
Do you have an example project doing this?
from formatter-maven-plugin.
Hmm, actually... it looks like I don't override... I have all my modules inheriting from the same parent, so that line works for all of them. The Apache Accumulo project does this: https://github.com/apache/accumulo/blob/master/pom.xml#L129
from formatter-maven-plugin.
Or, you make formatter plugin run only once by setting inheritance to false
https://maven.apache.org/guides/mini/guide-configuring-plugins.html#Using_the_inherited_Tag_In_Build_Plugins
from formatter-maven-plugin.
It worked! Great!
A side question: when I run mvn formatter:format
it shows me:
[INFO] --- formatter-maven-plugin:0.5.2:format (default-cli) @ illinois-edison ---
[INFO] Using 'UTF-8' encoding to format source files.
[INFO] Number of files to be formatted: 102
[INFO] Successfully formatted: 0 file(s)
[INFO] Fail to format : 0 file(s)
[INFO] Skipped : 102 file(s)
[INFO] Approximate time taken: 0s
Does "skipped" refer to the files that are already formatted?
from formatter-maven-plugin.
Yes, skipped refers to files that are already formatted.
from formatter-maven-plugin.
Related Issues (20)
- Drop dependabot in favor of Renovate HOT 3
- Mockito WHEN Bug in Eclipse formatting jdt core 3.32.0 and 3.33.0 HOT 3
- Large whitespace in debug output HOT 9
- Bad format of sealed interfaces extending other interfaces HOT 9
- Option to fail to process invalid setting id HOT 2
- New Configuration hashing into file hash breaks existing caching - only confirmed with XML at the moment HOT 2
- NOTICE: Eclipse 2023-06 Requires jdk 17 for many parts HOT 7
- Eclipse Formatter Attribute Ignored: Parameter After Annotation HOT 1
- 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
- Rewrite the cache store to match that done on impsort HOT 1
- Please use change log or github releases
- Support 'windows' users for contributions
- No documentation for 'find-transitive-eclipse-updates.sh' and it does not work on windows without additional software
- Next Release: placeholder to prevent release HOT 5
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.