Hello,
I am looking to understand HOW gradle sees this, compared to me.
When I think dependencies I think of something the java file requires to compile/run correctly.
When i see dependencies in build.gradle they look like this:
dependencies {
compile ‘commons-collections:commons-collections:3.2.1’
}
My code requires the jar file containing the drivers for the database, in this case: com.microsoft.sqlserver.jdbc.SQLServerDriver so I tried this:
dependencies {
compile ‘commons-collections:commons-collections:3.2.1’
compile ‘com.microsoft.sqlserver.jdbc.SQLServerDriver’
}
What I got was this:
C:\Users\parisr\Documents\athenaeum>gradle run
FAILURE: Build failed with an exception.
-
Where:
Build file ‘C:\Users\parisr\Documents\NetBeansProjects\athenaeum\build.gradle’ line: 35 -
What went wrong:
A problem occurred evaluating root project ‘athenaeum’.
Supplied String module notation ‘com.microsoft.sqlserver.jdbc.SQLServerDriver’ is invalid. Example notations: ‘org.gra
to-core:1.9.5:javadoc’.
- Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Total time: 4.54 secs
So Line35 is where I put the com.microsoft.sqlserver.jdbc.SQLServerDriver in the build.gradle file.
Other Things to Know:
- the driver is in my classpath on the machine
- the code (.java) works when I use an IDE like NetBeans
- gradle -v
Gradle 2.3
Build time: 2015-02-16 05:09:33 UTC
Build number: none
Revision: 586be72bf6e3df1ee7676d1f2a3afd9157341274
Groovy: 2.3.9
Ant: Apache Ant™ version 1.9.3 compiled on December 23 2013
JVM: 1.8.0_40 (Oracle Corporation 25.40-b25)
OS: Windows 7 6.1 x86