Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement support for the dependencyManagement concept as seen in Maven
http://maven.apache.org/guides/introduction/introduction-to-dependency-mechanism.html#Dependency_Management This allows users to enforce versions of transitive dependencies. Fix for GRAILS-11501
- Loading branch information
1 parent
e654ef9
commit ef869e3
Showing
7 changed files
with
202 additions
and
47 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
52 changes: 52 additions & 0 deletions
52
...dehaus/groovy/grails/resolve/maven/aether/config/DependencyManagementConfiguration.groovy
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
/* | ||
* Copyright 2014 the original author or authors. | ||
* | ||
* Licensed under the Apache License, Version 2.0 (the "License"); | ||
* you may not use this file except in compliance with the License. | ||
* You may obtain a copy of the License at | ||
* | ||
* http://www.apache.org/licenses/LICENSE-2.0 | ||
* | ||
* Unless required by applicable law or agreed to in writing, software | ||
* distributed under the License is distributed on an "AS IS" BASIS, | ||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | ||
* See the License for the specific language governing permissions and | ||
* limitations under the License. | ||
*/ | ||
package org.codehaus.groovy.grails.resolve.maven.aether.config | ||
|
||
import org.codehaus.groovy.grails.resolve.maven.aether.AetherDependencyManager | ||
import org.eclipse.aether.artifact.DefaultArtifact | ||
import org.eclipse.aether.graph.Dependency | ||
|
||
/** | ||
* Allows configuration of dependency management. | ||
* | ||
* @since 2.4.1 | ||
* @author Graeme Rocher | ||
*/ | ||
class DependencyManagementConfiguration extends DependenciesConfiguration { | ||
DependencyManagementConfiguration(AetherDependencyManager dependencyManager) { | ||
super(dependencyManager) | ||
} | ||
|
||
@Override | ||
protected addDependencyToManager(DependencyConfiguration dependencyConfig) { | ||
dependencyManager.addManagedDependency(dependencyConfig.dependency) | ||
} | ||
|
||
@Override | ||
protected addBuildDependencyToManager(DependencyConfiguration dependencyConfig) { | ||
dependencyManager.addManagedDependency(dependencyConfig.dependency) | ||
} | ||
|
||
void dependency(String pattern, @DelegatesTo(DependencyConfiguration) Closure customizer = null) { | ||
addDependency new Dependency(new DefaultArtifact(pattern), null), customizer | ||
} | ||
|
||
void dependency(Map<String, String> properties, @DelegatesTo(DependencyConfiguration) Closure customizer = null) { | ||
addDependency(properties, null, customizer) | ||
} | ||
|
||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.