Git Product home page Git Product logo

Comments (6)

ctubbsii avatar ctubbsii commented on May 24, 2024

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.

danyaljj avatar danyaljj commented on May 24, 2024

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.

ctubbsii avatar ctubbsii commented on May 24, 2024

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.

velo avatar velo commented on May 24, 2024

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.

danyaljj avatar danyaljj commented on May 24, 2024

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.

ctubbsii avatar ctubbsii commented on May 24, 2024

Yes, skipped refers to files that are already formatted.

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.