Tuesday, March 22, 2011
Maven auto increment build number
In the pom.xml file add following plugin:
<plugins>
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>buildnumber-maven-plugin</artifactId>
<version>1.0-beta-4</version>
<executions>
<execution>
<phase>validate</phase>
<goals>
<goal>create</goal>
</goals>
</execution>
</executions>
<configuration>
<doCheck>true</doCheck>
<doUpdate>false</doUpdate>
<format>${version}.{0,number}</format>
<items>
<item>buildNumber</item>
</items>
</configuration>
</plugin>
Now the $buildNumber value can be used from inside the pom file e.g. this way:
<build>
<finalName>
${project.artifactId}-${buildNumber}
</finalName>
Every time build gets to the maven validate phase, there is a buildNumber.properties file created or updated with current build number. However there is a catch.
This solution is good if the buildNumber.properties file is not being moved or deleted and I have learned that if the file is gone, the build number will be reset to 1 again, making this not usable, especially on dynamically created build agents, as it is used in my organization (Teamcity and Amazon EC2 integration).
More information about the build number plugin: http://mojo.codehaus.org/buildnumber-maven-plugin/
Tuesday, February 22, 2011
Parsing XML time value with java SimpleDateFormat
<startTime>2011-02-23T08:00:
Monday, February 21, 2011
Embedded mule ESB Java web services deployment and configuration to Tomcat server
Tomcat setup:
- Install Tomcat server (e.g. version 6.0 - requires Java 1.6 installed)
Deployment or upgrade of web services
- Place the war file (WebApplicaton_War_File_Name.war) file in Tomcat_Home\webapps
- Start / Restart Tomcat
Service url configuration
(Tomcat_Home\webapps\WebApplicaton_War_File_Name\WEB-INF\classes\mule-config.xml)
by changing endpoint address value
-After configuration changes restart Tomcat server.
Testing if correctly deployed
Troubleshooting
Tomcat_Home\logs
Resolving invalid target release error, java maven build
Friday, January 7, 2011
Attaching debugger to .NET Compact Framework on mobile device (or emulator)
Enable Managed debugging on the mobile device - by default it is disabled to not affect performance.
Run Visual Studio Remote Tools> Remote Registry Editor and choose the Mobile Device/Emulator
Add/Change following key in registry
Go to the :
HKEY_LOCAL_MACHINE/SOFTWARE/Microsoft/.NETCompactFramework/Managed Debugger/ and set the AttachEnabled value to 1
if the 'Managed Debugger' key does not exist just create it, the same with AttachEnabled value (new DWORD Value with name: AttachEnabled and value: 1)
In the Visual Studio go to Debug > Attach to Process
In the Transport choose Smart Device
Browse for your Device/Emulator
Choose the application and attach debugger ( if an application have been opended before making changes in the Device Registry you may have to restart the application )
Right now (if the symbols are loaded) you can start debugging application. Voila!
Eclipse conditional breakpoints
1) on the Debug perspective go to Breakpoints view
2) Right-click the breakpoint and choose "Breakpoint properties" (or select the breakpoint and press Alt+Enter)
3) On the properties window enable checkbox "Enable condition" and type a condition expression, breakpoint can be hit when condition becomes true or the condition value changes-it is all configurable.
That's all, although setting conditional breakpoint is not as intuitive as in Visual Studio, it works and does the job!
Monday, March 1, 2010
Sun VirtualBox and Windows Mobile Emulator issues
I have been using VMWare for hosting virtual images of development but i got some serious performance issues after starting more than one virtual machine. Someone suggested using Sun Microsystems VirtualBox and I can say that everything ran very well until I had to configure Windows Mobile Device Emulator 6.5 Professional. After starting the Emulator (during "install device drivers" pop up) the whole guest operating system (Windows 7) got frozen and plugging the power off was the only solution.
I have searched for possible solution on the internet but could not found similar case; anyway I don't believe it happened only to me ;)
Temporary solution was switching back to VMWare (VMWare Player in this case) where the Windows Mobile Emulator works fine there.