add the sources from apm-agent in to the final sources jar #3063
Add this suggestion to a batch that can be applied as a single commit. This suggestion is invalid because no changes were made to the code. Suggestions cannot be applied while the pull request is closed. Suggestions cannot be applied while viewing a subset of changes. Only one suggestion per line can be applied in a batch. Add this suggestion to a batch that can be applied as a single commit. Applying suggestions on deleted lines is not supported. You must change the existing code in this line in order to create a valid suggestion. Outdated suggestions cannot be applied. This suggestion has been applied or marked resolved. Suggestions cannot be applied from pending reviews. Suggestions cannot be applied on multi-line comments. Suggestions cannot be applied while the pull request is queued to merge. Suggestion cannot be applied right now. Please check back later.
What does this PR do?
In 1.27.0 we restructured the subprojects so that all the main agent dependency management was moved from
elastic-apm-agenttoapm-agent, with no direct dependency onapm-agentfromelastic-apm-agent. Instead it was made into a shaded dependency. This was to make the agent more isolated to reduce conflicts in classloading related to agent classes. An unnoticed side-effect of this was that the sources jar inelastic-apm-agentno longer contained the full agent sources.To fix this, I tried a number of different configurations. Any configuration that directly added the
apm-agentas a dependency caused the class jar file to contain the classes as well as the shaded classes, so those configurations failed. The shading plugin should have been able to create all the sources of the shaded dependencies, but although I tried really hard I couldn't find the magic combo that produced that. So I've gone with the brute force approach of just merging the sources from theapm-agentsources jar into theelastic-apm-agentsources jar. This has the advantage of being very simple, but the disadvantage of directly depending on a source jar file existing in another project.Additionally this PR fixes the missing
co.elastic.apm.agent.configuration->co.elastic.apm.agent.premain.configurationthat @JonasKunz noticedChecklist