Can Commitizen update pom.xml file? - java

I am working on a Java project and I'm using commitizen to enforce semantic version in CI, when I run the command cz bump and cz changelog update the .cz.yaml and changelog files with the new version but is not updating the version in pom.xml. Is there a functionality in Commitizen to update this file too?
Additionally: the application is currently being built by Maven

Related

MyEclipse How to update the local dependency jars while the remote repo jars are covered?

For some reason, the jar GAV in local pom.xml can't be changed,like a snapshot, its version is always 1.0-SNAPSHOT.
But in the remote repo, it may be covered by other mates.
For the index is not changed, the MyEclipse can't update to the latest jar,and comes somes problems.
I konw that it can update to the latest jar in IDEA,how should I do in MyEclipse?
If you are using the m2e-Plugin you can update the maven dependencies of the project via Alt-F5 and then set the check mark on 'Force Update of Snapshots/Releases'

How to identify and build a JBoss java application from 2007?

I have a java application written in 2007-2010 that I need to build and run.
I am unable to open it in netbeans or eclipse.
Some identifying features of the source code:
It has a maven.xml and project.xml file (not pom.xml) in root
It has a jndi.properties, launch.properties and project.properties file in root
it has a .project and .jupiter file in the root directory
It is currently running in prod in a Jboss container
Are these indicators of some application framework from the late 2000s that someone can identify?
I am hoping to be able to open it in an IDE and build it.
It's a Maven 1 architecture.
[project.xml] Project Object Model (POM) definition
[maven.xml] Custom build scripts
[project.properties] general build settings
[build.properties] local build settings
Here you can see some more information and how to migrate it to Maven 2: Maven 1 to Maven 2
And here is some information on Maven's website about Maven 1: Quick start to Maven 1
Notice that it isn't supported anymore.
.project possibly indicates it's been built with Eclipse
.jupiter probably indicates that they used the code reviewer plugin Jupiter
All that said, I believe you could import it as an Eclipse project. Just pay attention on which Java version to use and which Eclipse and Maven as well.
I'd strongly recommend you to migrate to a newer version of Maven, but I also know how legacy software can be impacted by such migration, so it's up to you which way to go through.

Jenkins: Maven Release on CVS Tag

I am trying to implement a maven release build on a specific cvs tag. Here is my workflow I'm trying to implement:
Jenkins builds a project every night.
Jenkins deploys the WAR on a internal testserver.
After some time I tag an specific tested nightly build in CVS.
Now I will run a maven release build on that specific tag to make sure that only tested changes are in this release and newer changes are irgnored.
The maven release plugin tags this version and deploys the WAR to an artifactory.
Is it somehow possible to make a maven release on a specific CVS tag/branch? Currently I am able to build specific tags/branches with jenkins and also execute a maven release build on this tag/branch. But when I check the tag of the release version it also contains newer changes which makes it unpossible to create hotfixes for this version or just checkout the correct source for a certain version. Another big problem is that the resulting artifact also contains all changes from the HEAD and not only from the selected tag/branch.
I hope you can help me!
You can specify the name of the tag in the CVS settings

replace packages in java library with storm

I'm new to storm and java
i imported java project using old version of storm as library but i want to use another version of storm so i should delete any packages of old storm for this project ! right ?
where can i find it?
i guess it's on the /user/.m2/repository/storm/.... i should delete storm folder on repository ? ! only or is there another thing i should do it ?
what are packages of new version of storm i should put it instead of packages of old version ?
If it is a maven project, you will have pom.xml in your project root folder.
In pom.xml, you will find all the dependencies in <dependencies>...</dependencies>
section where you will find the dependency for apache-storm as well with a version.
For the new version, you can look up in mvn repository and simply change the <version> in your dependency.
If you select any result, you will get the list of all available versions.
The path your are referring to is the maven local repository and you do not need to manually delete any of the folders. Just changing the dependency version in your pom.xml is sufficient.

How to create a cross project source release with Maven

I have a project I need to release the source for. The problem I have is that I need to create a source release for all code that we have developed. The code is across multiple projects, but I want to leverage maven so that only the source for the jars we are actually using is released.
For example:
core code project (multi module maven project)
web app project (multi module maven project). Contains we app module plus some supporting jar modules. Depends on some jars from core code project.
Now I want to release all the source for the web app project but only the source for the core code project that the web app uses.
Can I do this with maven?
I have a feeling it is possible with assembly plugin and source plugin but it is not clear to me how to put this together.
First of all your question is bit unclear. let me assume certain things and proceed.
I believe that following is your folder structure.
web app project
some source code folder
pom.xml
core code project
some source code folder
pom.xml
Take the core code project and change the version from previous version in pom.xml.
let 's say if it was 1.0 change it to 1.1
<groupId>core code project related</groupId>
<artifactId>core code project</artifactId>
<name>core code</name>
<version>1.1</version>
Make your changes to accomodate the web app project in core code project.
later,
in web app project add dependency for core code project in pom.xml
<dependency>
<groupId>core code project related</groupId>
<artifactId>core code project</artifactId>
<name>core code</name>
<version>1.1</version>
</dependency>
In this way, 1.1 version of core project will have only web app related code.
Currently we are using this method. Hope it helps. let me know if you want something else.
I have a feeling it is possible with assembly plugin and source plugin but it is not clear to me how to put this together.
If I understood the question correctly, one solution would be to create an "aggregator" project listing all wanted modules (the relevant modules from the webapp and the relevant modules from the core) and to use the source:aggregate goal from the Maven Source Plugin.
I'm unsure why you want to do this, the pom from your web app project will explicitly list the versions of your code dependencies used, so you can find the source easily. It sounds like you want to store the same artifact twice. So if your web app uses core-x-1.2.3.jar and core-y-4.5.6.jar you would produce a web app sources artifact containing the source from both those core jars in addition to the actual web app source?
You can use the maven versions plugin to update your web app pom to use the latest versions of your core dependencies, I've automated that by running a shell script in a CI server in the past. That means whenever you release a new version of your web app you will be using the latest release of your core code, and all you need to do is update your web app pom from version control.

Categories