All Projects → SimonJPegg → mvn_scalafmt

SimonJPegg / mvn_scalafmt

Licence: Apache-2.0 license
Scalafmt plugin for maven

Programming Languages

scala
5932 projects
java
68154 projects - #9 most used programming language
shell
77523 projects

Projects that are alternatives of or similar to mvn scalafmt

Appassembler
Stars: ✭ 69 (+392.86%)
Mutual labels:  maven, maven-plugin
Jib
🏗 Build container images for your Java applications.
Stars: ✭ 11,370 (+81114.29%)
Mutual labels:  maven, maven-plugin
Git Commit Id Maven Plugin
Maven plugin which includes build-time git repository information into an POJO / *.properties). Make your apps tell you which version exactly they were built from! Priceless in large distributed deployments... :-)
Stars: ✭ 1,187 (+8378.57%)
Mutual labels:  maven, maven-plugin
Graphql Java Codegen Maven Plugin
Maven plugin for graphql-java-codegen
Stars: ✭ 17 (+21.43%)
Mutual labels:  maven, maven-plugin
Formatter Maven Plugin
Formatter Maven Plugin
Stars: ✭ 187 (+1235.71%)
Mutual labels:  maven, maven-plugin
Rpm Maven Plugin
Stars: ✭ 52 (+271.43%)
Mutual labels:  maven, maven-plugin
Jgitver Maven Plugin
maven core extension to automatically define versions using jgitver & git tags
Stars: ✭ 117 (+735.71%)
Mutual labels:  maven, maven-plugin
Javapackager
📦 Gradle/Maven plugin to package Java applications as native Windows, Mac OS X, or GNU/Linux executables and create installers for them.
Stars: ✭ 285 (+1935.71%)
Mutual labels:  maven, maven-plugin
Sortpom
Maven plugin that helps the user sort pom.xml.
Stars: ✭ 185 (+1221.43%)
Mutual labels:  maven, maven-plugin
Maven Git Versioning Extension
This extension will virtually set project versions, based on current git branch or tag.
Stars: ✭ 178 (+1171.43%)
Mutual labels:  maven, maven-plugin
Maven Min Plugin
📦 Latke application JavaScript and CSS files compression.
Stars: ✭ 5 (-64.29%)
Mutual labels:  maven, maven-plugin
markdown-page-generator-plugin
Markdown to HTML Page Generator Maven Plugin
Stars: ✭ 48 (+242.86%)
Mutual labels:  maven, maven-plugin
Javafx Maven Plugin
Maven plugin for JavaFX
Stars: ✭ 764 (+5357.14%)
Mutual labels:  maven, maven-plugin
Animal Sniffer
Stars: ✭ 59 (+321.43%)
Mutual labels:  maven, maven-plugin
Proguard Maven Plugin
ProGuard Maven plugin that supports modularised ProGuard packages
Stars: ✭ 353 (+2421.43%)
Mutual labels:  maven, maven-plugin
Flatten Maven Plugin
Flatten Maven Plugin
Stars: ✭ 82 (+485.71%)
Mutual labels:  maven, maven-plugin
jcabi-maven-plugin
Supplementary maven plugin for AspectJ weaving and versioning of artifacts
Stars: ✭ 25 (+78.57%)
Mutual labels:  maven, maven-plugin
docker-compose-maven-plugin
Run docker-compose with Maven
Stars: ✭ 68 (+385.71%)
Mutual labels:  maven, maven-plugin
Gatling Maven Plugin Demo
Showcase of the Gatling Plugin for Maven
Stars: ✭ 162 (+1057.14%)
Mutual labels:  maven, maven-plugin
Versions Maven Plugin
Versions Maven Plugin
Stars: ✭ 199 (+1321.43%)
Mutual labels:  maven, maven-plugin

licenseimg Codacy Coverage Build Status Total alerts

releasebadge Maven

Synopsis

A wrapper that allows the use of the Scalafmt formatter in Maven.

Usage

