-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Maven.extract_pom_info: add support for more lookup variable namespac…
…es. (#567) * Maven.extract_pom_info: add support for more lookup variables. * Add a TODO to improve maven's parent pom inheritance.
- Loading branch information
Showing
3 changed files
with
24 additions
and
3 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
module Bibliothecary | ||
VERSION = "8.5.0" | ||
VERSION = "8.5.1" | ||
end |
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 |
---|---|---|
|
@@ -323,7 +323,7 @@ | |
end | ||
|
||
describe 'parent properties' do | ||
it 'totally ignores parent propes' do | ||
it 'totally ignores parent props' do | ||
parent_props = {} | ||
deps = described_class.parse_pom_manifest(load_fixture('pom.xml'), parent_props) | ||
|
||
|
@@ -352,6 +352,21 @@ | |
bibliothecary_dep = deps.find { |dep| dep[:name] == "io.libraries:bibliothecary" } | ||
expect(bibliothecary_dep[:requirement]).to eq("9.9.9") | ||
end | ||
|
||
it "can extract parent properties specified with a lookup prefix during resolve" do | ||
parent_props = { "scm.url"=>"scm:git:[email protected]:accidia/echo.git" } | ||
|
||
# Esnure that all of these lookup variations resolve to the parent's relevant property. | ||
["project.parent.scm.url", "project.scm.url", "scm.url"].each do |lookup_var| | ||
xml = Ox.parse(%Q! | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<scm><url>${#{lookup_var}}</url></scm> | ||
</project>!) | ||
scm_url = described_class.extract_pom_info(xml, "project/scm/url", parent_props) | ||
expect(scm_url).to eq("scm:git:[email protected]:accidia/echo.git") | ||
end | ||
end | ||
end | ||
|
||
it 'returns property name for missing property values' do | ||
|