ces-build-lib
ces-build-lib copied to clipboard
Jenkins pipeline shared library adding features for Maven, Gradle, Docker, SonarQube, Git and others
Using the `sh` step is prone to error when using pipes. It's good practice to set `set -o pipefail` in all bash scripts because otherwise: ```bash cat missingFile | sed...
`env.BRANCH_NAME` is only present in multi-branch pipeline builds, regular pipelines don't have information about branches. Affected methods: * `Git.getBranchName()` * `SonarQube.initMavenForRegularAnalysis()` We could use `git rev-parse --abbrev-ref HEAD` in `Git`...
Via `settings.xml` we can setup mirrors for Maven Repos, e.g. central. ```xml ${url} ${url} Central Mirror ${urll}/nexus/content/groups/public central ``` ces-build-lib could help us doing that. We already use [writing `settings.xml`...
Don't use a complete copy of local repo, because it makes the first build slow and uses a lot of extra space. Use it only for the artefacts that are...
``` java.lang.IllegalAccessError: class com.cloudogu.ces.cesbuildlib.SonarCloud tried to access private field com.cloudogu.ces.cesbuildlib.SonarQube.isUsingBranchPlugin (com.cloudogu.ces.cesbuildlib.SonarCloud and com.cloudogu.ces.cesbuildlib.SonarQube are in unnamed module of loader org.jenkinsci.plugins.workflow.cps.CpsGroovyShell$CleanGroovyClassLoader @7dfc8298) at com.cloudogu.ces.cesbuildlib.SonarCloud.(SonarCloud.groovy:14) at com.cloudogu.ces.cesbuildlib.SonarCloud.(SonarCloud.groovy:12) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)...