apm-agent-java
apm-agent-java copied to clipboard
Fix source jar created on Jenkins build
After multiple tests, current situation is: The elastic-apm-agent pom.xml has two related plugins involved with the source jar build-
- the maven-source-plugin is invoked at the
prepare-packagephase - the maven-shade-plugin creates a source jar with the shaded sources
I am not entirely sure the first is required here, it is required for the attach source jar.
Invoking the exact same command as invoked by Jenkins - ./mvnw clean install -DskipTests=true -Dmaven.javadoc.skip=true creates the jar as expected. However, on Jenkins, the jar is created only with the shaded sources and without our sources (at least - this is what gets stored for the build artifacts).
Rafael found a solution: https://github.com/raphw/byte-buddy/issues/783#issuecomment-559613610
Doing some other task that required me to unarchive and look into jars reminded me this was never fixed.
The issue also affects our Javadoc jar. Both it and the sources jar only contain the co.elastic.apm.agent.premain package.
Maybe time to look into this.