Skip to content

Commit

Permalink
Fix main class in pom file. (#264)
Browse files Browse the repository at this point in the history
Summary:
Building with `mvn install` currently results in a jar with a missing main class, as `main` was moved to core/src/main/java/com/facebook/ktfmt/cli/Main.kt

Pull Request resolved: #264

Test Plan:
Imported from GitHub, without a `Test Plan:` line.

Before this change, trying to run the built jar fails:
```
% $JAVA_HOME/bin/java -jar ~/.m2/repository/com/facebook/ktfmt/0.31-SNAPSHOT/ktfmt-0.31-SNAPSHOT-jar-with-dependencies.jar
Error: Could not find or load main class com.facebook.ktfmt.MainKt
```

After this fix, the JAR loads fine:
```
% $JAVA_HOME/bin/java -jar ~/.m2/repository/com/facebook/ktfmt/0.31-SNAPSHOT/ktfmt-0.31-SNAPSHOT-jar-with-dependencies.jar
Usage: ktfmt [--dropbox-style | --google-style | --kotlinlang-style] File1.kt File2.kt ...
```

Updated the [wiki](https://www.internalfb.com/intern/wiki/Ktfmt_(aka_facebook-kotlin-format)/Testing_Changes/) to include this check.

Reviewed By: hick209

Differential Revision: D33240462

Pulled By: davidtorosyan

fbshipit-source-id: cb5687e8e33e8b00709a2a79c17af27e51cd61bb
  • Loading branch information
mpetrov authored and facebook-github-bot committed Dec 20, 2021
1 parent b7b74c2 commit daf9488
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
<kotlin.version>1.5.0</kotlin.version>
<kotlin.compiler.incremental>true</kotlin.compiler.incremental>
<kotlin.compiler.jvmTarget>1.8</kotlin.compiler.jvmTarget>
<main.class>com.facebook.ktfmt.MainKt</main.class>
<main.class>com.facebook.ktfmt.cli.Main</main.class>
</properties>

<pluginRepositories>
Expand Down

0 comments on commit daf9488

Please sign in to comment.