I’m using JDK 1.8, Eclipse Mars, Buildship, Gradle wrapper, OS X.
When I run ‘build war’ then display result in console tab.
JVM Arguments: None
Program Arguments: None
Gradle Tasks: build
:compileJava UP-TO-DATE
:processResources UP-TO-DATE
:classes UP-TO-DATE
:war
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':runtime'.
> Could not find :compile:1.0.
Searched in the following locations:
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/compile-1.0.jar
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/compile.jar
file:/Users/doll/.m2/repository//compile/1.0/compile-1.0.pom
file:/Users/doll/.m2/repository//compile/1.0/compile-1.0.jar
https://jcenter.bintray.com//compile/1.0/compile-1.0.pom
https://jcenter.bintray.com//compile/1.0/compile-1.0.jar
https://repo1.maven.org/maven2//compile/1.0/compile-1.0.pom
https://repo1.maven.org/maven2//compile/1.0/compile-1.0.jar
Required by:
:02_ServletAndMysql:unspecified
> Could not find :providedCompile:1.0.
Searched in the following locations:
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/providedCompile-1.0.jar
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/providedCompile.jar
file:/Users/doll/.m2/repository//providedCompile/1.0/providedCompile-1.0.pom
file:/Users/doll/.m2/repository//providedCompile/1.0/providedCompile-1.0.jar
https://jcenter.bintray.com//providedCompile/1.0/providedCompile-1.0.pom
https://jcenter.bintray.com//providedCompile/1.0/providedCompile-1.0.jar
https://repo1.maven.org/maven2//providedCompile/1.0/providedCompile-1.0.pom
https://repo1.maven.org/maven2//providedCompile/1.0/providedCompile-1.0.jar
Required by:
:02_ServletAndMysql:unspecified
> Could not find :providedRuntime:1.0.
Searched in the following locations:
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/providedRuntime-1.0.jar
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/providedRuntime.jar
file:/Users/doll/.m2/repository//providedRuntime/1.0/providedRuntime-1.0.pom
file:/Users/doll/.m2/repository//providedRuntime/1.0/providedRuntime-1.0.jar
https://jcenter.bintray.com//providedRuntime/1.0/providedRuntime-1.0.pom
https://jcenter.bintray.com//providedRuntime/1.0/providedRuntime-1.0.jar
https://repo1.maven.org/maven2//providedRuntime/1.0/providedRuntime-1.0.pom
https://repo1.maven.org/maven2//providedRuntime/1.0/providedRuntime-1.0.jar
Required by:
:02_ServletAndMysql:unspecified
> Could not find :runtime:1.0.
Searched in the following locations:
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/runtime-1.0.jar
file:/Users/doll/Documents/workspace/02_ServletAndMysql/lib/runtime.jar
file:/Users/doll/.m2/repository//runtime/1.0/runtime-1.0.pom
file:/Users/doll/.m2/repository//runtime/1.0/runtime-1.0.jar
https://jcenter.bintray.com//runtime/1.0/runtime-1.0.pom
https://jcenter.bintray.com//runtime/1.0/runtime-1.0.jar
https://repo1.maven.org/maven2//runtime/1.0/runtime-1.0.pom
https://repo1.maven.org/maven2//runtime/1.0/runtime-1.0.jar
Required by:
:02_ServletAndMysql:unspecified
* 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: 6.258 secs
Below is my build.grade:
/*
* This build file was auto generated by running the Gradle 'init' task
* by 'doll' at '15. 11. 28 오후 10:31' with Gradle 2.9
*
* This generated file contains a sample Java project to get you started.
* For more details take a look at the Java Quickstart chapter in the Gradle
* user guide available at https://docs.gradle.org/2.9/userguide/tutorial_java_projects.html
*/
// Apply the java plugin to add support for Java
apply plugin: 'java'
apply plugin: 'war'
configurations {
moreLibs
}
// In this section you declare where to find the dependencies of your project
repositories {
flatDir { dirs "lib" }
mavenLocal()
jcenter()
mavenCentral()
}
// In this section you declare the dependencies for your production and test code
dependencies {
// The production code uses the SLF4J logging API at compile time
compile 'org.slf4j:slf4j-api:1.7.13'
// Declare the dependency for your favourite test framework you want to use in your tests.
// TestNG is also supported by the Gradle Test task. Just change the
// testCompile dependency to testCompile 'org.testng:testng:6.8.1' and add
// 'test.useTestNG()' to your build script.
testCompile 'junit:junit:4.12'
testCompile "org.mockito:mockito-core:1.+"
compile module(":compile:1.0") {
dependency ":compile-transitive-1.0@jar"
dependency ":providedCompile-transitive:1.0@jar"
}
providedCompile "javax.servlet:servlet-api:2.5"
providedCompile module(":providedCompile:1.0") {
dependency ":providedCompile-transitive:1.0@jar"
}
runtime ":runtime:1.0"
providedRuntime ":providedRuntime:1.0@jar"
moreLibs ":otherLib:1.0"
}
war {
from 'src/rootContent' // adds a file-set to the root of the archive
webInf { from 'src/additionalWebInf' } // adds a file-set to the WEB-INF dir.
classpath fileTree('additionalLibs') // adds a file-set to the WEB-INF/lib dir.
classpath configurations.moreLibs // adds a configuration to the WEB-INF/lib dir.
webXml = file('src/someWeb.xml') // copies a file to WEB-INF/web.xml
}