Skip to content

Commit

Permalink
Deprecate --uber-jar option in quarkusBuild task
Browse files Browse the repository at this point in the history
  • Loading branch information
glefloch committed Feb 8, 2021
1 parent f4a1bce commit afc8efc
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,11 @@ public boolean isUberJar() {
return uberJar;
}

/**
* @deprecated use {@code quarkus.package.type} instead
*/
@Option(description = "Set to true if the build task should build an uberjar", option = "uber-jar")
@Deprecated
public void setUberJar(boolean uberJar) {
this.uberJar = uberJar;
}
Expand Down Expand Up @@ -131,7 +135,9 @@ public void buildQuarkus() {
effectiveProperties.setProperty("quarkus.package.user-configured-ignored-entries", joinedEntries);
}
boolean clear = false;
if (uberJar && System.getProperty("quarkus.package.uber-jar") == null) {
if (isUberJar() && System.getProperty("quarkus.package.uber-jar") == null) {
getLogger().lifecycle(
"The uberJar option is deprecated, and will be removed in a future version. To build an uber-jar set the config property quarkus.package.type=uber-jar. For more info see https://quarkus.io/guides/gradle-tooling#building-uber-jars");
System.setProperty("quarkus.package.uber-jar", "true");
clear = true;
}
Expand Down
6 changes: 3 additions & 3 deletions docs/src/main/asciidoc/gradle-tooling.adoc
Original file line number Diff line number Diff line change
Expand Up @@ -402,18 +402,18 @@ This task depends on `quarkusBuild`, so it will generate the native image before

== Building Uber-Jars

Quarkus Gradle plugin supports the generation of Uber-Jars by specifying an `--uber-jar` argument as follows:
Quarkus Gradle plugin supports the generation of Uber-Jars by specifying a `quarkus.package.type` argument as follows:

[source,bash]
----
./gradlew quarkusBuild --uber-jar
./gradlew quarkusBuild -Dquarkus.package.type=uber-jar
----

When building an Uber-Jar you can specify entries that you want to exclude from the generated jar by using the `--ignored-entry` argument:

[source,bash]
----
./gradlew quarkusBuild --uber-jar --ignored-entry=META-INF/file1.txt
./gradlew quarkusBuild -Dquarkus.package.type=uber-jar --ignored-entry=META-INF/file1.txt
----

The entries are relative to the root of the generated Uber-Jar. You can specify multiple entries by adding extra `--ignored-entry` arguments.
Expand Down

0 comments on commit afc8efc

Please sign in to comment.