Skip to content

Commit

Permalink
fix(builders): fix relative path for maven
Browse files Browse the repository at this point in the history
  • Loading branch information
xizhao committed Mar 3, 2018
1 parent 5fe21df commit b954112
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion builders/maven.go
Original file line number Diff line number Diff line change
Expand Up @@ -184,7 +184,7 @@ func (builder *MavenBuilder) DiscoverModules(dir string) ([]config.ModuleConfig,
}
moduleConfigs := make([]config.ModuleConfig, len(pomFilePaths))
for i, path := range pomFilePaths {
artifactName := filepath.Dir(path)
artifactName := filepath.Base(filepath.Dir(dir))
var artifactPom POMFile
if err := parseLoggedWithUnmarshaller(mavenLogger, path, &artifactPom, xml.Unmarshal); err == nil {
if artifactPom.Name != "" {
Expand All @@ -193,6 +193,7 @@ func (builder *MavenBuilder) DiscoverModules(dir string) ([]config.ModuleConfig,
artifactName = artifactPom.ArtifactID
}
}
path, _ := filepath.Rel(dir, path)
moduleConfigs[i] = config.ModuleConfig{
Name: artifactName,
Path: path,
Expand Down

0 comments on commit b954112

Please sign in to comment.