From: Romain <rom...@ne...> - 2014-04-08 08:40:17
|
Hi all, Here is an example for the configuration of a format plugin : <plugin> <groupId>com.googlecode.maven-java-formatter-plugin</groupId> <artifactId>maven-java-formatter-plugin</artifactId> <version>0.4</version> <executions> <execution> <goals> <goal>format</goal> </goals> </execution> </executions> <configuration> <lineEnding>LF</lineEnding> <encoding>UTF-8</encoding> <configFile>path/to/code-format.xml</configFile> </configuration> <dependencies> <dependency> <groupId>my.super.package</groupId> <artifactId>build-tools</artifactId> <version>1.0.0</version> </dependency> </dependencies> </plugin> As you can see, the format plugin has a dependency which holds the config file. In that case, the file is accessible in every module at every level. This is the same technique used for checkstyle : http://maven.apache.org/plugins/maven-checkstyle-plugin/examples/multi-module-config.html. Here is plugin URL : https://code.google.com/p/maven-java-formatter-plugin/ "This project aims to provide Java source file formatting using the Eclipse code formatter as a Maven plugin. " __ Romain Le 27 mars 2014 à 09:06, Alexis THAVEAU a écrit : > A maven plugin is a good idea. With a plugin, we can automatise the code formating task. If you have a look to source code, currently, sources (java and xml) don't have the same formating rules applied everywhere. > > > > Le 2014-03-26 18:50, Romain - opensource a écrit : > >> There is a maven plugin that does automatic formatting. >> The good thing is that it is compatible with eclipse formatting =) >> It will format java files each time there is a maven build. >> I'll check tomorrow on some projects to get the plugin name and how to configure it. >> Then, I'll send the conf on this ML. >> __ >> Romain >> >> >> >> Le 26 mars 2014 à 18:23, Francois-Xavier Bonnet a écrit : >> >>> Hi, >>> We are using CheckStyle formatting rules. In Eclipse, CheckStyle plugin is able to generate the formatter settings from the checkstyle configuration. I guess there is the same feature in IDEA. >>> 2014-03-26 17:57 GMT+01:00 <ale...@gm...>: >>> Hi, >>> I think we don't have a code formating policy on the project. Maybe it would be great to share and use the same file ? checkstyle configuration would be great too. >>> I don't know which IDE you have, I'm on IDEA Intellij, but i can import eclipse configuration file. >>> ------------------------------------------------------------------------------ >>> Learn Graph Databases - Download FREE O'Reilly Book >>> "Graph Databases" is the definitive new guide to graph databases and their >>> applications. Written by three acclaimed leaders in the field, >>> this first edition is now available. Download your free book today! >>> http://p.sf.net/sfu/13534_NeoTech >>> _______________________________________________ >>> Webassembletool-devel mailing list >>> Web...@li... >>> https://lists.sourceforge.net/lists/listinfo/webassembletool-devel >>> ------------------------------------------------------------------------------ >>> Learn Graph Databases - Download FREE O'Reilly Book >>> "Graph Databases" is the definitive new guide to graph databases and their >>> applications. Written by three acclaimed leaders in the field, >>> this first edition is now available. Download your free book today! >>> http://p.sf.net/sfu/13534_NeoTech_______________________________________________ >>> Webassembletool-devel mailing list >>> Web...@li... >>> https://lists.sourceforge.net/lists/listinfo/webassembletool-devel >> >> ------------------------------------------------------------------------------ >> Learn Graph Databases - Download FREE O'Reilly Book >> "Graph Databases" is the definitive new guide to graph databases and their >> applications. Written by three acclaimed leaders in the field, >> this first edition is now available. Download your free book today! >> >> http://p.sf.net/sfu/13534_NeoTech >> >> _______________________________________________ >> Webassembletool-devel mailing list >> >> Web...@li... >> https://lists.sourceforge.net/lists/listinfo/webassembletool-devel |