Skip to content

Commit da818cb

Browse files
committed
fix: use basedir instead of project.basedir
1 parent 9d42c76 commit da818cb

File tree

4 files changed

+27
-3
lines changed

4 files changed

+27
-3
lines changed

README.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -109,6 +109,30 @@ mvn io.github.zorin95670:semantic-version:release -DtagPrefix=plugin-a@
109109

110110
---
111111

112+
### 📂 Specifying the Working Directory (`basedir`)
113+
114+
All plugin goals support the `basedir` parameter, which determines the directory where the command operates.
115+
116+
* **Default:** The current working directory where the command is executed.
117+
* **Override:** You can explicitly set the directory using `-Dbasedir=/path/to/your/project`.
118+
119+
#### Examples:
120+
121+
```bash
122+
# Run changelog in a specific module
123+
mvn io.github.zorin95670:semantic-version:changelog \
124+
-DtagPrefix=plugin-a@ \
125+
-Dscope=plugin-a \
126+
-Dbasedir=plugins/plugin-a
127+
128+
# Run release from a custom folder
129+
mvn io.github.zorin95670:semantic-version:release \
130+
-DtagPrefix=plugin-b@ \
131+
-Dbasedir=/absolute/path/to/plugin-b
132+
```
133+
134+
---
135+
112136
## Version Bumping Rules
113137

114138
The plugin determines the next semantic version based on commit messages using the following logic:

src/main/java/io/github/zorin95670/semver/CheckCommitMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class CheckCommitMojo extends AbstractMojo {
1818
@Parameter(property = "failOnWarning", defaultValue = "false")
1919
private boolean failOnWarning;
2020

21-
@Parameter(defaultValue = "${project.basedir}", readonly = true)
21+
@Parameter(property = "basedir", defaultValue = "${basedir}", readonly = true)
2222
private File basedir;
2323

2424
public void execute() throws MojoFailureException {

src/main/java/io/github/zorin95670/semver/GenerateChangelogMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ public class GenerateChangelogMojo extends AbstractMojo {
2222
@Parameter(property = "dryRun", defaultValue = "false")
2323
private boolean dryRun;
2424

25-
@Parameter(defaultValue = "${project.basedir}", readonly = true)
25+
@Parameter(property = "basedir", defaultValue = "${basedir}", readonly = true)
2626
private File basedir;
2727

2828
public void execute() throws MojoExecutionException {

src/main/java/io/github/zorin95670/semver/ReleaseMojo.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ public class ReleaseMojo extends AbstractMojo {
2525
@Parameter(defaultValue = "${project}", readonly = true)
2626
private MavenProject project;
2727

28-
@Parameter(defaultValue = "${project.basedir}", readonly = true)
28+
@Parameter(property = "basedir", defaultValue = "${basedir}", readonly = true)
2929
private File basedir;
3030

3131
public void execute() throws MojoExecutionException {

0 commit comments

Comments
 (0)