Shaded jar from maven dependency copied to a certain directory


(Paul Wellner Bou) #1

Hello,

I am trying to create an executable jar file based on two libraries (maven jar dependencies, not executable) and it’s transitive dependecies. I want to copy this with a certain name to a certain directory. I did this in maven with this code:

<plugin>
 <groupId>org.apache.maven.plugins</groupId>
 <artifactId>maven-shade-plugin</artifactId>
 <executions>
  <execution>
   <goals>
    <goal>shade</goal>
   </goals>
   <phase>install</phase>
   <configuration>
    <transformers>
     <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
      <mainClass>${mainClass}</mainClass>
     </transformer>
    </transformers>
    <outputFile>release-${project.deployment.version}/${outputfile}</outputFile>
   </configuration>
  </execution>
 </executions>
</plugin>

How do I do this with gradle? I am spending already quite a time with the shadow plugin or the zip plugin, without success.