Exemption with Maven

I recently released the maven project and could not stop thinking that the whole process is very complex and error prone. Let's say I have an application that consists of 3 modules A, B, and C, each of which has its own subdirectory folder and a separate build task in Hudson. Each module has a parent POM that combines several artifacts. A depends on B, and B depends on C. The dependency options are defined at the top level of POM D, which is the parent of A, B, and C. It does nothing except that all versions are stored in one place and that there is only one version each artifact used throughout the project. To make a release, I do the following:

  • Release the top level of POM D using the release plugin via Hudson.
  • Start with C, which has no additional dependencies.
  • Modify C to refer to the released version of D. Release C with the release plugin.
  • Enter the released version of C in D, so C-dependent modules can be released with stable version C.
  • Release D again with the release plugin.
  • Do 3-5 for B
  • Do 3-5 for A

After that, I have stable builds that are not related to snapshot of all artifacts in A, B and C, and they can assemble them together with the final stable version of the application.

In reality, I had not only 3, but also 20 such modules. Now I find this procedure very difficult, and I think she has many potential problems:

  • I need to release D several times, once for each level in the dependency hierarchy. In the end, I have D with only stable versions of A, B, and C in it. To continue the next version of development, I need to edit D again and refer to all new versions of snapshots of released modules. In general, dependency management must be done manually, even when using the release plugin.

  • If someone commits while I am doing graduation, this can ruin things. To be sure that I will need to check the specific revision of all modules, compile and test it, and then make a release for all modules of this revision. But how can I guarantee that using Hudson and multiple tasks?

  • Depending on three different systems: Subversion server, Hudson server, and Maven archive server. If only one drops, I can no longer release it.

  • Time. In this process, for each module that I release, there is a lot of assembly, packaging, loading, loading, unloading, etc., over and over. There is a lot of redundant data exchange with the archive. But in fact, everything can be done locally, since Hudson has all the source codes that he needs. Only once at the end should the last package be downloaded.

  • Say I lost packages on the archive server. There is no easy way to tell Hudson to check tagged versions and rebuild them in the correct order.

Why is it not so simple as checking all the code in one frame, adapting one global version, assembling and testing, commit, commit commit, and finally, download binary files?

Thanks for any ideas on this.

+6
java maven svn hudson maven-release-plugin
source share
2 answers

It can be that simple. Using the parent pom, you can use all of your modules for the same parent. Then install the version of the child modules: ${version.properties} , when starting the assembly, run it using mvn -Dversion.properties xyx-SNAPSHOT (for dev) or xyz for the production assembly, then all modules will be deployed immediately with the same version.

So, for automatic build, to specify <version.properties>1.1.1-SNAPSHOT</version.properties> in the settings.xml file, then if you need the released product to specify an additional parameter at run time with -Dx.yz to override the settings.xml file.

The only trick for this is that the parent pom must have a non-dynamically defined version, and this will need to be installed in all child documents. Therefore, after each release, you can update this version number manually (although there is probably a plugin for it)

+1
source share

If you always release modules in sync, I will have one parent pom for the entire project, which includes all the modules and ensures that all versions are the same. When you release the top level, it releases all the modules in order with the correct versions at a time.

0
source share

All Articles