Maven-Release Plugin - Tag Format - Appending Date to the tagformat - maven-release-plugin

I would like to append Date or any variable which is coming from Jenkins user parameters to the tagnameformat while using release:prepare release:perform.
Is there a way to do this?

Related

Unable to use variables for artifact name in gitab-ci.yml

I have read GitLab's Use CI/CD Variables to Define Artifact Name documentation and examples.
In the following excerpt of my .gitlab-ci.yml file, I try to replicate their powershell example:
artifacts:
name: "$env:CI_JOB_STAGE-$env:CI_COMMIT_REF_NAME"
expire_in: 1 week
paths:
- My\Hardcoded\Path\*
But when I download the artifact, it's named: _env_CI_JOB_STAGE-_env_CI_COMMIT_REF_NAME.zip. I wanted to use a variable for my artifact path, but that didn't work either, so I was forced to hardcode it. What am I doing wrong?
I'm familiar with the open GitLab issue: Artifacts Filename Cannot Be Set with Dynamic Variables, and I would eventually like to put a date & timestamp in the artifact name, but first I'd just like to get any variable working.
I'm using GitLab v15.1.1-ee. My runner is v15.1.1, installed in Windows and uses a shell executor in powershell.
Per Ville Laurikari's comment, it appears this was a bug affecting v15.1.1. Today, I noticed that our GitLab instance was upgraded to v15.1.2-ee, and I replaced my runner with v15.1.0. The variables now work as documented.

Not able to pass the dynamic value from eclipse to POM

Passing the version to POM.xml.
It shows warning. 'version' contains an expression but should be a constant.
I have to remove this.
I have one Ant project and another maven project. I made one runconfiguration for Ant project where I made one variable with some value suppose 13.2.1
by opting external tool configuration that variable come in list now.now able to pass that variable like -Dversion="${versionjar}".
its working perfactly.
since this versionjar is already set in eclipse. I want to use this while I want to run the maven project by runconfiguration.
want to pass in create manage and runconfiguration like in goal section install -Dversion="${versionjar}" but its not working .
I have to set this variable here also by add button.
How can I pass the variable from eclipse command line like :install -version="${version}"? version is vailable in eclipse variable list while "${version}" is properly send to pom when it is hard coded.
"${version}" is not resolving when send in goals section of run configuration
I'm facing problem when passing the eclipse variable from command line configuration.
in POM
<version>${version}</version>
<packaging>jar</packaging>

Pass liquibase parameters to gradle liquibase 'update' task

I want to pass username, password and url liquibase parameters as a command line parameters to gradle's liquibase update task.
I have followed liquibase-gradle-plugin to configure the plugin.
What I actually want to achieve is, pass these database parameters at runtime instead of hardcoding them in liquibase.properties file.
I can do this by exporting these three values as environment variables and access them in build.gradle. But I want to achieve this using commandline parameters.
I tried
gradle update --url=jdbc:postgresql://localhost:5432/liquibase_cmd_test --username=### --password=### -PrunList=main
but it gives error as
Unknown command-line option '--url'.
I think that underneath gradle is Java, so you should be able to do something like this. The -D argument sets a system property.
gradle -Dliquibase.url=<your url> -Dliquibase.username=<username> -Dliquibase.password=<password> update -PrunList=main

Using Maven property inside TeamCity Build Step

I would like to use a property, which I defined inside my pom.xml. Now I would like to refer to this property value inside my TeamCity Build Step.
At the moment I'm only able to refer the other way around to use a TeamCity property inside Maven.
In particular I want to do a SSH Deployer with a target like url/path/%maven.output.type%/something with
<properties>
<!-- Art der Entwicklung -->
<output.type>testing</output.type>
</properties>
What I tried was to define a parameter in TeamCity but I have no idea how to define the value of this parameter.
Is there any way to use this property inside the TeamCity build?
You can run a script that will set a teamcity parameter that you can use in a another build step. Here are the build configuration settings I use:
Create a configuration parameter with an empty text value with a name used in the next step (e.g. outputType).
Add a build step, with runner type Command line:
Select to run a custom script.
In the custom script field, enter a script that will extract the value from the pom file, and tell teamcity to set it in the parameter. For example:
testing=sed -n 's:.*<output\.type>\(.*\)</output\.type>.*:\1:p' pom.xml
echo "##teamcity[setParameter name='outputType' value='$testing']"
This will set the teamcity parameter outputType with the value of an element named output.type found in the current project pom file.
In another build step, you can use that parameter in a field like, for instance, the target field:
somepath/%outputType%

Teamcity - save build parameters in produced artifact

I build j2ee aplication as WAR with teamcity.
I want keep the same WAR name and save build parameters in produced artifact.
What the best way to save teamcity build parameters (like build.number, svn.revision, buiild.date etc) inside it?
Something like
echo build.number=%build.number% > prop.properties
is what I do in a TeamCity build step to directly record parameters to a file.

Resources