ajoberstar/gradle-plugins — Issue #2: FileNotFoundException regarding classes and resources
Author: xErik
Created: 2012-01-17 18:19:32+00:00
State: open

Hi there,

using this plugin I get a FileNotFoundException on my local Windows machine.
Please find the INFO outpit below. I also added my parent build.build.
These are my fist steps with Gradle, but I am not sure if the plugin is compatible with Gradle-1.0-M7.

Thanks,
Erik

```console
Starting Build
Settings evaluated using settings file 'C:\Users\esc\workspace\cash\settings.gradle'.
Projects loaded. Root project using build file 'C:\Users\esc\workspace\cash\build.gradle'.
Included projects: [root project 'cash', project ':cash-model']
Evaluating root project 'cash' using build file 'C:\Users\esc\workspace\cash\build.gradle'.
:: loading settings :: url = jar:file:/C:/Development/gradle-1.0-milestone-7/lib/ivy-2.2.0.jar!/org/apache/ivy/core/settings/ivysettings.xml
Evaluating project ':cash-model' using build file 'C:\Users\esc\workspace\cash\cash-model\build.gradle'.
All projects evaluated.
The SourceSet.getClasses() method is deprecated and will be removed in the next version of Gradle. You should use the getOutput() method instead.
Selected primary task 'build'
Tasks to be executed: [task ':compileJava', task ':processResources', task ':classes', task ':jar', task ':assemble', task ':compileTestJava', task ':findbugsMain', task ':processTestResources', task ':testClasses', task ':findbugsTest', task ':test', task ':check', task ':build', task ':cash-model:compileJava', task ':cash-model:processResources', task ':cash-model:classes', task ':cash-model:jar', task ':cash-model:assemble', task ':cash-model:compileTestJava', task ':cash-model:findbugsMain', task ':cash-model:processTestResources', task ':cash-model:testClasses', task ':cash-model:findbugsTest', task ':cash-model:test', task ':cash-model:check', task ':cash-model:build']
:compileJava
Skipping task ':compileJava' as it has no source files.
:compileJava UP-TO-DATE
:processResources
Skipping task ':processResources' as it has no source files.
:processResources UP-TO-DATE
:classes
Skipping task ':classes' as it has no actions.
:classes UP-TO-DATE
:jar
Skipping task ':jar' as it is up-to-date.
Skipping task ':jar' as it is up-to-date
:jar UP-TO-DATE
:assemble
Skipping task ':assemble' as it has no actions.
:assemble UP-TO-DATE
:compileTestJava
Skipping task ':compileTestJava' as it has no source files.
:compileTestJava UP-TO-DATE
:findbugsMain
Skipping task ':findbugsMain' as it has no source files.
:findbugsMain UP-TO-DATE
:processTestResources
Skipping task ':processTestResources' as it has no source files.
:processTestResources UP-TO-DATE
:testClasses
Skipping task ':testClasses' as it has no actions.
:testClasses UP-TO-DATE
:findbugsTest
Skipping task ':findbugsTest' as it has no source files.
:findbugsTest UP-TO-DATE
:test
file or directory 'C:\Users\esc\workspace\cash\target\classes\test', not found
Skipping task ':test' as it is up-to-date.
Skipping task ':test' as it is up-to-date
:test UP-TO-DATE
:check
Skipping task ':check' as it has no actions.
:check UP-TO-DATE
:build
Skipping task ':build' as it has no actions.
:build UP-TO-DATE
:cash-model:compileJava
Skipping task ':cash-model:compileJava' as it is up-to-date.
Skipping task ':cash-model:compileJava' as it is up-to-date
:cash-model:compileJava UP-TO-DATE
:cash-model:processResources
Skipping task ':cash-model:processResources' as it is up-to-date.
Skipping task ':cash-model:processResources' as it is up-to-date
:cash-model:processResources UP-TO-DATE
:cash-model:classes
Skipping task ':cash-model:classes' as it has no actions.
:cash-model:classes UP-TO-DATE
:cash-model:jar
Skipping task ':cash-model:jar' as it is up-to-date.
Skipping task ':cash-model:jar' as it is up-to-date
:cash-model:jar UP-TO-DATE
:cash-model:assemble
Skipping task ':cash-model:assemble' as it has no actions.
:cash-model:assemble UP-TO-DATE
:cash-model:compileTestJava
Skipping task ':cash-model:compileTestJava' as it is up-to-date.
Skipping task ':cash-model:compileTestJava' as it is up-to-date
:cash-model:compileTestJava UP-TO-DATE
:cash-model:findbugsMain
Executing task ':cash-model:findbugsMain' due to:
No history is available for task ':cash-model:findbugsMain'.
[ant:findbugsMain] Exception in thread "main" java.io.FileNotFoundException: C:\Users\esc\workspace\cash\cash-model\target\classes\main;C:\Users\esc\workspace\cash\cash-model\target\resources\main (Die Syntax für den Dateinamen, Verzeichnisnamen oder die Datenträgerbezeichnung ist falsch)
[ant:findbugsMain]	at java.util.zip.ZipFile.open(Native Method)
[ant:findbugsMain]	at java.util.zip.ZipFile.(ZipFile.java:127)
[ant:findbugsMain]	at java.util.zip.ZipFile.(ZipFile.java:144)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.ZipFileCodeBase.(ZipFileCodeBase.java:53)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory.countUsingZipFile(ZipCodeBaseFactory.java:92)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.ZipCodeBaseFactory.makeZipCodeBase(ZipCodeBaseFactory.java:46)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.ClassFactory.createFilesystemCodeBase(ClassFactory.java:97)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.FilesystemCodeBaseLocator.openCodeBase(FilesystemCodeBaseLocator.java:75)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.processWorkList(ClassPathBuilder.java:564)
[ant:findbugsMain]	at edu.umd.cs.findbugs.classfile.impl.ClassPathBuilder.build(ClassPathBuilder.java:195)
[ant:findbugsMain]	at edu.umd.cs.findbugs.FindBugs2.buildClassPath(FindBugs2.java:584)
[ant:findbugsMain]	at edu.umd.cs.findbugs.FindBugs2.execute(FindBugs2.java:181)
[ant:findbugsMain]	at edu.umd.cs.findbugs.FindBugs.runMain(FindBugs.java:348)
[ant:findbugsMain]	at edu.umd.cs.findbugs.FindBugs2.main(FindBugs2.java:1057)

BUILD FAILED

Total time: 6.044 secs
```

