Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Gradle fails: plugin org.cyclonedx.bom not found #6

Closed
rasguanabana opened this issue Jul 1, 2019 · 6 comments
Closed

Gradle fails: plugin org.cyclonedx.bom not found #6

rasguanabana opened this issue Jul 1, 2019 · 6 comments

Comments

@rasguanabana
Copy link

Hi,

I wanted to try this plugin in a sample project. I changed build.gradle in following manner:

diff --git a/build.gradle b/build.gradle
index 59746ca..dab9488 100644
--- a/build.gradle
+++ b/build.gradle
@@ -3,7 +3,10 @@ plugins {
     id 'groovy'                           //for mixed java/groovy project
     id 'war'                                //for genarating war files
     id 'org.akhikhl.gretty' version '2.0.0' //web app development plugin
+    id 'org.cyclonedx.bom' version '1.0.0' apply true
 }
+apply plugin: 'java'
+apply plugin: 'maven'
 
 sourceCompatibility = "1.8"
 targetCompatibility = "1.8"
@@ -16,7 +19,7 @@ task wrapper(type: Wrapper) {
 }
 
 repositories {
-    mavenCentral()
+    mavenCentral() //already there
     maven {
         url "http://maven.restlet.org/"
     }

It fails however with following error:

$ sh gradlew cyclonedxBom

FAILURE: Build failed with an exception.

* Where:
* Build file '/home/*****/repos/_external/softeng17b/build.gradle' line: 6
*
* * What went wrong:
* Plugin [id: 'org.cyclonedx.bom', version: '1.0.0'] was not found in any of the following sources:
*
* - Gradle Core Plugins (plugin is not in 'org.gradle' namespace)
* - Gradle Central Plugin Repository (no 'org.cyclonedx.bom' plugin available - see https://plugins.gradle.org for available plugins)
*
* * Try:
* Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
*
* * Get more help at https://help.gradle.org
*
* BUILD FAILED in 1s
*

Could you help to check? Thanks.

@stevespringett
Copy link
Member

Gradle is unable to resolve the plugin. Refer to https://github.com/CycloneDX/cyclonedx-gradle-plugin/blob/master/src/test/settings.gradle

I'll add this to the readme.

@rasguanabana
Copy link
Author

Adding settings.gradle as stated in readme and upgrading Gradle version helped. Thanks!

stefanneuhaus added a commit to stefanneuhaus/cyclonedx-gradle-plugin that referenced this issue Aug 5, 2019
Apply plugin in a way proposed by the Gradle Team
@stefanneuhaus
Copy link
Contributor

stefanneuhaus commented Aug 5, 2019

The initial try with the plugins { } DSL block did not work as it always tries to retrieve the plugin from the Gradle Plugin Portal.

Using the traditional way of applying plugins it is also possible to retrieve plugins from other repositories like Maven Central. I provided a PR using this approach.

@stevespringett
Copy link
Member

Closing

@matteoturra
Copy link

matteoturra commented Sep 3, 2019 via email

@lock
Copy link

lock bot commented Oct 3, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked as resolved and limited conversation to collaborators Oct 3, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants