$gradlecleantestpublish:cleanUP-TO-DATE:compileJava:processResourcesUP-TO-DATE:classes:compileTestJava:processTestResourcesUP-TO-DATE:testClasses:test:generatePomFileForSamplePublication:jar:publishSamplePublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar to repository remote at file:/Users/mike/maven-sample-repoTransferring1KfromremoteUploaded1KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-doc.html to repository remote at file:/Users/mike/maven-sample-repoTransferring0KfromremoteUploaded0K:publishBUILDSUCCESSFULTotaltime:18.255secs
pomファイルが発行されたのかどうかよくわかりませんが、
実際に発行されたディレクトリーを見てみます。
build.gradle
1234567891011
$cd/Users/mike/maven-sample-repo/org/mikeneck/sample$lssample-project$cdsample-project/$ ls1.0 maven-metadata.xml maven-metadata.xml.md5 maven-metadata.xml.sha1$ cd 1.0/$lssample-project-1.0-doc.htmlsample-project-1.0.jarsample-project-1.0.pomsample-project-1.0-doc.html.md5sample-project-1.0.jar.md5sample-project-1.0.pom.md5sample-project-1.0-doc.html.sha1sample-project-1.0.jar.sha1sample-project-1.0.pom.sha1
applyplugin:'java'applyplugin:'maven-publish'// project informationgroup='org.mikeneck.sample'version='1.0'// zip sourcestasksourceJar(type:Jar){fromsourceSets.main.allJava}// zip javadocstaskjavadocJar(type:Jar,dependsOn:javadoc){fromjavadoc.destinationDir}// publishing descriptionpublishing{publications{sample(MavenPublication){fromcomponents.javaartifact('document.html'){classifier='doc'extension='html'}artifactsourceJar{classifier='sources'extension='jar'}artifactjavadocJar{classifier='javadoc'extension='jar'}}}repositories{maven{url'file://Users/mike/maven-sample-repo'}}}
$gradlecleantestpublish:clean:compileJava:processResourcesUP-TO-DATE:classes:compileTestJava:processTestResourcesUP-TO-DATE:testClasses:test:generatePomFileForSamplePublication:jar:javadoc:javadocJar:sourceJar:publishSamplePublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar to repository remote at file:/Users/mike/maven-sample-repo/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-doc.htmltorepositoryremoteatfile:/Users/mike/maven-sample-repo/Transferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar to repository remote at file:/Users/mike/maven-sample-repo/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jartorepositoryremoteatfile:/Users/mike/maven-sample-repo/Transferring33KfromremoteUploaded33K:publishBUILDSUCCESSFULTotaltime:25.84secs
applyplugin:'java'applyplugin:'maven-publish'// project informationgroup='org.mikeneck.sample'version='1.0'// zip sourcestasksourceJar(type:Jar){fromsourceSets.main.allJava}// zip javadocstaskjavadocJar(type:Jar,dependsOn:javadoc){fromjavadoc.destinationDir}// publishing descriptionpublishing{publications{// only java archivessample(MavenPublication){fromcomponents.java}// publish documentsdocuments(MavenPublication){artifact('document.html'){classifier='doc'extension='html'}artifactsourceJar{classifier='sources'extension='jar'}artifactjavadocJar{classifier='javadoc'extension='jar'}}}repositories{maven{url'file://Users/mike/maven-sample-repo'}}}
$gradlecleantestpublish:clean:compileJava:processResourcesUP-TO-DATE:classes:compileTestJava:processTestResourcesUP-TO-DATE:testClasses:test:generatePomFileForDocumentsPublication:javadoc:javadocJar:sourceJar:publishDocumentsPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.pom to repository remote at file:/Users/mike/maven-sample-repo/Transferring 0K from remoteUploaded 0KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-doc.htmltorepositoryremoteatfile:/Users/mike/maven-sample-repo/Transferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar to repository remote at file:/Users/mike/maven-sample-repo/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jartorepositoryremoteatfile:/Users/mike/maven-sample-repo/Transferring33KfromremoteUploaded33K:generatePomFileForSamplePublication:jar:publishSamplePublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar to repository remote at file:/Users/mike/maven-sample-repo/Transferring1KfromremoteUploaded1K:publishBUILDSUCCESSFULTotaltime:12.33secs
$gradlecleanpSPTMR:clean:generatePomFileForSamplePublication:compileJava:processResourcesUP-TO-DATE:classes:jar:publishSamplePublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar to repository remote at file:/Users/mike/maven-sample-repo/Transferring1KfromremoteUploaded1KBUILDSUCCESSFULTotaltime:2.498secs
$gradlecleanpPOPTMR:clean:generatePomFileForPomOnlyPublication:publishPomOnlyPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.pom to repository remote at file:/Users/mike/maven-sample-repo/Transferring1KfromremoteUploaded1KBUILDSUCCESSFULTotaltime:5.813secs
発行されたpomファイルは次のようになります。
sample-project-1.0.pom
12345678910111213141516171819202122
<?xml version="1.0" encoding="UTF-8"?><projectxmlns="http://maven.apache.org/POM/4.0.0"xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><modelVersion>4.0.0</modelVersion><groupId>org.mikeneck.sample</groupId><artifactId>sample-project</artifactId><version>1.0</version><packaging>pom</packaging><dependencies><dependency><groupId>org.jsoup</groupId><artifactId>jsoup</artifactId><version>1.6.3</version></dependency></dependencies><licenses><license><name>The Apache Software License, Version 2.0</name><url>http://www.apache.org/license/LICENSE-2.0.txt</url><distribution>repo</distribution></license></licenses></project>
PGP署名ファイルの発行
少し話題が飛びますが、
maven central repositoryにライブラリーを発行する場合、
各アーカイブファイルとpomファイルに対してPGP(Pretty Good Privacy)署名が必要となります。
$gradlecleanpPpublish:clean:compileJava:processResourcesUP-TO-DATE:classes:jar:javadoc:javadocJar:sourceJar:signArchives:preparePublication:generatePomFileForJarSignaturesPublication:publishJarSignaturesPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifactsTransferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifactsTransferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifactsTransferring0KfromremoteUploaded0K:generatePomFileForJarsPublication:publishJarsPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jartorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring1KfromremoteUploaded1KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jar to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 33K from remoteUploaded 33K:generatePomFileForPomPublication:publishPomPublicationToMavenRepositoryUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0.pomtorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring1KfromremoteUploaded1K:publishBUILDSUCCESSFULTotaltime:10.894secs
$gpg2--verifysample-project-1.0-javadoc.jar.ascgpg:Signaturemade木6/20 18:05:08 2013 JST using RSA key ID ABC12345gpg: Good signature from "Shinya Mochida (Groovy/JavaScriptDeveloperinJapan)<mike@mikeneck.org>"$ gpg2 --verify sample-project-1.0-sources.jar.ascgpg: Signature made 木 6/20 18:05:08 2013 JST using RSA key ID ABC12345gpg: Good signature from "ShinyaMochida(Groovy/JavaScript Developer in Japan) <mike@mikeneck.org>"$ gpg2 --verify sample-project-1.0.jar.ascgpg: Signature made 木 6/2018:05:082013JSTusingRSAkeyIDABC12345gpg:Goodsignaturefrom"Shinya Mochida (Groovy/JavaScript Developer in Japan) <mike@mikeneck.org>"
// pom fileext{pomFilePath="${project.projectDir}/tmp/pom.xml"pomFile=file(pomFilePath)}// task for signing pomtasksignPom(type:Sign){signpomFile}// getting a signature of pomdefgetPomSignatrure={returnproject.tasks.signPom.signatureFiles.collect{it}[0]}publishing{publications{// publish pompom(MavenPublication){pom.withXml{defnode=asNode()node.chidren().last()+{dependencies{resolveStrategy=Closure.DELEGATE_FIRSTproject.configurations.compile.dependencies.each{dep->dependency{groupIddep.groupartifactIddep.nameversiondep.version}}}}writeTo(project.ext.pomFile)project.tasks.signPom.execute()artifact(getPomSignature()){classifier=nullextension='pom.asc'}}}}}
$gradle--daemoncleanpPpublish:clean:compileJava:processResourcesUP-TO-DATE:classes:jar:javadoc:javadocJar:sourceJar:signArchives:preparePublication:generatePomFileForJarSignaturesPublication:publishJarSignaturesPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 0K from remoteUploaded 0KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar.asctorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 0K from remoteUploaded 0K:generatePomFileForJarsPublication:publishJarsPublicationToMavenRepositoryUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jartorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring1KfromremoteUploaded1KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jartorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring33KfromremoteUploaded33K:generatePomFileForPomPublication:publishPomPublicationToMavenRepositoryFAILEDFAILURE:Buildfailedwithanexception.*Whatwentwrong:Executionfailedfortask':publishPomPublicationToMavenRepository'.>Failedtopublishpublication'pom'torepository'maven'>Invalidpublication'pom':artifactfiledoesnotexist:'/Users/mike/IdeaProjects/sample-project/tmp/pom.xml.asc'*Try:Runwith--stacktraceoptiontogetthestacktrace.Runwith--infoor--debugoptiontogetmorelogoutput.BUILDFAILEDTotaltime:5.357secs
// declaration of plugins['java','maven-publish','idea','signing'].each{applyplugin:it}// dynamic propertiesext{pomFilePath="${project.projectDir}/tmp/pom.xml"pomFile=file(pomFilePath)}// project informationgroup='org.mikeneck.sample'version='1.0'// repository managementrepositories{mavenCentral()}// dependency managementdependencies{compile'org.jsoup:jsoup:1.6.3'testCompile'junit:junit:4.11'}// zip sourcestasksourceJar(type:Jar){fromsourceSets.main.allJavaclassifier='sources'}// zip javadoctaskjavadocJar(type:Jar,dependsOn:javadoc){fromjavadoc.destinationDirclassifier='javadoc'}// configuration for pom signingconfigurations{pom}// extract artifacts for publishing signaturesartifacts{archivesjararchivessourceJararchivesjavadocJarif(pomFile.exists()){pompomFile}}// jar signintasksignArchives(type:Sign,dependsOn:[jar,sourceJar,javadocJar]){signconfigurations.archives}// getting signature filesdefgetSignatureFiles={defallFiles=tasks.signArchives.signatureFiles.collect{it}defsignedSources=allFiles.find{it.name.contains('-sources')}defsignedJavadoc=allFiles.find{it.name.contains('-javadoc')}defsignedJar=(allFiles-[signedSources,signedJavadoc])[0]return[[archive:signedSources,classifier:'sources',extension:'jar.asc'],[archive:signedJavadoc,classifier:'javadoc',extension:'jar.asc'],[archive:signedJar,classifier:null,extension:'jar.asc']]}// signing pom filetasksignPom(type:Sign){signconfigurations.pom}// prepare publication tasks depends on existence of pom fileif(pomFile.exists()){taskpreparePublication(dependsOn:[signArchives,signPom])}else{taskpreparePublication(dependsOn:signArchives)}// getting pom signaturedefgetPomSignature={returnproject.tasks.signPom.signatureFiles.collect{it}[0]}publishing{publications{// jar publication -- this will be executed lastmainJar(MavenPublication){fromcomponents.java[[jarTask:sourceJar,classifier:'sources',extension:'jar'],[jarTask:javadocJar,classifier:'javadoc',extension:'jar']].each{archive->artifact(archive.jarTask){classifier=archive.classifierextension=archive.extension}}pom.withXml{Nodenode=asNode()node.children().last()+{resolveStrategy=Closure.DELEGATE_FIRSTpackaging'jar'licenses{license{name'The Apache Software License, Version 2.0'url'http://www.apache.org/license/LICENSE-2.0.txt'distribution'repo'}}}if(!project.ext.pomFile.exists()){writeTo(project.ext.pomFile)}}}// publication of jar signaturesjarSignatures(MavenPublication){getSignatureFiles().each{signature->artifact(signature.archive){classifier=signature.classifierextension=signature.extension}}}// publication of pom signatures depends on existence of pom file.if(project.ext.pomFile.exists()){'gpg-pom'(MavenPublication){artifact(getPomSignature()){classifier=nullextension='pom.asc'}}}}repositories{maven{// siwtch repository location by existence of pom fileif(project.ext.pomFile.exists()){// target repositoryurl"file:/${project.projectDir}/artifacts"}else{// temporary repositoryurl"file:/${project.projectDir}/tmp"}}}}
$gradle--daemoncleanpPpublish:clean:compileJava:processResourcesUP-TO-DATE:classes:jar:javadoc:javadocJar:sourceJar:signArchives:preparePublication:generatePomFileForJarSignaturesPublication:publishJarSignaturesPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/tmp/Transferring 0K from remoteUploaded 0KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar.asctorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/tmp/Transferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/tmp/Transferring 0K from remoteUploaded 0K:generatePomFileForMainJarPublication:publishMainJarPublicationToMavenRepositoryUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jartorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/tmp/Transferring1KfromremoteUploaded1KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar to repository remote at file:/Users/mike/IdeaProjects/sample-project/tmp/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jartorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/tmp/Transferring33KfromremoteUploaded33K:publishBUILDSUCCESSFULTotaltime:21.149secs
$gradle--daemoncleanpPpublish:clean:compileJava:processResourcesUP-TO-DATE:classes:jar:javadoc:javadocJar:sourceJar:signArchives:signPomUP-TO-DATE:preparePublication:generatePomFileForGpg-pomPublication:publishGpg-pomPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.pom.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 0K from remoteUploaded 0K:generatePomFileForJarSignaturesPublication:publishJarSignaturesPublicationToMavenRepositoryUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar.asctorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring0KfromremoteUploaded0KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jar.asc to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 0K from remoteUploaded 0KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jar.asctorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring0KfromremoteUploaded0K:generatePomFileForMainJarPublication:publishMainJarPublicationToMavenRepositoryUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0.jar to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring 1K from remoteUploaded 1KUploading: org/mikeneck/sample/sample-project/1.0/sample-project-1.0-sources.jartorepositoryremoteatfile:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring1KfromremoteUploaded1KUploading:org/mikeneck/sample/sample-project/1.0/sample-project-1.0-javadoc.jar to repository remote at file:/Users/mike/IdeaProjects/sample-project/artifacts/Transferring33KfromremoteUploaded33K:publishBUILDSUCCESSFULTotaltime:8.249secs
pom.ascファイルが無事発行されたようです。
それでは、適切なファイルであるかどうか、検証します。
build.gradle
1234
$cdartifacts/org/mikeneck/sample/sample-project/1.0/$gpg2--verifysample-project-1.0.pom.ascgpg:Signaturemade金6/21 04:56:06 2013 JST using RSA key ID ABC12345gpg: Good signature from "Shinya Mochida (Groovy/JavaScriptDeveloperinJapan)<mike@mikeneck.org>"
// declaration of plugins['java','maven-publish','idea','signing'].each{applyplugin:it}// dynamic propertiesext{pomFilePath="${project.projectDir}/tmp/pom.xml"pomFile=file(pomFilePath)}// project informationgroup='org.mikeneck.sample'version='1.0'// repository managementrepositories{mavenCentral()}// dependency managementdependencies{compile'org.jsoup:jsoup:1.6.3'testCompile'junit:junit:4.11'}// zip sourcestasksourceJar(type:Jar){fromsourceSets.main.allJavaclassifier='sources'}// zip javadoctaskjavadocJar(type:Jar,dependsOn:javadoc){fromjavadoc.destinationDirclassifier='javadoc'}// configuration for pom signingconfigurations{pom}// extract artifacts for publishing signaturesartifacts{archivesjararchivessourceJararchivesjavadocJarif(pomFile.exists()){pompomFile}}// jar signintasksignArchives(type:Sign,dependsOn:[jar,sourceJar,javadocJar]){signconfigurations.archives}// getting signature filesdefgetSignatureFiles={defallFiles=tasks.signArchives.signatureFiles.collect{it}defsignedSources=allFiles.find{it.name.contains('-sources')}defsignedJavadoc=allFiles.find{it.name.contains('-javadoc')}defsignedJar=(allFiles-[signedSources,signedJavadoc])[0]return[[archive:signedSources,classifier:'sources',extension:'jar.asc'],[archive:signedJavadoc,classifier:'javadoc',extension:'jar.asc'],[archive:signedJar,classifier:null,extension:'jar.asc']]}// signing pom filetasksignPom(type:Sign){signconfigurations.pom}// prepare publication tasks depends on existence of pom fileif(pomFile.exists()){taskpreparePublication(dependsOn:[signArchives,signPom])}else{taskpreparePublication(dependsOn:signArchives)}// getting pom signaturedefgetPomSignature={returnproject.tasks.signPom.signatureFiles.collect{it}[0]}publishing{publications{// jar publication -- this will be executed lastmainJar(MavenPublication){fromcomponents.java[[jarTask:sourceJar,classifier:'sources',extension:'jar'],[jarTask:javadocJar,classifier:'javadoc',extension:'jar']].each{archive->artifact(archive.jarTask){classifier=archive.classifierextension=archive.extension}}pom.withXml{Nodenode=asNode()node.children().last()+{resolveStrategy=Closure.DELEGATE_FIRSTpackaging'jar'licenses{license{name'The Apache Software License, Version 2.0'url'http://www.apache.org/license/LICENSE-2.0.txt'distribution'repo'}}}if(!project.ext.pomFile.exists()){writeTo(project.ext.pomFile)}}}// publication of jar signaturesjarSignatures(MavenPublication){getSignatureFiles().each{signature->artifact(signature.archive){classifier=signature.classifierextension=signature.extension}}}// publication of pom signatures depends on existence of pom file.if(project.ext.pomFile.exists()){'gpg-pom'(MavenPublication){artifact(getPomSignature()){classifier=nullextension='pom.asc'}}}}repositories{maven{// siwtch repository location by existence of pom fileif(project.ext.pomFile.exists()){// target repositoryurl"file:/${project.projectDir}/artifacts"}else{// temporary repositoryurl"file:/${project.projectDir}/tmp"}}}}
$ gradle tasks
------------------------------------------------------------
All tasks runnable from root project
------------------------------------------------------------
Build tasks
-----------
assemble - Assembles the outputs of this project.
build - Assembles and tests this project.
buildDependents - Assembles and tests this project and all projects that depend on it.
buildNeeded - Assembles and tests this project and all projects it depends on.
clean - Deletes the build directory.
jar - Assembles a jar archive containing the main classes.
Documentation tasks
-------------------
groovydoc - Generates Groovydoc API documentation for the main source code.
javadoc - Generates Javadoc API documentation for the main source code.
Help tasks
----------
dependencies - Displays all dependencies declared in root project 'properties-builder'.
dependencyInsight - Displays the insight into a specific dependency in root project 'properties-builder'.
help - Displays a help message
projects - Displays the sub-projects of root project 'properties-builder'.
properties - Displays the properties of root project 'properties-builder'.
tasks - Displays the tasks runnable from root project 'properties-builder'(some of the displayed tasks may belong to subprojects).
IDE tasks
---------
cleanIdea - Cleans IDEA project files (IML, IPR)idea - Generates IDEA project files (IML, IPR, IWS)Upload tasks
------------
uploadArchives - Uploads all artifacts belonging to configuration ':archives'Verification tasks
------------------
check - Runs all checks.
test - Runs the unit tests.
Other tasks
-----------
cleanIdeaWorkspace
install - Installs the 'archives' artifacts into the local Maven repository.
wrapper
Rules
-----
Pattern: build<ConfigurationName>: Assembles the artifacts of a configuration.
Pattern: upload<ConfigurationName>: Assembles and uploads the artifacts belonging to a configuration.
Pattern: clean<TaskName>: Cleans the output files of a task.
To see all tasks and more detail, run with --all.
BUILD SUCCESSFUL
Total time: 10.478 secs
$ gradle --version
------------------------------------------------------------
Gradle 1.6
------------------------------------------------------------
Gradle build time: 2013年5月7日 9時12分14秒 UTC
Groovy: 1.8.6
Ant: Apache Ant(TM) version 1.8.4 compiled on May 22 2012
Ivy: 2.2.0
JVM: 1.7.0_13 (Oracle Corporation 23.7-b01)
OS: Mac OS X 10.8.4 x86_64
$ gradle idea
:buildSrc:clean
:buildSrc:compileJava UP-TO-DATE
:buildSrc:compileGroovy
:buildSrc:processResources
:buildSrc:classes
:buildSrc:jar
:buildSrc:assemble
:buildSrc:checkstyleMain
:buildSrc:compileTestJava UP-TO-DATE
:buildSrc:compileTestGroovy
:buildSrc:processTestResources
:buildSrc:testClasses
:buildSrc:checkstyleTest UP-TO-DATE
:buildSrc:codenarcMain
:buildSrc:codenarcTest
:buildSrc:test
:buildSrc:check
:buildSrc:build
FAILURE: Build failed with an exception.
* Where:
Script '/Users/mike/IdeaProjects/gradle/gradle/gradle/integTest.gradle' line: 32
* What went wrong:
A problem occurred evaluating script.
> Failed to notify action.
> Could not find property 'reports' on task ':announce:integTest'.
* 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: 54.695 secs
packageorg.mikeneck.jdk8;/** * @author mike */publicclassScore{finalprivateStringtitle;finalprivateintvalue;publicScore(Stringtitle,intvalue){this.title=title;this.value=value;}publicStringgetTitle(){returntitle;}publicintgetValue(){returnvalue;}}
Grade.java
123456789101112131415161718
packageorg.mikeneck.jdk8;importjava.util.List;/** * @author mike */publicinterfaceGrade{publicList<Score>scores();defaultlonggetTotalScore(){returnscores().stream().mapToLong(Score::getValue).reduce(0l,Long::sum);}}
@Grab('org.pegdown:pegdown:1.2.1')defprocessor=neworg.pegdown.PegDownProcessor()deforiginal=$/This is Top Header---This is second Header===### This is topic#### Lists Item${(1..3).collect {"+ item${it}"}.join('\n')}and${(1..3).collect {"1. item${it}"}.join('\n')}#### Links+ [mike-neck's site](http://mike-neck.github.io/)+ [mike-neck's dq site](http://mikeneckdq.blog.fc2.com/)+ ![groovy image](http://groovy.codehaus.org/images/groovy-logo-medium.png)#### Html Tags<img src='//googledrive.com/host/0B4hhdHWLP7RRdHRGZ3ZrZU90Q00' style='width : 400px;'>#### Codesfunction `lists:reverse/1` returns a List.tag `<em>` means emphasis``groovydef string = 'This is groovy code.'``#### emphasis*em?***bold?**#### Blockquotes> This is a blockquotes> from here./$processor.markdownToHtml(original)
実行結果はこんな感じ。
1234567891011121314151617181920
<h2>This is Top Header</h2><h1>This is second Header</h1><h3>This is topic</h3><h4>Lists Item</h4><ul><li>item1</li><li>item2</li><li>item3</li></ul><p>and</p><ol><li>item1</li><li>item2</li><li>item3</li></ol><h4>Links</h4><ul><li><ahref="http://mike-neck.github.io/">mike-neck's site</a></li><li><ahref="http://mikeneckdq.blog.fc2.com/">mike-neck's dq site</a></li><li><imgsrc="http://groovy.codehaus.org/images/groovy-logo-medium.png"alt="groovy image"/></li></ul><h4>Html Tags</h4><p><imgsrc='//googledrive.com/host/0B4hhdHWLP7RRdHRGZ3ZrZU90Q00'style='width : 400px;'></p><h4>Codes</h4><p>function <code>lists:reverse/1</code> returns a List.</p><p>tag <code><em></code> means emphasis</p><p><code>groovy
def string = 'This is groovy code.'</code></p><h4>emphasis</h4><p><em>em?</em></p><p><strong>bold?</strong></p><h4>Blockquotes</h4><blockquote><p>This is a blockquotes from here.</p></blockquote>
@Grab('com.madgag:markdownj-core:0.4.1')importcom.petebevin.markdown.*defproc=newMarkdownProcessor()deforiginal=$/This is Top Header---This is second Header===### This is topic#### Lists Item${(1..3).collect {"+ item${it}"}.join('\n')}and${(1..3).collect {"1. item${it}"}.join('\n')}#### Links+ [mike-neck's site](http://mike-neck.github.io/)+ [mike-neck's dq site](http://mikeneckdq.blog.fc2.com/)#### Html Tags<img src='//googledrive.com/host/0B4hhdHWLP7RRdHRGZ3ZrZU90Q00' style='width : 400px;'>#### Codesfunction `lists:reverse/1` returns a List.tag `<em>` means emphasis#### emphasis*em?***bold?**#### Blockquotes> This is a blockquotes> from here./$proc.markdown(original)
<p>This is Top Header
<hr/></p><p>This is second Header
===</p><h3>This is topic</h3><h4>Lists Item</h4><ul><li>item1</li><li>item2</li><li>item3</li></ul><p>and</p><ol><li>item1</li><li>item2</li><li>item3</li></ol><h4>Links</h4><ul><li><ahref="http://mike-neck.github.io/">mike-neck's site</a></li><li><ahref="http://mikeneckdq.blog.fc2.com/">mike-neck's dq site</a></li></ul><h4>Html Tags</h4><p><imgsrc='//googledrive.com/host/0B4hhdHWLP7RRdHRGZ3ZrZU90Q00'style='width : 400px;'></p><h4>Codes</h4><p>function <code>lists:reverse/1</code> returns a List.</p><p>tag <code><em></code> means emphasis</p><h4>emphasis</h4><p><em>em?</em></p><p><strong>bold?</strong></p><h4>Blockquotes</h4><blockquote><p>This is a blockquotes
from here.</p></blockquote>