Skip to content

Commit

Permalink
refactor Java plugin to call mvn clean when pom.xml exists
Browse files Browse the repository at this point in the history
  • Loading branch information
mthenw committed Feb 23, 2016
1 parent 22d4e22 commit 24303c2
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions plugins/java/java.go
Original file line number Diff line number Diff line change
Expand Up @@ -97,19 +97,19 @@ func (p *Plugin) Build(fn *function.Function, zip *archive.Archive) error {
zip.AddBytes(file.Name, b)
}

if err := p.cleanTarget(fn); err != nil {
return err
}

if generatedPom {
os.Remove(expectedPomPath)
}

return nil
}

// Clean runs mvn clean.
func (p *Plugin) Clean(fn *function.Function) error {
if fn.Runtime != RuntimeCanonical {
return nil
}

// cleanTarget cleans target dir. pom.xml is required to call this function.
func (p *Plugin) cleanTarget(fn *function.Function) error {
fn.Log.Debug("cleaning mvn tmpfiles")
cmd := exec.Command("mvn", "clean")
cmd.Dir = fn.Path
Expand Down

0 comments on commit 24303c2

Please sign in to comment.