Once you have started using automation tools for continuous builds, you often find edge cases where your builds have minor variations due to the environments on which the projects have been built. To isolate these, it is often useful to have the build tool output a snapshot of it’s properties at the time the project was built. Thankfully, Ant and Maven make this easy to implement, required additions to your config files are below for each tool.
NOTE: ‘target’ is preferred over ‘tasks’ in newer versions of the plugin, it was deprecated in 1.5.
Subversion is a commonly used central version control system for software development. There are currently still a large number of organizations that rely upon it, many have since moved on to Git.
sudo apt-get install apache2 apache2-utils
sudo apt-get install subversion subversion-tools libapache2-svn
sudo mkdir /home/svn
svnadmin create /home/svn/test
Create a group for subversion users:
sudo groupadd subversion
sudo adduser USERNAME
Add a user to the group:
sudo useradd -G USERNAME subversion
sudo chown -R www-data:subversion /home/svn/test
sudo chmod -R g+rws /home/svn/test
sudo a2enmod dav_svn
To create/clobber a new file for the first user:
sudo htpasswd -c /etc/apache2/.htpasswd YOURUSER
To add additional users:
sudo htpasswd /etc/apache2/.htpasswd YOURUSER
(repeat for new users without the -c as that creates/clobbers the file)
sudo vi /etc/apache2/sites-available/000-default.conf
Then add to the bottom:
(NOTE1: the LimitExcept can be enabled to allow anonymous access):
(NOTE2: the LimitXMLRequestBody can be uncomment to allow large commits)
AuthName "Subversion Repository"
# AuthUserFile /etc/svn-auth
#<LimitExcept GET PROPFIND OPTIONS REPORT>
sudo service apache2 reload
sudo service apache2 restart
NOTE: At this point you should be able to browse and do a remote checkout of the code from another machine….
svn co http://YOUR-IP-OR-HOSTNAME/svn/test --username YOURUSER --password YOURPASS
sudo vi /etc/init/svnserve.conf
Add the following:
# svnserve - Subversion server
description "Subversion server"
start on (local-filesystems and net-device-up IFACE=lo and started udev-finish)
stop on runlevel 
respawn limit 2 3600
exec /usr/bin/svnserve --foreground --daemon --config-file /home/svn/repos/conf/svnserve.conf --root /home/svn/repos/
sudo initctl start svnserve
Back on the client side…
Create a new folder inside your user folder:
Check out the project into this folder:
svn checkout http://YOUR-IP-OR-HOSTNAME/svn/test
Let us just add a new HTML index file to the folder:
Add it to version control:
svn add index.html
Commit the new file:
svn commit -m "commit message"
That should cover most cases for you…
If you support code for multiple java application servers, you might eventually encounter a file named:
JBoss uses this file to control the path of the web application, whereas Tomcat generally uses the filename of the WAR itself.
Usually, the contents are pretty sparse, you might consider adding one to your projects should you ever wish to deploy them on JBoss:
NOTE: There are several other attributes that can find their way into this file for JBoss, notably security configuration, like JAAS.
WARNING: Unfortunately, I’ve tried to add a simple
DOCTYPE jboss-web and XML preamble to this, file to make it validate, but the server (JBoss 5.1.x) fails to recognize them.
This is a simple example in .tag files, the concepts can apply to many other uses.
I’ve chosen the following common usage example:
Websites often need to contain copyright date and information in their footer.
Add this to your existing JSP page (or JSPF fragment):
<%@ taglib prefix="webinf" tagdir="/WEB-INF/tags" %>
Create the .tag file – /WEB-INF/tags/copyrightyear.tag
<%@ tag language="java" isELIgnored="true" trimDirectiveWhitespaces="true" description="dynamically calculates year" %>
©<jsp:expression>java.util.Calendar.getInstance().get(java.util.Calendar.YEAR)</jsp:expression> <jsp:doBody />
NOTE: I’ve used the <jsp:doBody /> inside the tag file in this example, as such you can also use the following format on your page(s) to use the content between the open and close.
NOTE: if your server supports it, you can also use XML formatted tag file with:
<jsp:directive.tag language="java" isELIgnored="true" trimDirectiveWhitespaces="true" description="dynamically calculates year" />
While the intgration plugins for most SCM products are done rather simply within Eclipse, MKS(now PTC) IntegrityClient requires a few manual steps.
Caution, the plugin has always been a bit “buggy” but nothing too annoying for daily use. I’ve personally used it since IBM WSAD 5.1(Eclipse 3.x based) up to and including the most current Eclipse Luna (4.4) release.
- Go to your MKS installation path, then find the “integrations” folder as in the example below:
- That folder SHOULD have two folders (features/plugins) as well as three files (.eclipseextension, artifacts.xml, content.xml)
- Copy the entire contents and paste/overlay into your ‘eclipse’ folder (where you should already have folders for ‘features/plugins)
- Restart Eclipse
- Configure as required.
I’ve done a lot of front-end java coding over my career, one particularly annoying aspect is the wait for a build (compile-deploy) cycle in my local developement servers to view or test a small change. One particularly useful tool that I’ve been using for some time is a FileSync plugin for Eclipse. It is useful as you can “map” folders from your Eclipse project to a path on your local filesystem, as such the individual files are automatically copied to your server installation. I’ve personally used this approache with JBoss, Tomcat and WebSphere, but there is no reason that it should not work for other servers.