Skip to content

Commit

Permalink
Merge branch '2.4.x' into 2.5.x
Browse files Browse the repository at this point in the history
  • Loading branch information
lhotari committed Feb 27, 2015
2 parents b8f3a0b + 8011845 commit b46da3a
Show file tree
Hide file tree
Showing 20 changed files with 125 additions and 143 deletions.
52 changes: 27 additions & 25 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,16 @@ import org.apache.tools.ant.filters.ReplaceTokens
buildscript {
repositories {
maven { url "https://repo.grails.org/grails/core" }
//mavenRepo(urls: 'http://evgeny-goldin.org/artifactory/repo/')
jcenter()
}
dependencies {
classpath "commons-io:commons-io:2.2"
//classpath "com.goldin.plugins:gradle:0.1-RC3" // http://evgeny-goldin.com/wiki/Gradle-duplicates-plugin
classpath "com.netflix.nebula:gradle-extra-configurations-plugin:2.2.0"
}
}

apply plugin: 'idea'

ext.optionalDeps = []
ext.providedDeps = []

ext.provided = { providedDeps << it }
ext {
grailsVersion = '2.5.0.BUILD-SNAPSHOT'
isBuildSnapshot = grailsVersion.endsWith(".BUILD-SNAPSHOT")
Expand Down Expand Up @@ -48,6 +44,7 @@ ext {
concurrentlinkedhashmapVersion = "1.4"
cglibVersion = "2.2.2"
objenesisVersion = "1.4"
servletApiVersion = "3.0.1"

isJava8Compatible = org.gradle.api.JavaVersion.current().isJava8Compatible()
}
Expand Down Expand Up @@ -141,6 +138,8 @@ subprojects { project ->
apply plugin: 'eclipse'
apply plugin: 'idea'
apply plugin: 'project-report'
apply plugin: 'provided-base'
apply plugin: 'optional-base'
if(!isTestSuite)
apply plugin: 'signing'
//apply plugin: 'duplicates'
Expand All @@ -151,6 +150,23 @@ subprojects { project ->

ext.isCiBuild = project.hasProperty("isCiBuild")

if(project.name =~ /^(grails-web|grails-plugin-|grails-project-api|grails-test-suite|grails-test)/) {
dependencies {
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
// MockHttpServletRequest/Response/Context used in many classes
provided("org.springframework:spring-test:${springVersion}") {
exclude group: 'commons-logging', module:'commons-logging'
}
}
}

if(project.name =~ /^(grails-plugin-datasource|grails-test-suite)/) {
dependencies {
provided 'hsqldb:hsqldb:1.8.0.10'
provided 'com.h2database:h2:1.3.176'
}
}

jar{
manifest.mainAttributes(
"Built-By": System.properties['user.name'],
Expand Down Expand Up @@ -371,24 +387,10 @@ subprojects { project ->
id 'jeffscottbrown'
name 'Jeff Brown'
}
}
}
}

// Remove any dependencies that shouldn't be included in the POM
modifyPom { pom ->
// respect 'optional' and 'provided' dependencies
optionalDeps.each { dep ->
pom.dependencies.find { it.artifactId == dep.name }?.optional = true
}
providedDeps.each { dep ->
pom.dependencies.find { it.artifactId == dep.name }?.scope = 'provided'

}

configurations.runtime.allDependencies.each { dependency ->
if (dependency.hasProperty("notInPom") && dependency.notInPom) {
pom.dependencies.removeAll { it.groupId == dependency.group && it.artifactId == dependency.name }
developer {
id 'lhotari'
name 'Lari Hotari'
}
}
}
}
Expand Down Expand Up @@ -417,6 +419,6 @@ apply {
}

task wrapper(type: Wrapper) {
gradleVersion = '2.1'
gradleVersion = '2.3'
jarFile = 'gradle/wrapper/gradle-wrapper.jar'
}
Binary file modified gradle/wrapper/gradle-wrapper.jar
Binary file not shown.
4 changes: 2 additions & 2 deletions gradle/wrapper/gradle-wrapper.properties
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#Thu Sep 18 10:23:07 EEST 2014
#Fri Feb 27 11:32:58 EST 2015
distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-2.1-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-2.3-bin.zip
6 changes: 2 additions & 4 deletions grails-aether/build.gradle
Original file line number Diff line number Diff line change
@@ -1,14 +1,12 @@
ext {
aetherVersion = "1.0.0.v20140518"
aetherProviderVersion = "0.9.0.M2"
mavenVersion = "3.2.1"
aetherVersion = "1.0.2.v20150114"
mavenVersion = "3.2.5"
}

dependencies {
compile("org.eclipse.aether:aether-api:${aetherVersion}")
compile("org.eclipse.aether:aether-util:${aetherVersion}")
compile("org.eclipse.aether:aether-impl:${aetherVersion}")
compile("org.eclipse.aether:aether-connector-file:${aetherProviderVersion}")
compile("org.eclipse.aether:aether-connector-basic:${aetherVersion}")
compile("org.eclipse.aether:aether-transport-http:${aetherVersion}")
compile("org.eclipse.aether:aether-transport-file:${aetherVersion}")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -17,17 +17,21 @@
package org.codehaus.groovy.grails.resolve.maven.aether.support

import groovy.transform.CompileStatic
import org.apache.maven.model.Parent
import org.apache.maven.model.Repository
import org.apache.maven.model.building.FileModelSource
import org.apache.maven.model.building.ModelSource
import org.apache.maven.model.resolution.InvalidRepositoryException
import org.apache.maven.model.resolution.ModelResolver
import org.apache.maven.model.resolution.UnresolvableModelException
import org.apache.maven.repository.internal.MavenRepositorySystemUtils
import org.eclipse.aether.RepositorySystem
import org.eclipse.aether.RepositorySystemSession
import org.eclipse.aether.repository.RemoteRepository
import org.eclipse.aether.resolution.ArtifactRequest
import org.eclipse.aether.resolution.ArtifactResolutionException
import org.eclipse.aether.artifact.Artifact
import org.eclipse.aether.artifact.DefaultArtifact
import org.eclipse.aether.impl.VersionRangeResolver
import org.eclipse.aether.repository.RemoteRepository
import org.eclipse.aether.resolution.*

/**
* @author Graeme Rocher
Expand All @@ -38,11 +42,19 @@ class GrailsModelResolver implements ModelResolver{
private RepositorySystem system;
private RepositorySystemSession session;
private List<RemoteRepository> repositories = []
private VersionRangeResolver versionRangeResolver
private String mavenRequestContext

GrailsModelResolver(RepositorySystem system, RepositorySystemSession session, List<RemoteRepository> repositories) {
this(system, session, repositories, MavenRepositorySystemUtils.newServiceLocator().getService(VersionRangeResolver), '')
}

GrailsModelResolver(RepositorySystem system, RepositorySystemSession session, List<RemoteRepository> repositories, VersionRangeResolver versionRangeResolver, String mavenRequestContext) {
this.system = system
this.session = session
this.repositories = repositories
this.versionRangeResolver = versionRangeResolver
this.mavenRequestContext = mavenRequestContext
}

@Override
Expand All @@ -62,13 +74,59 @@ class GrailsModelResolver implements ModelResolver{
return new FileModelSource(pomFile);
}

@Override
ModelSource resolveModel(Parent parent) throws UnresolvableModelException {
Artifact artifact = new DefaultArtifact(parent.getGroupId(), parent.getArtifactId(), "", "pom",
parent.getVersion());

VersionRangeRequest versionRangeRequest = new VersionRangeRequest(artifact, repositories, mavenRequestContext);
//versionRangeRequest.setTrace( trace );

try {
VersionRangeResult versionRangeResult =
versionRangeResolver.resolveVersionRange(session, versionRangeRequest);

if (versionRangeResult.getHighestVersion() == null) {
throw new UnresolvableModelException("No versions matched the requested range '" + parent.getVersion()
+ "'", parent.getGroupId(), parent.getArtifactId(),
parent.getVersion());
}

if (versionRangeResult.getVersionConstraint() != null
&& versionRangeResult.getVersionConstraint().getRange() != null
&& versionRangeResult.getVersionConstraint().getRange().getUpperBound() == null) {
throw new UnresolvableModelException("The requested version range '" + parent.getVersion()
+ "' does not specify an upper bound", parent.getGroupId(),
parent.getArtifactId(), parent.getVersion());

}

parent.setVersion(versionRangeResult.getHighestVersion().toString());
} catch (VersionRangeResolutionException e) {
throw new UnresolvableModelException(e.getMessage(), parent.getGroupId(), parent.getArtifactId(),
parent.getVersion(), e);
}

return resolveModel(parent.groupId, parent.artifactId, parent.version)
}

@Override
void addRepository(Repository repository) {
addRepository(repository, false)
}

@Override
void addRepository(Repository repository, boolean replace) throws InvalidRepositoryException {
if(replace) {
repositories.findAll() { it.getId() == repository.id }.each {
repositories.remove it
}
}
repositories << new RemoteRepository.Builder(repository.id, "default",repository.url).build()
}

@Override
ModelResolver newCopy() {
return new GrailsModelResolver(system, session,repositories)
return new GrailsModelResolver(system, session, repositories, versionRangeResolver, mavenRequestContext)
}
}
30 changes: 6 additions & 24 deletions grails-core/build.gradle
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
configurations {
optional
}
dependencies {

compile 'org.hibernate.javax.persistence:hibernate-jpa-2.1-api:1.0.0.Final'
Expand All @@ -19,9 +16,8 @@ dependencies {
compile("org.springframework:spring-context:${springVersion}") {
exclude group: 'commons-logging', module:'commons-logging'
}
compile("org.springframework:spring-test:${springVersion}") {
provided("org.springframework:spring-test:${springVersion}") {
exclude group: 'commons-logging', module:'commons-logging'
ext.notInPom = true
}

// Used by Spring AOP
Expand All @@ -32,11 +28,7 @@ dependencies {
exclude group: 'xml-apis', module:'xml-apis'
}

compile ("org.springframework:springloaded:$springLoadedVersion") {
ext.notInPom = true
}


provided ("org.springframework:springloaded:$springLoadedVersion")

compile project(":grails-bootstrap"), {
exclude group:"org.fusesource.jansi", module:"jansi"
Expand All @@ -61,25 +53,15 @@ dependencies {

// These dependencies are not required, but due to a Groovy compiler bug they are loaded by Groovy and hence
// have to be on the path for compilation even though they shouldn't be
optional "org.apache.ant:ant:${antVersion}"
optional "jline:jline:$jlineVersion"
optional "org.fusesource.jansi:jansi:$jansiVersion"
optional("org.codehaus.gant:gant_groovy1.8:${gantVersion}") {
provided "org.apache.ant:ant:${antVersion}"
provided "jline:jline:$jlineVersion"
provided "org.fusesource.jansi:jansi:$jansiVersion"
provided("org.codehaus.gant:gant_groovy1.8:${gantVersion}") {
exclude group:'commons-cli', module:'commons-cli'
}

}

sourceSets {
main {
compileClasspath += files(configurations.optional)
}
test {
compileClasspath += files(configurations.optional)
runtimeClasspath += files(configurations.optional)
}
}
javadoc.classpath += files(configurations.optional)
compileGroovy.doFirst {
delete("${buildDir}/classes/main/META-INF")
ant.mkdir(dir:sourceSets.main.output.classesDir)
Expand Down
6 changes: 3 additions & 3 deletions grails-plugin-async/build.gradle
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
dependencies {
compile 'javax.servlet:javax.servlet-api:3.0.1', provided
compile 'javax:javaee-web-api:6.0', provided
provided "javax.servlet:javax.servlet-api:$servletApiVersion"
provided 'javax:javaee-web-api:6.0'
compile project(':grails-plugin-controllers'), project(':grails-async')
}
}
1 change: 1 addition & 0 deletions grails-plugin-converters/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ dependencies {

compile project(":grails-web"),
project(':grails-plugin-domain-class')
provided project(":grails-async")
}
8 changes: 0 additions & 8 deletions grails-plugin-datasource/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,5 @@ dependencies {
compile "org.apache.tomcat:tomcat-jdbc:$tomcatVersion"
runtime "org.apache.tomcat.embed:tomcat-embed-logging-log4j:$tomcatVersion"

runtime 'hsqldb:hsqldb:1.8.0.10', {
ext.notInPom = true
}

runtime 'com.h2database:h2:1.3.176', {
ext.notInPom = true
}

compile project(":grails-core")
}
4 changes: 1 addition & 3 deletions grails-plugin-domain-class/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,7 @@ dependencies {

compile project(":grails-core"), project(":grails-spring"), project(":grails-validation")

compile project(":grails-async"), {
ext.notInPom = true
}
provided project(":grails-async")

// Datastore APIs
compile("org.grails:grails-datastore-gorm:$datastoreVersion") {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@
* limitations under the License.
*/
package org.codehaus.groovy.grails.plugins

import org.springframework.context.ApplicationContext
import org.springframework.validation.BeanPropertyBindingResult
import grails.validation.ValidationErrors

import org.springframework.context.ApplicationContext
/**
* @author Graeme Rocher
* @since 1.1
Expand All @@ -34,7 +31,7 @@ class DomainClassPluginSupport {
return true
}

def constraints = object.constraints
def constraints = object.getConstraints()
if (constraints) {
for (prop in constraints.values()) {
prop.messageSource = ctx.getBean("messageSource")
Expand Down
3 changes: 2 additions & 1 deletion grails-plugin-testing/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ dependencies {
}

runtime "cglib:cglib:${cglibVersion}"

provided "org.apache.ant:ant:${antVersion}"
}

eclipse {
Expand All @@ -40,4 +42,3 @@ eclipse {
}
}
}

13 changes: 1 addition & 12 deletions grails-plugin-url-mappings/build.gradle
Original file line number Diff line number Diff line change
@@ -1,20 +1,9 @@
configurations {
optional
}
dependencies {
compile "commons-lang:commons-lang:$commonsLangVersion"
compile( "com.googlecode.concurrentlinkedhashmap:concurrentlinkedhashmap-lru:${concurrentlinkedhashmapVersion}" ) {
exclude group: 'commons-logging', module:'commons-logging'
}

compile project(":grails-web"), project(":grails-plugin-controllers"), project(":grails-validation")
optional "junit:junit:${junitVersion}"
provided "junit:junit:${junitVersion}"
}
sourceSets {
main {
compileClasspath += files(configurations.optional)
}
test {
runtimeClasspath += files(configurations.optional)
}
}
Loading

0 comments on commit b46da3a

Please sign in to comment.