Gradle: How to copy a folder from another project to a multi-project script?

I have a multiproject script:

dependencies { compile '...' ... compile project(':component1') runtime project(':component2') } 

I need to copy the bin folder from components1 and component2 to the bin folder of the current project.

UPDATE: I need it to be able to "Run as" → "Run on Server" in Eclipse. Each project has Java code and web interface files and depends on other projects in the workspace. Assembly Deployment does not allow you to copy compiled classes from another project.

+6
source share
1 answer

I do not understand that you need to completely copy folders.

But here is the custom copy task:

 task copyBin(type: Copy) { from project(':component1').file('bin') into file('bin') } 

And connect to the build process:

 jar.dependsOn copyBin 
+7
source

All Articles