Add the following snippet to your pom, and it will be invoked as part of your build during the selected lifecycle phase (default validate).

Note: version.scala.binary refers to major releases of scala ie. 2.11, 2.12 or 2.13.
mvn_scalafmt_2.11 will soon be deprecated and may not receive future releases

You can also invoke the plugin directly via mvn scalafmt:format.

Versioning

This plugin follows the following versioning convention:

mvn_scalafmt_(scalaversion)-(major).(minor).(commitepoch).(commithash)

The latest release should be visible at the top of this readme.

Minimal Working POM XML:

    <plugin>
        <groupId>org.antipathy</groupId>
        <!-- The scala binary here doesn't need to match the project version -->
        <artifactId>mvn-scalafmt_${version.scala.binary}</artifactId>
        <!-- This represents the desired version of the plugin, whould be in the form:
             (major).(minor).(commitepoch).(commithash), which can be found here:
             https://github.com/simonjpegg/mvn_scalafmt/releases
             e.g. <version>1.0.1589620826.41b214a</version>
             Note: The SCALA version is OMITTED from this value
        -->
        <version>__DESIRED_MVN_SCALAFMT_VERSION__</version>
        <configuration>
            <configLocation>${project.basedir}/.scalafmt.conf</configLocation> <!-- path to config -->
        </configuration>
        <executions>
            <execution>
                <phase>validate</phase>
                <goals>
                    <goal>format</goal>
                </goals>
            </execution>
        </executions>
    </plugin>

FULL SNIPPET

<plugin>
    <groupId>org.antipathy</groupId>
    <!-- The scala binary here doesn't need to match the project version -->
    <artifactId>mvn-scalafmt_${version.scala.binary}</artifactId>
    <!-- This represents the desired version of the plugin, whould be in the form:
         (major).(minor).(commitepoch).(commithash), which can be found here:
         https://github.com/simonjpegg/mvn_scalafmt/releases
         e.g. <version>1.0.1589620826.41b214a</version>
         Note: The SCALA version is OMITTED from this value
    -->
    <version>__DESIRED_MVN_SCALAFMT_VERSION__</version>
    <configuration>
        <configLocation>${project.basedir}/.scalafmt.conf</configLocation> <!-- path to config -->
        <skipTestSources>false</skipTestSources> <!-- (Optional) skip formatting test sources -->
        <skipSources>false</skipSources> <!-- (Optional) skip formatting main sources -->
        <sourceDirectories> <!-- (Optional) Paths to source-directories. Overrides ${project.build.sourceDirectory} -->
          <param>${project.basedir}/src/main/scala</param>
        </sourceDirectories>
        <testSourceDirectories> <!-- (Optional) Paths to test-source-directories. Overrides ${project.build.testSourceDirectory} -->
          <param>${project.basedir}/src/test/scala</param>
        </testSourceDirectories>
        <validateOnly>false</validateOnly> <!-- check formatting without changing files -->
        <onlyChangedFiles>true</onlyChangedFiles> <!-- only format (staged) files that have been changed from the specified git branch -->
        <showReformattedOnly>false</showReformattedOnly> <!-- log only modified files -->
        <!-- The git branch to check against
             If branch.startsWith(": ") the value in <branch> tag is used as a command to run
             and the output will be used as the actual branch-->
        <branch>: git rev-parse --abbrev-ref HEAD</branch> <!-- the current branch-->
        <!-- <branch>master</branch>-->
        <useSpecifiedRepositories>false</useSpecifiedRepositories> <!-- use project repositories configuration for scalafmt dynamic loading -->
    </configuration>
    <executions>
        <execution>
            <phase>validate</phase> <!-- default -->
            <goals>
                <goal>format</goal>
            </goals>
        </execution>
    </executions>
</plugin>

configLocation Can either be a local path (e.g. ${project.basedir}/.scalafmt.conf) or a HTTP url (e.g https://raw.githubusercontent.com/jozic/scalafmt-config/master/.scalafmt.conf)

make sure you have set a version in your scalafmt.conf

version = "2.6.2"
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].