Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uploaded War or Tar information is not printing on Jenkins console after upgrading to Gradle 6

I have updated gradle from 4.6 to 6.1, now the problem is I cant see any information printed on jenkins console upon running publishBootJavaPublicationToMavenRepository task.

Before after this task use to see something like Upload: http://nexusblabla.war but now nothing is printing with this task.

like image 560
Prasanna Kumar H A Avatar asked Feb 07 '20 13:02

Prasanna Kumar H A


People also ask

How do I update Jenkins gradle?

Jenkins→ Manage Jenkins→ Configure Jenkins→ Configure system. Under "Gradle Installations" type in name (it appears as version in project configuration), check "Install automatically" and select version. Then you can select that "Gradle version" in project configuration.

Where do we configure maven gradle in Jenkins?

Configuration. Gradle configuration is performed in the Configure System (before Jenkins 2.0) or Global Tool Configuration (starting in Jenkins 2.0). In both cases these options reside in the Manage Jenkins section.


1 Answers

tl;dr

If you simply would like to get back the log messages for uploaded files, then you have to use Gradle’s --info command line option. To stay with your example:

gradle --info publishBootJavaPublicationToMavenRepository

Some Background

I don’t know why but obviously the log level for these messages has changed from LIFECYLCE to INFO with Gradle 4.10. You can see the difference with the --debug option when publishing:

  • with Gradle 4.9 you get:
11:44:55.666 [LIFECYCLE] [org.gradle.internal.resource.transfer.ProgressLoggingExternalResourceUploader] Upload http://127.0.0.1:8000/com/example/foo/1.0.0/foo-1.0.0.zip
  • with Gradle 4.10.3 you get:
11:55:44.666 [INFO] [org.gradle.api.publication.maven.internal.action.LoggingMavenTransferListener] Uploading: com/example/foo/3.0.0/foo-3.0.0.zip to repository remote at http://127.0.0.1:8000/

Unfortunately, this change does neither seem to be mentioned in the release notes nor any issue/commit – or at least I couldn’t find any such mentions. For completeness’ sake, here are all release notes entries for Gradle versions newer than 4.6 that are related to console logging:

  • https://docs.gradle.org/4.7/release-notes.html#logs-grouped-by-task-for-non-interactive-executions
  • https://docs.gradle.org/4.8.1/release-notes.html#changes-to-plain-console-behavior
  • https://docs.gradle.org/5.2.1/release-notes.html#rich-console-improvements-on-windows
  • https://docs.gradle.org/5.6.4/release-notes.html#rich-console-output-on-linux-aarch64-machines
like image 72
Chriki Avatar answered Sep 28 '22 15:09

Chriki