You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The default value of BP_GRADLE_BUILD_ARGUMENTS currently is --no-daemon -x test build. This does not seem a good practice to me, let me quote from the documentation of the Gradle Java Plugin and give more details:
test: Runs the unit tests using JUnit or TestNG.
check Depends on: test
Aggregate task that performs verification tasks, such as running the tests. Some plugins add their own verification tasks to check. You should also attach any custom Test tasks to this lifecycle task if you want them to execute for a full build. This task is added by the Base Plugin.
assemble Depends on: jar, and all other tasks that create artifacts attached to the archives configuration
Aggregate task that assembles all the archives in the project. This task is added by the Base Plugin.
build Depends on: check, assemble
Aggregate tasks that performs a full build of the project. This task is added by the Base Plugin.
Based on this, running -x test build has the following effects:
assemble creates the necessary artifacts for the image
test task is excluded, this means no unit tests
check is not excluded, this means that every other type of tests and checks will be executed: functional tests, integration tests, performance tests, checkstyle, pmd, spotbugs, spotless, code coverage (e.g.: jacoco), etc
build is not excluded, every other task that is hooked-up to build will be executed
I think this is not a good user experience and not a good example for the users. Since to me it seems having the right defaults is very important for paketo-buildpacks, I think based on the documentation, and based on the common practice, the right task to produce the necessary artifacts should be assemble so the default value of BP_GRADLE_BUILD_ARGUMENTS should be assemble --no-daemon.
The text was updated successfully, but these errors were encountered:
jonatan-ivanov
changed the title
Consider runnning assemble instead of -x test build
Consider running assemble instead of -x test build by default
Mar 7, 2021
Thanks for raising up this issue. +1 for making this change. It seems to bring the behavior more in line with the intent, which is to build the artifact and not run tests. I think it also puts this buildpack more in line with the Maven buildpack's behavior, which I also think is a good thing.
The default value of
BP_GRADLE_BUILD_ARGUMENTS
currently is--no-daemon -x test build
. This does not seem a good practice to me, let me quote from the documentation of the Gradle Java Plugin and give more details:test
: Runs the unit tests using JUnit or TestNG.check
Depends on:test
Aggregate task that performs verification tasks, such as running the tests. Some plugins add their own verification tasks to check. You should also attach any custom Test tasks to this lifecycle task if you want them to execute for a full build. This task is added by the Base Plugin.
assemble
Depends on:jar
, and all other tasks that create artifacts attached to the archives configurationAggregate task that assembles all the archives in the project. This task is added by the Base Plugin.
build
Depends on:check
,assemble
Aggregate tasks that performs a full build of the project. This task is added by the Base Plugin.
See the task graph of the
build
taskBased on this, running
-x test build
has the following effects:assemble
creates the necessary artifacts for the imagetest
task is excluded, this means no unit testscheck
is not excluded, this means that every other type of tests and checks will be executed: functional tests, integration tests, performance tests, checkstyle, pmd, spotbugs, spotless, code coverage (e.g.: jacoco), etcbuild
is not excluded, every other task that is hooked-up tobuild
will be executedI think this is not a good user experience and not a good example for the users. Since to me it seems having the right defaults is very important for paketo-buildpacks, I think based on the documentation, and based on the common practice, the right task to produce the necessary artifacts should be
assemble
so the default value ofBP_GRADLE_BUILD_ARGUMENTS
should beassemble --no-daemon
.The text was updated successfully, but these errors were encountered: