Demystifying the maven-release-plugin next version logic

I tried to determine the algorithm that the maven release plugin uses to update the release number for one of my projects.  I didn’t have much luck with google to find out how the update works.   I didn’t want to experiement with by build server since release process also created source control tags, and publishes the build to a maven repo.

Turns out with a little groovy script you can get at the versioning implementation the plugin uses.  You can give it a version, and get back what the next release version is, and what the next snapshot version will be.    This can all be done outside of the build process and outside of running the plugin.  Here is the script

@Grapes(
 @Grab(group='org.apache.maven.release', module='maven-release-manager', version='2.5.3')
)

import org.apache.maven.shared.release.versions.DefaultVersionInfo

check('1.2.3-qualifier-1-SNAPSHOT')

def check(versionStr) {
 def version = new DefaultVersionInfo(versionStr)
 def nextVersion = version.getNextVersion()
 println ""
 println "Current ${version} digits=${version.digits} ann=${version.annotation} annrev=${version.annotationRevision}"
 println " getReleaseVersionString ${version.getReleaseVersionString()}"
 println " getNextVersion ${version.getNextVersion()}"
 println " getReleaseVersionString ${nextVersion.getReleaseVersionString()}"
 println " getNextVersion ${nextVersion.getNextVersion()}"
}

Which results in

Current 1.2.3-qualifier-1-SNAPSHOT digits=[1, 2, 3] ann=qualifier annrev=1
  getReleaseVersionString 1.2.3-qualifier-1
  getNextVersion 1.2.3-qualifier-2-SNAPSHOT
  getReleaseVersionString 1.2.3-qualifier-2
  getNextVersion 1.2.3-qualifier-3-SNAPSHOT

		

VMWare Guest “RecordRoutingInfo: Unable to collect IPv4 routing table”

Cause the VM not to completely boot.  Not even enough to ssh to the VM.

A solution that fixed it for me can be found here:

ERROR “RECORDROUTINGINFO: UNABLE TO COLLECT IPV4 ROUTING TABLE”

jmap can not get class data for sun/net/ExtendedOptionsImpl$$Lambda

I found this while trying to get a java heap dump from a java process on linux.  I used a command like this run as root:

jmap -F -dump:format=b,file=heap.bin 18513

The last number in the command above is the PID of the process to dump.  This resulted in the following exception after a few minutes of execution:

Attaching to process ID 18513, please wait...
Debugger attached successfully.
Server compiler detected.
JVM version is 25.20-b23
Dumping heap to heap.bin ...
Exception in thread "main" java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:483)
        at sun.tools.jmap.JMap.runTool(JMap.java:201)
        at sun.tools.jmap.JMap.main(JMap.java:130)
Caused by: sun.jvm.hotspot.utilities.AssertionFailure: can not get class data for sun/net/ExtendedOptionsImpl$$Lambda$10x00000007c0d2c028
        at sun.jvm.hotspot.utilities.Assert.that(Assert.java:32)
        at sun.jvm.hotspot.utilities.HeapHprofBinWriter.writeInstance(HeapHprofBinWriter.java:803)
        at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter$1.doObj(AbstractHeapGraphWriter.java:95)
        at sun.jvm.hotspot.oops.ObjectHeap.iterateLiveRegions(ObjectHeap.java:353)
        at sun.jvm.hotspot.oops.ObjectHeap.iterate(ObjectHeap.java:171)
        at sun.jvm.hotspot.utilities.AbstractHeapGraphWriter.write(AbstractHeapGraphWriter.java:51)
        at sun.jvm.hotspot.utilities.HeapHprofBinWriter.write(HeapHprofBinWriter.java:433)
        at sun.jvm.hotspot.tools.HeapDumper.run(HeapDumper.java:62)
        at sun.jvm.hotspot.tools.Tool.startInternal(Tool.java:260)
        at sun.jvm.hotspot.tools.Tool.start(Tool.java:223)
        at sun.jvm.hotspot.tools.Tool.execute(Tool.java:118)
        at sun.jvm.hotspot.tools.HeapDumper.main(HeapDumper.java:83)
        ... 6 more

The work around is to not use the -F option.  If you run jmap as the same user as the java process, then the -F is not required.  The dump completed successfully, and also runs orders of magnitude faster.

ResXFileCodeGeneratorEx not working in Visual Studio 2010

