Skip to content

Commit

Permalink
Merge pull request #145 from nebula-plugins/130/fix-Malformed-project…
Browse files Browse the repository at this point in the history
…-url-when-hyphen-present

Fix Malformed project URL generated for pom.xml when hostname contains hyphen-minus character
  • Loading branch information
rpalcolea authored Sep 16, 2019
2 parents 9e0913d + 452545d commit 7e8a83b
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class MavenScmPlugin implements Plugin<Project> {
}
}

static final GIT_PATTERN = /((git|ssh|https?):(\/\/))?(\w+@)?([\w\.]+)([\:\\/])([\w\.@\:\/\-~]+)(\.git)(\/)?/
static final GIT_PATTERN = /((git|ssh|https?):(\/\/))?(\w+@)?([\w\.@\\/\-~]+)([\:\\/])([\w\.@\:\/\-~]+)(\.git)(\/)?/

/**
* Convert git syntax of git@github.com:reactivex/rxjava-core.git to https://github.com/reactivex/rxjava-core
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,9 +35,11 @@ class MavenScmPluginSpec extends PluginProjectSpec {

where:
scmOrigin | calculatedUrl
'https://fake-scm.com/foo/bar.git' | 'https://fake-scm.com/foo/bar'
'https://github.com/nebula-plugins/nebula-publishing-plugin' | 'https://github.com/nebula-plugins/nebula-publishing-plugin'
'https://github.com/nebula-plugins/nebula-publishing-plugin.git' | 'https://github.com/nebula-plugins/nebula-publishing-plugin'
'[email protected]:nebula-plugins/nebula-publishing-plugin.git' | 'https://github.com/nebula-plugins/nebula-publishing-plugin'
'[email protected]:username/nebula-publishing-plugin.git' | 'https://github.com/username/nebula-publishing-plugin'
'[email protected]:username/nebula-publishing-plugin.git' | 'https://github.com/username/nebula-publishing-plugin'
}
}

0 comments on commit 7e8a83b

Please sign in to comment.