File tree 1 file changed +5
-1
lines changed
src/main/java/se/bjurr/gitchangelog/plugin
1 file changed +5
-1
lines changed Original file line number Diff line number Diff line change 13
13
import java .util .Map ;
14
14
import org .apache .maven .plugin .AbstractMojo ;
15
15
import org .apache .maven .plugin .MojoExecutionException ;
16
+ import org .apache .maven .plugins .annotations .Component ;
16
17
import org .apache .maven .plugins .annotations .Mojo ;
17
18
import org .apache .maven .plugins .annotations .Parameter ;
19
+ import org .apache .maven .project .MavenProject ;
18
20
import se .bjurr .gitchangelog .api .GitChangelogApi ;
19
21
import se .bjurr .gitchangelog .api .InclusivenessStrategy ;
20
22
21
23
@ Mojo (name = "git-changelog" , defaultPhase = PROCESS_SOURCES , threadSafe = true )
22
24
public class GitChangelogMojo extends AbstractMojo {
25
+ @ Component private MavenProject project ;
26
+
23
27
private static final String DEFAULT_FILE = "CHANGELOG.md" ;
24
28
25
29
/** {@link Deprecated} use toRevision */
@@ -363,7 +367,7 @@ public void execute() throws MojoExecutionException {
363
367
364
368
if (this .file == null ) {
365
369
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 ( );
367
371
}
368
372
369
373
if (this .file != null ) {
You can’t perform that action at this time.
0 commit comments