Gradle 1.0m6 changes jar resource behavior

gradle 1.0m6 seems to have changed the behavior on building a jar containing only resources.

in m3 this worked:

sourceSets.main.resources {
    srcDirs = ["../../src/java/core"]
    include "com/web/bpo/ui/portlet/"

I get this error on m6, runs fine on m3 12:21:10.473 [ERROR] [org.gradle.BuildExceptionReporter] Caused by: java.lang.IllegalArgumentException: A Jar can only accept a valid file or directory: /Users/pswenson/dev/sag/optimize/trunk/gradle/bpo-resource/build/classes/main

in m6, it looks for a “classes” directory and errors out.

Is there a work-around?

I can’t reproduce this. Can you show the rest of the build script? What task(s) do you run? Which OS?

OS X, “gradle assemble”

the project is very simple. For the subproject in question, there are no “source” files, only resources.

The root project is:

apply plugin: 'idea'
buildscript {
    dependencies {
  subprojects {
    apply plugin: 'bas-osgi'
    sourceCompatibility = 5
    targetCompatibility = 5

the subproject that is the prob is code is

sourceSets.main.resources {
    srcDirs = ["../../../src/java/core"]
    include "com/myco/bpo/ui/portlet/"

Still can’t reproduce. Can you attach a project that demonstrates the issue?

I can reproduce this issue locally even with Gradle 1.0 Final Here is the step: -Create folder structure like this: +resource-only






|------------sample-resource.conf (empty file) -Run ‘gradle jar’ Here is the content of the build.gradle

apply plugin: 'java'
apply plugin: 'osgi'

If I remove the plugin osgi, everything works as expected! So there is some wrong with osgi plugin in this case.

Raised as GRADLE-2391.