Skip to content

Commit 853c6d7

Browse files
committed
fix: default CHANGELOG.md
1 parent 9731065 commit 853c6d7

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/main/java/se/bjurr/gitchangelog/plugin/GitChangelogMojo.java

+5-1
Original file line numberDiff line numberDiff line change
@@ -13,13 +13,17 @@
1313
import java.util.Map;
1414
import org.apache.maven.plugin.AbstractMojo;
1515
import org.apache.maven.plugin.MojoExecutionException;
16+
import org.apache.maven.plugins.annotations.Component;
1617
import org.apache.maven.plugins.annotations.Mojo;
1718
import org.apache.maven.plugins.annotations.Parameter;
19+
import org.apache.maven.project.MavenProject;
1820
import se.bjurr.gitchangelog.api.GitChangelogApi;
1921
import se.bjurr.gitchangelog.api.InclusivenessStrategy;
2022

2123
@Mojo(name = "git-changelog", defaultPhase = PROCESS_SOURCES, threadSafe = true)
2224
public class GitChangelogMojo extends AbstractMojo {
25+
@Component private MavenProject project;
26+
2327
private static final String DEFAULT_FILE = "CHANGELOG.md";
2428

2529
/** {@link Deprecated} use toRevision */
@@ -363,7 +367,7 @@ public void execute() throws MojoExecutionException {
363367

364368
if (this.file == null) {
365369
this.getLog().info("No output set, using file " + DEFAULT_FILE);
366-
this.file = new File(DEFAULT_FILE);
370+
this.file = this.project.getBasedir().toPath().resolve(DEFAULT_FILE).toFile();
367371
}
368372

369373
if (this.file != null) {

0 commit comments

Comments
 (0)