不太难。我还没有阅读许可证。但是我已经证明了这种方法。您可以将sqljdbc4 jar文件复制到网络共享或本地目录。您的build.gradle应该如下所示:
apply plugin: 'java'
//apply plugin: 'maven'
//apply plugin: 'enhance'
sourceCompatibility = 1.8
version = '1.0'
//library versions
def hibernateVersion='4.3.10.Final'
def microsoftSQLServerJDBCLibVersion='4.0'
def springVersion='2.5.6'
def log4jVersion='1.2.16'
def jbossejbapiVersion='3.0.0.GA'
repositories {
mavenCentral()
maven{url "file://Sharedir/releases"}
}
dependencies {
testCompile group: 'junit', name: 'junit', version: '4.11'
compile "org.hibernate:hibernate-core:$hibernateVersion"
compile "com.microsoft.sqlserver:sqljdbc4:$microsoftSQLServerJDBCLibVersion"
}
task showMeCache << {
configurations.compile.each { println it }
}
在sharedir / releases目录下,我具有类似于maven结构的目录,即\ sharedir \ releases \ com \ microsoft \ sqlserver \ sqljdbc4 \ 4.0 \ sqljdbc4-4.0.jar
祝好运。
颜大卫
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-install-plugin:2.4 :install-file (default-cli) on project standalone-pom: The specified file 'C:\Us ers\anthony\sqljdbc4.jar' not exists -> [Help 1]