uklance / gradle-dependency-export

Export maven dependencies from a gradle project to the file system
28 stars 15 forks source link

Are test resources included? #9

Open robross0606 opened 5 years ago

robross0606 commented 5 years ago

Is this supposed to export test resources or just runtime? I don't see any of my test resources in the export.

robross0606 commented 5 years ago

I believe this is related to the "configurations" parameter, but it is unclear what you mean in your readme with the default behavior being "buildscript.configurations + project.configurations". What is the easiest way to include ALL standard gradle configurations?

uklance commented 5 years ago

By default all configurations are exported, including the test configurations for the java plugin. So jars like junit and mockito etc should be in the exported folder

robross0606 commented 5 years ago

This definitely did not happen. I had to explicitly list all the configs for them to export. The default behavior only appeared to export “compile”.

uklance commented 5 years ago

Hmm... That's strange. I'll have to add a test case to investigate

uklance commented 5 years ago

I wonder if this is a timing issue. Are you applying the dependency export plugin before the java plugin?

robross0606 commented 5 years ago

The mavenDependencyExport section is the last thing in the build.gradle file. This is a very simple single module project. Nothing complicated or strange about it, other than perhaps the fact that I'm calling the mavenDependencyExport output into a Zip:

task bundleDependencyRepo(type: Zip) {
    baseName = rootProject.name + '-repo'
    from mavenDependencyExport
}
robross0606 commented 5 years ago

I am using Gradle 5.3.1 and the latest JDK 8, if that info helps.

robross0606 commented 5 years ago

I think you were on to something with the "timing" comment. I had my mavenDependencyExport section after my bundeDependencyRepo task definition. When I switched that around so the mavenDependencyExport configuration was before the task definition in my build.gradle file, it appears to now be getting all configurations in the output.

uklance commented 5 years ago

See here

buildscript {
  repositories {
    maven {
      url "https://plugins.gradle.org/m2/"
    }
  }
  dependencies {
    classpath "gradle.plugin.com.lazan:gradle-dependency-export:0.5"
  }
}

apply plugin: "com.lazan.dependency-export"