Java – what does shadow plugin gradle: mergeservicefiles() do?
•
Java
In my build In the gradle file, I need to add the following lines:
shadowJar { mergeServiceFiles() }
Otherwise, the tank will not work properly I wonder what this line does? I use the gradle plug - in in eclipse Luna I created a jar on one java project, which depends on another java project
Solution
Why don't you investigate what you do in your code? Mergeservicefiles is just declared here. Its implementation is as follows:
/** * Syntactic sugar for merging service files in JARs * @return */ public ShadowJar mergeServiceFiles() { try { transform(ServiceFileTransformer.class); } catch (illegalaccessexception e) { } catch (InstantiationException e) { } return this; }
As you can see, it uses the servicefiletransfomer. XML defined as here From its documents:
The content of this article comes from the network collection of netizens. It is used as a learning reference. The copyright belongs to the original author.
THE END
二维码