【发布时间】:2015-07-17 02:14:26
【问题描述】:
我正在尝试使此应用程序正常工作,并且建筑物是在 gradle 中配置的。当我在 cmd 中使用 jettyRun 运行应用程序时,它按预期工作,但是当我在 eclipse 中打开实际代码时,我错过了所有这些依赖项,例如 spring 或 hibernate 等等......我不确定如何解决这个问题
gradle.build 看起来像这样
apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
apply plugin: 'jetty'
// JDK 7
sourceCompatibility = 1.8
targetCompatibility = 1.8
repositories {
mavenLocal()
mavenCentral()
}
dependencies {
compile 'ch.qos.logback:logback-classic:1.1.3'
compile 'org.springframework:spring-webmvc:4.1.6.RELEASE'
compile 'javax.servlet:jstl:1.2'
compile 'org.springframework:spring-orm:4.1.6.RELEASE'
compile 'org.springframework:spring-tx:4.1.6.RELEASE'
compile 'org.springframework:spring-jdbc:4.1.6.RELEASE'
compile 'mysql:mysql-connector-java:5.1.31'
compile 'org.hibernate:hibernate-core:4.3.10.Final'
compile 'org.hibernate:hibernate-entitymanager:4.3.10.Final'
}
// Embeded Jetty for testing
jettyRun{
contextPath = "etnshop"
httpPort = 8080
}
jettyRunWar{
contextPath = "etnshop"
httpPort = 8080
}
//For Eclipse IDE only
eclipse {
wtp {
component {
//define context path, default to project folder name
contextPath = 'etnshop'
}
}
}
【问题讨论】:
标签: java eclipse spring hibernate gradle