Skip to content

Can't use generated properties when building maven #601

@qianlong

Description

@qianlong

The properties generated by this plugin can't be used directly as those declared in <properties>.

Steps to Reproduce

  • Please include the full configuration of the plugin
<plugin>
	<groupId>io.github.git-commit-id</groupId>
	<artifactId>git-commit-id-maven-plugin</artifactId>
	<version>5.0.0</version>
	<executions>
		<execution>
			<id>get-the-git-infos</id>
			<goals>
				<goal>revision</goal>
			</goals>
			<phase>initialize</phase>
		</execution>
	</executions>
	<configuration>
		<generateGitPropertiesFile>true</generateGitPropertiesFile>
		<generateGitPropertiesFilename>${project.build.outputDirectory}/git.properties</generateGitPropertiesFilename>
		<includeOnlyProperties>
			<includeOnlyProperty>^git.branch.*$</includeOnlyProperty>
		</includeOnlyProperties>
		<injectAllReactorProjects>true</injectAllReactorProjects>
		<replacementProperties>
			<replacementProperty>
				<property>git.branch</property>
				<propertyOutputSuffix>version</propertyOutputSuffix>
				<token>^(feature/.+|dev)$</token>
				<value>dev</value>
			</replacementProperty>
		</replacementProperties>
	</configuration>
</plugin>

Expected behavior

  • To use the generated git.branch.version as property in dependency version.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions