Giter VIP home page Giter VIP logo

Comments (5)

clausfod avatar clausfod commented on July 21, 2024

For async setup jobs this is "must have". For sync jobs it could be nice that the build did not fail, but instead gave the possibility to be unstable

from dependency-track-plugin.

sephiroth-j avatar sephiroth-j commented on July 21, 2024

Failing the build job if something is wrong with your build environment is a common behavior and it is intended (#9). It is also a signal (to you or Jenkins admin) that there is something abnormal and that needs your attention. If you want to ignore errors and make the job go on, use a pipeline job, wrap the dependencyTrackPublisher call in a try-catch block and do whatever makes you happy when an exception occurred.

Declarative Pipeline example

pipeline {
    agent any

    stages {
        stage('dependencyTrackPublisher') {
		steps {
		        withCredentials([string(credentialsId: '506ed685-4e2b-4d31-a44f-8ba8e67b6341', variable: 'API_KEY')]) {
				script {
					try {
						dependencyTrackPublisher artifact: 'target/bom.xml', projectName: 'my-project', projectVersion: 'my-version', synchronous: true, dependencyTrackApiKey: API_KEY
					} catch (e) {
						echo 'failed'
					}
				}
			}
		}
        }
    }
}

Scripted Pipeline example: see README

from dependency-track-plugin.

clausfod avatar clausfod commented on July 21, 2024

Thanks for that input. There is a lot of plugins for Jenkins supporting returning a response code when used, IMHO that would be much cleaner as this leaves the pipelines "in good shape" as you are able to create all you pipeline logic without a lot of try catches on different plugins.

It could be as simple as returning the HTTP code.

from dependency-track-plugin.

rvsoni avatar rvsoni commented on July 21, 2024

Hi @giacgbj

I face the same issue, I fix the code on my fork (rvsoni@eee4259)

I introduced an option on the global config advance section, also on job config, that can help you to just upload a BOM and not wait for the result, this would mark build success.

Pl. build this code and test it, Pl. let me know if there are any improvements,

Ravi

from dependency-track-plugin.

rvsoni avatar rvsoni commented on July 21, 2024

It prints the below logs on Jenkins and does not wait to collect the result. ```

Waiting for Jenkins to finish collecting data
channel stopped
[DependencyTrack] Publishing artifact to Dependency-Track - https://dtrack.example.com
[DependencyTrack] Not waiting for project analysis result.
[JaCoCo plugin] Collecting JaCoCo coverage data...

Ravi

from dependency-track-plugin.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.