```groovy
buildscript {
repositories {
mavenCentral()
add(new org.apache.ivy.plugins.resolver.URLResolver()) {
name = 'GitHub'
addArtifactPattern 'http://cloud.github.com/downloads/[organisation]/[module]/[module]-[revision].[ext]'
}
}
dependencies {
classpath 'bmuschko:gradle-clover-plugin:0.5'
classpath 'org.ajoberstar:gradle-plugins:0.1.1'
}
}

allprojects {
apply plugin: 'java'
apply plugin: 'maven'
apply plugin: 'clover'
apply plugin: 'findbugs'

sourceCompatibility = 1.5
targetCompatibility = 1.5

buildDir = 'target' // Change default directory to target from build

repositories {
mavenCentral()
}

configurations { // Enable Maven like profiles
provided
testCompile.extendsFrom provided
compile.transitive = true
}
dependencies {
testCompile 'junit:junit:4.8.2'
testCompile 'org.easymock:easymock:3.0'
testCompile 'xmlunit:xmlunit:1.3'
clover 'com.cenqua.clover:clover:3.1.2'
findbugs group:'com.google.code.findbugs', name:'findbugs', version:'1.3.9'
findbugs group:'com.google.code.findbugs', name:'findbugs-ant', version:'1.3.9'
}

}

group = 'net.bpx.cash'

subprojects {

version = '1.0-SNAPSHOT'

sourceSets.main.compileClasspath += configurations.provided // Enable maven like profiles

Properties props = new Properties()
props.load(new FileInputStream('build-dev.properties'))
project.setProperty('myBuildProps', props)

processResources {
from(sourceSets.main.resources.srcDirs) {
include '**/*.xml'
filter org.apache.tools.ant.filters.ReplaceTokens, tokens: project.myBuildProps
}
from(sourceSets.main.resources.srcDirs) {
exclude '**/*.xml'
}
}
}
```