From 00088b6c565ebe8af5b073f110bafaf508c26378 Mon Sep 17 00:00:00 2001 From: Jon Brisbin Date: Tue, 24 Apr 2012 10:37:05 -0500 Subject: [PATCH] Tweaked build file, updated docs. --- build.gradle | 55 ++++++++++++++++++++++++++++++++++++++---------- doc/main_wiki.md | 12 +++++++---- 2 files changed, 52 insertions(+), 15 deletions(-) diff --git a/build.gradle b/build.gradle index be17217ef..d049ff5d7 100644 --- a/build.gradle +++ b/build.gradle @@ -14,24 +14,45 @@ allprojects { } repositories { - mavenCentral(artifactUrls: [ - "http://repo.springframework.org/release", - "http://repo.springframework.org/milestone" - ]) + maven { url "http://repo.springframework.org/milestone" } + maven { url "http://repo.springframework.org/release" } + mavenCentral() mavenLocal() } } -subprojects { +configure(subprojects) { subproject -> apply plugin: "java" apply plugin: "groovy" [compileJava, compileTestJava]*.options*.debugOptions*.debugLevel = "source,lines,vars" [compileJava, compileTestJava]*.options*.compilerArgs = ["-Xlint:-serial", "-Xlint:-unchecked"] - sourceCompatibility = 1.6 - targetCompatibility = 1.6 + project.sourceCompatibility = 1.6 + project.targetCompatibility = 1.6 + + javadoc { + options.memberLevel = org.gradle.external.javadoc.JavadocMemberLevel.PROTECTED + options.author = true + options.header = project.name + //options.overview = "${projectDir}/src/main/java/overview.html" + } + + task sourcesJar(type: Jar, dependsOn: classes) { + classifier = "sources" + from sourceSets.main.allJava + } + + task javadocJar(type: Jar) { + classifier = "javadoc" + from javadoc + } + + artifacts { + archives sourcesJar + archives javadocJar + } dependencies { groovy "org.codehaus.groovy:groovy:$groovyVersion" @@ -48,6 +69,7 @@ subprojects { compile "org.springframework:spring-beans:$springVersion" compile "org.springframework:spring-context:$springVersion" compile "org.springframework:spring-core:$springVersion" + compile "org.springframework:spring-orm:$springVersion" compile "org.springframework:spring-web:$springVersion" // Testing @@ -64,8 +86,19 @@ subprojects { task wrapper(type: Wrapper) { gradleVersion = "1.0-rc-1" } idea { - project.ipr.withXml { provider -> - provider.node.component.find { it.@name == 'VcsDirectoryMappings' }.mapping.@vcs = 'Git' + module { + inheritOutputDirs = false + outputDir = file("build/classes/main") + testOutputDir = file("build/classes/test") + downloadJavadoc = true + downloadSources = true } - module.jdkName = "1.6" -} + project { + ipr { + withXml { xml -> + xml.node.component.find { it.@name == "VcsDirectoryMappings" }.mapping.@vcs = "Git" + xml.node.component.find { it.@name == "ProjectRootManager" }.output.@url = "file://\$PROJECT_DIR\$/build" + } + } + } +} \ No newline at end of file diff --git a/doc/main_wiki.md b/doc/main_wiki.md index 94a6ec287..2051b3214 100644 --- a/doc/main_wiki.md +++ b/doc/main_wiki.md @@ -8,16 +8,20 @@ The Spring Data JPA Repository Web Exporter allows you to export your [JPA Repos To use the Spring Data Web Exporter, you need to build a WAR file. Start by cloning the base web application project that contains the web.xml file you'll need to run the Web Exporter: [https://github.com/SpringSource/spring-data-rest-webmvc](https://github.com/SpringSource/spring-data-rest-webmvc). - git clone https://github.com/SpringSource/spring-data-rest-web.git - cd spring-data-rest-web + git clone https://github.com/SpringSource/spring-data-rest-webmvc.git + cd spring-data-rest-webmvc ./gradlew war Deploy the built WAR file to your servlet container: - cp build/libs/spring-data-rest-webmvc-1.0.0.BUILD-SNAPSHOT.war $TOMCAT_HOME/webapps/data.war + cp build/libs/spring-data-rest-webmvc-1.0.0.M1.war $TOMCAT_HOME/webapps/data.war cd $TOMCAT_HOME bin/catalina.sh run +You can also deploy to a Jetty web container embedded in the build: + + ./gradlew jettyRun + The WAR file has a couple example domain classes and exposes a couple repositories by default. You can verify that this configuration is working by issuing an HTTP GET to the root of the web application: curl -v http://localhost:8080/data/ @@ -189,7 +193,7 @@ Retrieving the linked entity gives us a JSON representation of the entity, as we ### Updating relationships -To maintain a relationship between two entities, access the resource of the relationship by using the id of the entity as the last element in the resource path. For example, to add a link to a Profile with id 3 to a Person with id 1, issue a POST to the "profiles" resource and include in the body of the request a list of resource paths to entities you want to link to (make sure to use the special Content-Type "text/uri-list" which, as the name implies, is a representation of a list of URIs): +To maintain a relationship between two entities, access the resource of the relationship by using the id of the entity as the last element in the resource path. For example, to add a link to a Profile with id 3 to a Person with id 1, issue a POST to the "profiles" resource and include in the body of the request a list of resource paths to entities you want to link to (make sure to use the [special Content-Type "text/uri-list"](http://www.ietf.org/rfc/rfc2483.txt) which, as the name implies, is a representation of a list of URIs): curl -v -X POST -H "Content-Type: text/uri-list" -d "http://localhost:8080/data/profile/3" http://localhost:8080/data/person/1/profiles