2016-06-01 4 views
0

Grailsラッパーによってコンパイルされた新しいGrails 3.1.7プロジェクトがあります。このプロジェクトは、単にベースのプロジェクトによって作成された:Grailsの作成アプリスプリングブートリパッケージ:Jarタスクは再パッケージ化されません(JarTaskと一致しませんでした)

私が実行した場合:きれいなジャーbootRepackageを--info ./gradlew 私はビルドの最後の部分の間に次の出力を参照してください

:jar (Thread[main,5,main]) started. 
:jar 
Executing task ':jar' (up-to-date check took 0.023 secs) due to: 
    Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.jar has changed. 
    Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.jar has been removed. 
:jar (Thread[main,5,main]) completed. Took 0.259 secs. 
:findMainClass (Thread[main,5,main]) started. 
:findMainClass 
Executing task ':findMainClass' (up-to-date check took 0.0 secs) due to: 
    Task has not declared any outputs. 
:findMainClass (Thread[main,5,main]) completed. Took 0.041 secs. 
:war (Thread[main,5,main]) started. 
:war 
Executing task ':war' (up-to-date check took 0.039 secs) due to: 
    Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.war has changed. 
    Output file /var/jenkins_home/workspace/helloworld/build/libs/helloworld-0.1.war has been removed. 
:war (Thread[main,5,main]) completed. Took 4.305 secs. 
:bootRepackage (Thread[main,5,main]) started. 
:bootRepackage 
Executing task ':bootRepackage' (up-to-date check took 0.0 secs) due to: 
    Task has not declared any outputs. 
Jar task not repackaged (didn't match withJarTask): task ':jar' 
Jar task not repackaged (didn't match withJarTask): task ':pathingJar' 
Jar task not repackaged (didn't match withJarTask): task ':pathingJarCommand' 
Setting mainClass: helloworld.Application 
:bootRepackage (Thread[main,5,main]) completed. Took 0.94 secs. 

BUILD SUCCESSFUL 

リパッケージタスクでは何が起こっていますか?

これはどういう意味ですか?

Jar task not repackaged (didn't match withJarTask): task ':jar' 

gradle.properties:

grailsVersion=3.1.7 
gradleWrapperVersion=2.13 

build.gradle:

buildscript { 
    ext { 
     grailsVersion = project.grailsVersion 
    } 
    repositories { 
     mavenLocal() 
     maven { url "https://repo.grails.org/grails/core" } 
    } 
    dependencies { 
     classpath "org.grails:grails-gradle-plugin:$grailsVersion" 
     classpath "com.bertramlabs.plugins:asset-pipeline-gradle:2.8.2" 
     classpath "org.grails.plugins:hibernate4:5.0.6" 
    } 
} 

version "0.1" 
group "helloworld" 

apply plugin:"eclipse" 
apply plugin:"idea" 
apply plugin:"war" 
apply plugin:"org.grails.grails-web" 
apply plugin:"org.grails.grails-gsp" 
apply plugin:"asset-pipeline" 

ext { 
    grailsVersion = project.grailsVersion 
    gradleWrapperVersion = project.gradleWrapperVersion 
} 

repositories { 
    mavenLocal() 
    maven { url "https://repo.grails.org/grails/core" } 
} 

dependencyManagement { 
    imports { 
     mavenBom "org.grails:grails-bom:$grailsVersion" 
    } 
    applyMavenExclusions false 
} 

dependencies { 
    compile "org.springframework.boot:spring-boot-starter-logging" 
    compile "org.springframework.boot:spring-boot-autoconfigure" 
    compile "org.grails:grails-core" 
    compile "org.springframework.boot:spring-boot-starter-actuator" 
    compile "org.springframework.boot:spring-boot-starter-tomcat" 
    compile "org.grails:grails-dependencies" 
    compile "org.grails:grails-web-boot" 
    compile "org.grails.plugins:cache" 
    compile "org.grails.plugins:scaffolding" 
    compile "org.grails.plugins:hibernate4" 
    compile "org.hibernate:hibernate-ehcache" 
    console "org.grails:grails-console" 
    profile "org.grails.profiles:web:3.1.7" 
    runtime "com.bertramlabs.plugins:asset-pipeline-grails:2.8.2" 
    runtime "com.h2database:h2" 
    testCompile "org.grails:grails-plugin-testing" 
    testCompile "org.grails.plugins:geb" 
    testRuntime "org.seleniumhq.selenium:selenium-htmlunit-driver:2.47.1" 
    testRuntime "net.sourceforge.htmlunit:htmlunit:2.18" 
} 

task wrapper(type: Wrapper) { 
    gradleVersion = gradleWrapperVersion 
} 

assets { 
    minifyJs = true 
    minifyCss = true 
} 

この例のコードはである:https://github.com/liftyourgame/helloworld

答えて

0

前のGrails-3.1.5に、 bootRepackageタスクは、パスジャーには望ましくないすべてのjarタスクを処理しました。

Warプラグインが適用されている場合(デフォルト)は、warタスクのみを処理するようになりました。

gradle(w) assemble(たとえばgrails warでも使用されます)は、Warプラグインが適用されている場合、戦争(瓶がない)のみを作成します。同じことがスプリングブートにも当てはまります。

戦争も実行可能であるため(つまり、java -jar my.war)、それは通常正常です。そう

あなたが本当にそのジャーアーティファクトを構築し、それを再パッケージングの対象とすべき、それに応じてbootRepackageタスクを再設定したい場合:

bootRepackage.withJarTask = jar 

しかし - それに対して正当な理由がない場合は - 私はその言いますwarファイルに固執して実行可能ファイルとして使用する方がよいでしょう。またはプラグインを削除すると、assemblebootRepackageがデフォルトでjar artfactを構築/処理できます。

関連する問題