Skip to content

Commit 6d926ed

Browse files
committed
improve docs
1 parent 1ae761f commit 6d926ed

File tree

1 file changed

+42
-7
lines changed

1 file changed

+42
-7
lines changed

docs/faq.md

Lines changed: 42 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,53 @@
1-
Frequently Asked Question (FAQ)
1+
# Frequently Asked Question (FAQ)
22
=========
33

4-
Plugin options and configurations
4+
## Plugin options and configurations
55
-------------------------------
6-
This plugin is around for quite some time and has various options and configurations.
7-
The most up-to-date documentation about the various options can be found in the [plugin itself](https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/master/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java#L105).
6+
This plugin ships with the following main entry points:
7+
* `GitCommitIdMojo` which allows you to get information from your git repository
8+
* `ValidationMojo` which allows you to verify if your project properties are set as you would like to have them set
89

9-
On top of the various options that can be configured in the `pom.xml` the plugin has the following command-line arguments:
10+
11+
### Plugin options and configurations for the `GitCommitIdMojo`
12+
The `GitCommitIdMojo` can be activated by specifying the following execution:
13+
```xml
14+
<executions>
15+
<execution>
16+
<id>get-the-git-infos</id>
17+
<goals>
18+
<goal>revision</goal>
19+
</goals>
20+
<phase>initialize</phase>
21+
</execution>
22+
</executions>
23+
```
24+
25+
The most up-to-date documentation about the various options for the `GitCommitIdMojo` can be found in the [plugin itself](https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/master/src/main/java/pl/project13/maven/git/GitCommitIdMojo.java#L105).
26+
27+
On top of the various options that can be configured in the `pom.xml` the `GitCommitIdMojo` has the following command-line arguments:
1028
* `-Dmaven.gitcommitid.skip=true` - skip the plugin execution
1129
* `-Dmaven.gitcommitid.nativegit=true` - by default this plugin will use the `jgit` implementation to interact with your git repository, specify this command-line option to use the native `git` binary instead
30+
1231
Note that all command-line options can also be configured in the `pom.xml`.
1332

33+
### Plugin options and configurations for the `ValidationMojo`
34+
35+
The `ValidationMojo` can be activated by specifying the following execution:
36+
```xml
37+
<execution>
38+
<id>validate-the-git-infos</id>
39+
<goals>
40+
<goal>validateRevision</goal>
41+
</goals>
42+
<phase>package</phase>
43+
</execution>
44+
```
45+
46+
The most up-to-date documentation about the various validations that can be configured for the
47+
`ValidationMojo` can be found in the [here](https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/master/docs/using-the-plugin.md#validation-usage-example).
48+
You may also find more technical details in the [Validation Properties](https://github.com/git-commit-id/git-commit-id-maven-plugin/blob/master/src/main/java/pl/project13/maven/validation/ValidationProperty.java#L26) that are used to configure the validations.
1449

15-
Generated properties are not usable inside the pom / properties don't get exposed by the plugin
50+
## Generated properties are not usable inside the pom / properties don't get exposed by the plugin
1651
-------------------------------
1752
Since version `2.1.4` there is a switch to control if you want the plugin to expose the generated properties to your pom as well.
1853
This switch is set to `false` by default to ensure that properties of reactor builds can't be overwritten by accident.
@@ -43,7 +78,7 @@ Example:
4378
If you are using the Maven build with [Maven's Plugin Prefix Resolution](https://maven.apache.org/guides/introduction/introduction-to-plugin-prefix-mapping.html) (e.g. `mvn somePrefix:goal`) please note that this currently seems to be [not supported by Maven](https://issues.apache.org/jira/browse/MNG-6260).
4479
Instead of using the Plugin Prefix Resolution add an execution tag that calls the desired goal of the plugin within a normal Maven life cycle (e.g. `mvn clean package`).
4580

46-
Generated properties are not being used in install and/or deploy
81+
## Generated properties are not being used in install and/or deploy
4782
-------------------------------
4883
If you try to use generated properties like `${git.commit.id}` alongside with your artifact finalName you will soon notice that those properties are not being used in install and/or deploy.
4984
This specific behaviour is basically **not intended / not supported** by maven-install-plugin and/or maven-deploy-plugin (https://issues.apache.org/jira/browse/MINSTALL-1 / https://issues.apache.org/jira/browse/MDEPLOY-93). The naming format in the remote repo seems to be always `$artifactId-$version-$classifier` *by default* and thus any generated property will not end up inside the artifact being installed/deployed.

0 commit comments

Comments
 (0)