Working on a project that was recently upgraded from Visual Studio 2008 to 2010.  I couldn’t figure out why the resx designer files were not updating after updating the resx file.  Turned out that the project was using ResxXFileCodeGeneratorEx to generate resx assemblies.  This allowed the resources to be exposed with public visibility rather than internal visibility.

The root of the problem was that the ResxXFileCodeGeneratorEx was not being run by Visual Studio when the resx file changed.  This was because the extension was not registered for this version of Visual Studio.  Finding the ResxXFileCodeGeneratorEx web site, there hadn’t been a release since 2009.

It took a little googling, but there is a .reg file that will update the registry to register the existing component into Visual Studio 2010.  There were a few posts about this but they had bad links to the script.  I did manage to find this one which does provide the reg file for download.  You can find it here.

http://hazaa.com.au/blog/registry-file-for-registering-resxfilecodegeneratorex/

VMWare guest running Server 2008 R2 and NIC Problems

Been fighting with a couple guest VMs running Windows Server 2008 R2 on ESXi.  I encountered lots of problems with the NIC after deploying from a template, or cloning the guest.  The symptoms were:

  • Network discovery icon in the system tray would spin for a long time then report a red X.
  • From the icon, selecting “Troubleshoot Problems” would never complete
  • From the icon, selecting Open Network and Sharing Center would open the window for the app, but it would never fully render.

Looks like it is a known issue for this OS onVMWare using VMXNET3 virtual NICs.  See VMWare KB Article: 1020078: Deploying Windows 2008 R2 and Windows 7 templates with vmxnet3 renames the NIC as #2 .

The KB article provides several workarounds, as well as a pointer to a server hotfix that also appears to address the problem.

New Chromebook

I decided to purchase a chromebook. I opted for the Acer 720-3445 model which is the one with the i3 processor and 4G of memory. I must say it is a convenient little machine. Web browsing is fast, and time from openning the lid to awake is measured in a few seconds. That is all good.

Only two gripes:

  1. Living in Canada means I had to get the Canadian Bilingual keyboard. I purchased it from the Acer store in Canada and it listed there as having a US keyboard. Unfortunately on arrival it actually had the biligual keyboard. This is a aweful keyboard. The feel is good, and all that, but the problem is that to make room for the extra keys, the Enter key and shift keys are way smaller.  This makes it painful to type on.
  2. Lots of fan noise. Maybe it is because it is an i3 and needs more cooling, but the fan runs quite often and it is quite loud. Loud enough that people ask me if that is normal or if there is something wrong with the machine. The fan will briefly stop if you stop interacting with the chromebook, i.e. you stop scrolling a web page. It would almost be better if it ran all the time, then it might be easier to just mentally tune it out.

So two fairly significant issues, but not quite enough to return it.  Probably should have opted for one of the more mobile processors so the fan would not be required.   And the keyboard, being here in Canada I don’t have much choice.  I wish Acer gave us Canadians the option for a US keyboard.

sqlplus command recall on linux

The common solution to enabling command recall in a sqlplus session on linux, is to use rlwrap.  For redhat variants, you can yum install rlwrap.  Then you can run sqlplus through rlwrap, like this

rlwrap -I sqlplus ...

Note the the -I is a dash captial i (eye).  This prevents some wonky behaviour when you hit ctrl-C.  The -I causes the Ctrl-C to be passed to sqlplus as sigterm.  If you don’t do this, Ctrl-C can cause your sqlplus session to hang, rather than terminate.

 

 

Installing JBoss EAP 6.1 on Linux

The best instructions I have found for installing JBoss EAP 6.1 on linux: http://www.mastertheboss.com/eBooks/eap-linux.pdf

 

svn caret url shortcut on windows

the ^ shortcut in SVN urls is pretty handy.  If you need to type in a svn URL into the command line, you can avoid typing the full url in by using the ^ character.  The ^ character represents the root URL as shown by svn info.

One small complication in windows, is that ^ is a special character in the command line, so if you want to use this feature you need to include two carets.  ie svn sw ^^/branches/superawesomebranch

 

Tagged ,

Confluence Wiki and the Period Key

Definitely an odd one.  Found on Windows 7 with IE 11 editing Confluence pages. Edit a page, enter text, and try to enter a period “.”. The key press will be ignored. You can enter a period mid-paragraph, but not at the end. Bizarre….

Confluence 5.3.1, Windows 7, IE 11

Manufacturer says it’s fixed in 5.4

Ref:

Create your own website, free on WordPress.com.Create your own website.
Start free