- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我正在尝试运行 gradlew tasks
来构建一个在 tomcat 上运行的 http web 服务 rest 端点 war 项目,但我一个接一个地收到错误。当前错误在下面一行
What went wrong: Could not resolve all dependencies for configuration ':runtime'.
Cannot resolve external dependency org.apache.tomcat:tomcat-catalina:8.5.0 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency log4j:log4j:1.2.16 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency commons-io:commons-io:2.5 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.apache.httpcomponents:httpclient:4.4 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.fasterxml.jackson.core:jackson-annotations:2.6.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.fasterxml.jackson.core:jackson-core:2.6.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.fasterxml.jackson.core:jackson-databind:2.6.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency net.sf.json-lib:json-lib:2.4 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency javax.transaction:jta:1.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency javax.xml.bind:jaxb-api:2.2 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.xml.bind:jaxb-impl:2.2.5-5 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.xml.bind:jaxb-xjc:2.2 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.glassfish.jersey.core:jersey-client:2.24 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.glassfish.jersey.core:jersey-common:2.24 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency asm:asm:3.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.codehaus.jackson:jackson-core-asl:1.9.2 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.codehaus.jackson:jackson-jaxrs:1.9.2 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.codehaus.jackson:jackson-mapper-asl:1.9.2 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.codehaus.jackson:jackson-xc:1.9.2 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.jersey:jersey-client:1.15 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.jersey:jersey-core:1.15 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.jersey:jersey-json:1.15 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.jersey:jersey-server:1.15 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency com.sun.jersey:jersey-servlet:1.15 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.codehaus.jettison:jettison:1.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency javax.ws.rs:jsr311-api:1.1.1 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified Cannot resolve external dependency org.apache.tomcat:tomcat-servlet-api:7.0.37 because no repositories are defined. Required by: :mnoxwebserviceendpoints:unspecified
我的 Gradle 文件
apply plugin: 'java'
apply plugin: 'war'
apply plugin: "com.bmuschko.tomcat-base"
buildscript {
repositories {
jcenter()
mavenCentral()
maven {
url "https://plugins.gradle.org/m2/"
}
maven {
url 'http://repo1.maven.org/maven2'
}
}
dependencies {
classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5'
}
}
configurations { providedCompile }
dependencies {
providedCompile 'org.apache.tomcat:tomcat-servlet-api:7.0.37'
classpath 'com.bmuschko:gradle-tomcat-plugin:2.2.5'
compile group: 'org.apache.tomcat', name: 'tomcat-catalina', version: '8.5.0'
compile group: 'log4j', name: 'log4j', version: '1.2.16'
compile group: 'commons-io', name: 'commons-io', version: '2.5'
compile group: 'org.apache.httpcomponents', name: 'httpclient', version: '4.4'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-annotations', version: '2.6.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-core', version: '2.6.1'
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.6.1'
compile group: 'net.sf.json-lib', name: 'json-lib', version: '2.4'
compile group: 'javax.transaction', name: 'jta', version: '1.1'
compile group: 'javax.xml.bind', name: 'jaxb-api', version: '2.2'
compile group: 'com.sun.xml.bind', name: 'jaxb-impl', version: '2.2.5-5'
compile group: 'com.sun.xml.bind', name: 'jaxb-xjc', version: '2.2'
compile group: 'org.glassfish.jersey.core', name: 'jersey-client', version: '2.24'
compile group: 'org.glassfish.jersey.core', name: 'jersey-common', version: '2.24'
compile group: 'asm', name: 'asm', version: '3.1'
compile group: 'org.codehaus.jackson', name: 'jackson-core-asl', version: '1.9.2'
compile group: 'org.codehaus.jackson', name: 'jackson-jaxrs', version: '1.9.2'
compile group: 'org.codehaus.jackson', name: 'jackson-mapper-asl', version: '1.9.2'
compile group: 'org.codehaus.jackson', name: 'jackson-xc', version: '1.9.2'
compile group: 'com.sun.jersey', name: 'jersey-client', version: '1.15'
compile group: 'com.sun.jersey', name: 'jersey-core', version: '1.15'
compile group: 'com.sun.jersey', name: 'jersey-json', version: '1.15'
compile group: 'com.sun.jersey', name: 'jersey-server', version: '1.15'
compile group: 'com.sun.jersey', name: 'jersey-servlet', version: '1.15'
compile group: 'org.codehaus.jettison', name: 'jettison', version: '1.1'
compile group: 'javax.ws.rs', name: 'jsr311-api', version: '1.1.1'
compile files('mylocaljarfiles')
testCompile 'junit:junit:4.12'
}
}
jar {
baseName='endpoints'
from ('bin')
}
最佳答案
build.gradle 中通常有两个 repositories
和dependencies
部分。一组完全包含在 buildscript{}
部分中,这些依赖项和要在其中找到它们的存储库仅适用于 build.gradle 脚本本身中的代码。这些通常是 gradle 插件,有时是您用于自定义构建代码的依赖项。
您的应用程序代码依赖项在一组单独的 repositories
和 dependencies
部分中声明:
apply plugin: 'com.foo.bar'
buildscript{
repositories{ //buildscript repos
jcenter()
}
dependencies{ //buildscript dependencies
classpath 'com.foo:bar:1.0'
}
}
repositories{ //repos for code
jcenter()
}
dependencies{
compile 'code:dependency:1.0'
testCompile 'testcode:dependency:1.0'
}
关于rest - 找不到参数的方法 providedCompile() [org.apache.tomcat :tomcat-servlet-api:7. 0.37],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40398471/
Gradle 文档说: "The War plugin adds two dependency configurations: providedCompile and providedRuntime.
在Gradle war插件中,我们可以将某些依赖项设置为“providedCompile”,这将告诉Gradle仅在编译时包括它们,而不在打包的.war文件中包括它们。 我们如何区分哪些依赖项应为“p
我正在尝试运行 gradlew tasks 来构建一个在 tomcat 上运行的 http web 服务 rest 端点 war 项目,但我一个接一个地收到错误。当前错误在下面一行 What went
我是一名优秀的程序员,十分优秀!