Itiviti / gradle-msbuild-plugin

Gradle plugin for msbuild execution, supports C# project files for now
Apache License 2.0
101 stars 57 forks source link

ClassNotFoundException #9

Closed MarkusAmshove closed 9 years ago

MarkusAmshove commented 10 years ago

Hello!

I'm trying to work the first time with the msbuild plugin and I can't even get a simple buildscript running.

My build.gradle:

apply plugin:'msbuild'

buildscript { repositories { maven { url "http://artifacts/repos" } } dependencies { classpath 'com.ullink.gradle:gradle-msbuild-plugin:1.+' } }

msbuild {

solutionFile = 'ConsoleApplication1.sln'
configuration = 'Debug'
projectName = 'ConsoleApplication1'

}

It is downloading all dependencies, but I get the following error: A problem occured evaluating root project 'ConsoleApplication1'.

Could not create task of type 'Msbuild'.

And the stacktrace at the end: Caused by: java.lang.NoClassDefFoundError: com/sun/jna/PointerType Caused by: java.lang.ClassNotFoundException: com.sun.jna.PointerType

Gradle however downloaded the net.java.dev.jna:jna:3.5.0 before the build, so I don't know how to get it working.

Thanks!

gluck commented 10 years ago

Which gradle version are you using ?

MarkusAmshove commented 10 years ago

gradle--version

1.10

Groovy: 1.8.6 Ant: 1.9.2 Ivy 2.2.0 JVM: 1.7.0_25

gluck commented 10 years ago

Same build file (using mavenCentral() repo) works fine for me. Which gradle msbuild plugin version are you using ?

MarkusAmshove commented 10 years ago

I used the reference to 1.+. It downloaded 1.9. I can't the reference to mavenCentral(), because of proxy. But mavencentral (repo1) is included in my artifactory installation

gluck commented 10 years ago

Same here, can you dump your build log file (debug, -d) some place ?

MarkusAmshove commented 10 years ago

http://pastebin.com/F0THFi3Y

I upgraded gradle to 1.11 btw :)

MarkusAmshove commented 10 years ago

I fixed the "ClassNotFoundException" but now run into "MSbuild.exe not found".

However, the entries for MSBuild 2.0, 3.5 and 4.0 are in the registry in the default location.

gluck commented 10 years ago

How did you fix it (I didn't have a clue) ?

gluck commented 10 years ago

There's some empty catch blocks in the registry class that may hide JNA errors and results in msbuild not being found. As your original error was relating to JNA, there may be a link there.

If you can, rebuilding the plugin with logs there may help.