Command to update only one ChangeSet : Mvn liquibase command? - maven

Normally to execute all the change set in a file : we use command :
mvn liquibase:update
What should I use If I want to execute to 'specific' Changeset out of many ?

Probably the best way to do this is to use labels on your changesets, and then see if you can get the maven plugin to do a deploy with labels. Labels are a fairly new feature, and it may be that the Maven plugin will need to be updated to provide support for labels. It appears that the Liquibase Maven plugin is currently using Liquibase 3.2, and labels were introduced in 3.3.

Related

Maven automate versioning and changelog generation

I want to automate version and changelog creation from Git commits. So it's basically the same thing as npm standard-version but it's for Maven. So how can I achieve the versioning automatically?
additional information: I want to increase the version at POM file using the Git Commit-lint messages. In npm if you commit features it increases MINOR, and if you commit fix it increases PATCH version automatically at Semantic Versioning and creates a changelog for these changes. I was wondering if there is a similar way for Maven?
I couldn't find a direct way for Maven. However, you can still use standard-version to create the changelog and bump up the version. You have to write a script to make package.json and Maven versions same. I used the Versions Maven Plugin to accomplish it.
mvn versions:set -DnewVersion=%npm_package_version% && mvn versions:commit

Maven liquibase plugin

I am new to Maven and Liquibase. For the past couple of days, I have been playing around with liquibase without Maven. I have tried generating changelog file with a new database and an existing database. Now I am trying to implement Maven and Liquibase using the plugin.
What is the advantange of running Liquibase with Maven from the command prompt rather than just running Liquibase from the command prompt?
Once I generate the pom.xml file and have src folder ready for my current project. I have the maven liquibase plugin in the pom file and liquibase.properties in resources. Will the changeLog file automatically get created?
The reason you would want to use Liquibase through Maven is to better fit with the rest of your build configuration. If you have your project set up with Maven and your CI servers using Maven it is usually easiest to run Liquibase through Maven as well to keep things simpler for you.
There is a generateChangeLog command that you can run either through Maven or through the command line which will generate a changelog file for you based on an existing database. This is often helpful when first starting to use Liquibase.
Once you have your changelog file, you would run liqubase update through the command line or Maven to apply your changelog to a database. As you need to make changes, the recommended approach is to add new changeSets to your changelog file then run liquibase update. This tends to be safer and more consistent than making a change to the database then running liquibase diffChangeLog to capture the change back to the changelog file.

Passing a different version number for jacoco maven plugin through jenkins goals and options

I would like to pass a different version number of jacoco maven plugin in jenkins through goals and options for that project as the default version provided by the jenkins is not compatible. Can you please specify the command line that i can use in jenkins.
My current command line goals and options is :
clean org.jacoco:jacoco-maven-plugin:prepare-agent -U install deploy -Dcatalina.home=$WORKSPACE -DskipITs
btw i dont want to change my pom for each project as i have many projects with different poms which are using the default version number.
Regards
Sun

Using maven git describe plugin value as Jenkins build file name

I use the git-describe maven plugin to replace the POMs <version>${describe}</version> placeholder. mvn deploy needs a custom parameter passed in order for it to properly use the actual git describe value.
I'm now using Jenkins to build the project every time we push to the repo however it too doesn't properly use the actual git-describe value.
The jenkins build artifacts always end named project-${describe}
Are there any suggestions on ways I can customize the file names or force it to use the git-describe result? Otherwise I may be back to manual versioning...
The version property does not allow variable substitution. The first link I found googling this was this SO question.
You'll have to use one of the versioning maven plugins. The maven release plugin is the most popular, but you might find that the versions maven plugin better meets your requirements.

Maven install:? - how to create a release candidate?

Is it possible to create a release candidate from my current maven project without changing the version number in the pom.xml?
I just want to build a new maven artifact form my project with a specific version number.
For example: my current pom.xml has the version '0.0.1'. I have called mvn install to create the artifact in my local repository. Now I would like to create a second artifact with the version '0.0.1-RC1'
Is this possible from the mvn command line without changing the version number in my pom.xml?
I would advice against your suggestion of not changing the version number. One of the Maven's benefits is to keep your releases in sequence, i.e. after you have made your '0.0.1-RC1' candidate you will continue to work on the '0.0.1-RC2-SNAPSHOT' version (which may result in a '0.0.1-RELEASE').
That said, you don't have to change the version number manually. The Maven Release Plugin offers great help with this with commands such as mvn release:prepare and mvn release:perform. Also read the Maven build versions in the Maven reference manual. You may also find the discussion about Maven version scheme interesting.
As I see it you have two options:
Embrace the release plug-in. It's been designed to address this problem.
Use the versions plug-in and issue your own source code control commands.

Resources