4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

Spark-Javaとlombokを使う時のbuild.gradle

Last updated at Posted at 2015-10-21
build.gradle
def defaultEncoding = 'UTF-8' 

tasks.withType(AbstractCompile) each { it.options.encoding = defaultEncoding }

apply plugin: 'java'
apply plugin: 'war'
apply plugin: 'jetty'
apply plugin: 'eclipse-wtp'
apply plugin: 'application'

sourceCompatibility = 1.8
targetCompatibility = 1.8
version = '1.0'
jar {
    manifest {
        attributes 'Implementation-Title': 'application',
                   'Implementation-Version': version
    }
}

mainClassName = 'spqrk.HelloWorld'

repositories {
    mavenCentral()
}

dependencies {
    compile group: 'commons-collections', name: 'commons-collections', version: '3.2'
    testCompile group: 'junit', name: 'junit', version: '4.+'
    
    compile 'org.projectlombok:lombok:1.16.6'
    compile 'com.sparkjava:spark-core:2.3'
    compile 'org.eclipse.persistence:org.eclipse.persistence.jpa:2.6.+'
    compile 'javax.servlet:javax.servlet-api:3.1.0'

    
}



test {
    systemProperties 'property': 'value'
}

uploadArchives {
    repositories {
       flatDir {
           dirs 'repos'
       }
    }
}

eclipseで使うときは、適当なプロジェクトを作成し、そのルートにこのbuild.gradleを配置。
コマンドラインから以下のコマンドを実行して、プロジェクトを更新する。

gradle eclipse
gradle build

###2015-10-22追記。
バージョン番号を指定しないとsl4jのjarが衝突するので修正。
runタスク用の設定も追加。

4
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
4
4

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?