Skip to content

Commit

Permalink
Add 2 additional repository methods for backwards compatibility with Ivy
Browse files Browse the repository at this point in the history
  • Loading branch information
graemerocher committed Sep 24, 2013
1 parent 84fe558 commit 247546e
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@ class AetherDsl {
}

void repositories(Closure callable) {
def rc = new RepositoriesConfiguration()
def rc = new RepositoriesConfiguration(dependencyManager)
callable.delegate = rc
callable.call()

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ import org.sonatype.aether.repository.Authentication
import org.sonatype.aether.repository.Proxy
import org.sonatype.aether.repository.RemoteRepository
import grails.util.Environment
import grails.build.logging.GrailsConsole
import org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager

/**
* @author Graeme Rocher
* @since 2.3
*/
@CompileStatic
class RepositoriesConfiguration {
AetherDependencyManager dependencyManager

RepositoriesConfiguration(AetherDependencyManager dependencyManager) {
this.dependencyManager = dependencyManager
}

List<RemoteRepository> repositories = []

/**
Expand Down Expand Up @@ -57,9 +65,19 @@ class RepositoriesConfiguration {
void grailsHome() {
// noop.. not supported
}

void grailsRepo(String location) {
GrailsConsole.getInstance().warn("grailsRepo() method deprecated. Legacy Grails SVN repositories are not supported by Aether.")
}

void mavenLocal() {
// noop.. enabled by default
}

void mavenLocal(String location) {
dependencyManager.cacheDir = location
}

RemoteRepository mavenCentral(Closure configurer = null) {
final existing = repositories.find { ArtifactRepository ar -> ar.id == "mavenCentral" }
if (!existing) {
Expand Down

0 comments on commit 247546e

Please sign in to comment.