Thursday, November 20, 2008

Using PGP

1. If you want to ask Jerry send you a PGP encrypt file.
    Generate a pair of key (public key and private key). send the public key to Jerry, Jerry will encrypt the file with the public key. and send back the encrypt file, then you can decrypt the file with your private key.

2. Keyring is the place hold your keys. It includes public keyring and private keyring.

Monday, November 10, 2008

Can't delete dist folder by using ant delete

In the Windows platform, seems like some program is using dist folder. But I can't find any except ant itself. The reason is

<path id="classpath.lib">
        <fileset refid="fileset.project.jar"/>
        <fileset refid="fileset.common.jar"/>
        <fileset dir="${root.dir}">
                 <include name="**/dist/*.jar" />
                <exclude name="${basedir}/dist/*.jar"/>
        </fileset>
  </path>

I defined classpath include all dist folder, even exclude the jar in current project, but ant still load this file which cause it can't delete dist folder.

I move the red portion into Javac task, then problem solved.

Saturday, November 8, 2008

Install Trac on Solaris 10

1. test if python is installed.
    #python
Python 2.4.4 (#1, Jan  9 2007, 23:31:33) [C] on sunos5
Type "help", "copyright", "credits" or "license" for more information.
>>>

  1.a I want python 2.5, then remove 2.4.
      #pkgchk -l -p `which python`
      #pkgrm SMCpython
      #pkg-get install python

2. install setuptools 0.6c9 which is a tool makes download, build, install, upgrade, and uninstall Python packages easier!
  setuptools-0.6c9-py2.5.egg (md5)
  (match the version)

3. install trac by using following command, it will install trac-0.11 (Reference to Trac Installation)
 #
easy_install Trac
  3.a Before install Trac, I have to install SQLite, I have tried to use MySQL, but have trouble to find some library.
   #pkg-get install sqlite
  3.b Install Python to SqLIte engine
    #pkg-get install pyslite
  3.c Prerequired packages
    #easy-install Genshi

4. run trac-admin to create project environment
 # trac-admin /path/to/myproject initenv
It will ask a series of questions. Since I use SQLite, all use default.
change owner of /path/to/myproject to web user. I check the file /etc/apache2/httpd.conf, find User and Group, which is webservd.
#chown -R webservd:webservd /path/to/myproject

5. Start stand-alone Trac server
#tracd --port 8998 /path/to/myproject



Cruisecontrol and Maven2

<cruisecontrol>
<!-- Load environment variables -->
<property environment="env" toupper="true"/>

<!-- Commonly used directories -->
<property name="project.dir" value="projects/${project.name}"/>
<property name="log.dir" value="logs/${project.name}"/>

<!-- Defaults for email -->
<property name="buildmaster.email" value="matt@raibledesigns.com"/>
<property name="buildmaster.name" value="Matt Raible"/>

<!-- CruiseControl settings -->
<property name="interval" value="1800"/>
<property name="build.server" value="home.raibledesigns.com:8280"/>

<!-- Preconfigure our plugins -->
<plugin name="currentbuildstatuslistener" file="${log.dir}/status.txt"/>
<plugin name="currentbuildstatuspublisher" file="${log.dir}/status.txt"/>
<plugin name="svn" localWorkingCopy="${project.dir}"/>

<plugin name="htmlemail"
buildresultsurl="http://${build.server}/buildresults/${project.name}"
subjectprefix="[CruiseControl] " css="webapps/cruisecontrol/css/cruisecontrol.css"
xsldir="webapps/cruisecontrol/xsl" logdir="logs/${project.name}"
mailhost="localhost" defaultsuffix="@dev.java.net" reportsuccess="fixes"
returnaddress="${buildmaster.email}" returnname="${buildmaster.name}"/>

<plugin name="email"
buildresultsurl="http://${build.server}/buildresults/${project.name}"
subjectprefix="[CruiseControl] " reportsuccess="always"
mailhost="localhost" defaultsuffix="@dev.java.net"
returnaddress="${buildmaster.email}" returnname="${buildmaster.name}"/>

<project name="appfuse-2.x">
<listeners><currentbuildstatuslistener/></listeners>

<bootstrappers>
<svnbootstrapper localWorkingCopy="projects/${project.name}" />
</bootstrappers>

<modificationset><svn/></modificationset>

<schedule interval="${interval}">
<maven2 mvnhome="${env.M2_HOME}" pomfile="projects/${project.name}/pom.xml" goal="clean scm:update install"/>
</schedule>

<log>
<merge dir="projects/${project.name}/data/common/target/surefire-reports"/>
<merge dir="projects/${project.name}/data/hibernate/target/surefire-reports"/>
<merge dir="projects/${project.name}/data/ibatis/target/surefire-reports"/>
<merge dir="projects/${project.name}/data/service/target/surefire-reports"/>
<merge dir="projects/${project.name}/web/common/target/surefire-reports"/>
<merge dir="projects/${project.name}/web/common-war/target/surefire-reports"/>
<merge dir="projects/${project.name}/web/jsf/target/surefire-reports"/>
<merge dir="projects/${project.name}/web/spring/target/surefire-reports"/>
<merge dir="projects/${project.name}/web/struts/target/surefire-reports"/>
<merge dir="projects/${project.name}/web/tapestry/target/surefire-reports"/>
</log>

<publishers>
<onsuccess>
<artifactspublisher dest="artifacts/${project.name}" dir="${env.HOME}/.m2/repository/org/appfuse"/>
</onsuccess>

<currentbuildstatuspublisher/>
<email><always address="${buildmaster.email}"/></email>
</publishers>
</project>
</cruisecontrol>
Continuum vs. CruiseControl for Maven 2 (from Raible Designs)

I spent some time this past weekend getting automated builds setup for AppFuse 2. Since the project now uses Maven 2, I figured I'd give Continuum a try. I pointed it at my pom.xml in SVN and expected everything to work out-of-the-box. No dice. It seems that Continuum reads the artifactIds instead of the module names for sub-project resolution. To workaround this issue, I'd basically have to rename all my sub-projects to have an "appfuse-" prefix. Doesn't that violate the whole DRY principle? Sure, there's projects that do this, but there's others that don't.

Since I didn't feel like renaming the modules/directories in SVN, I gave CruiseControl a try instead. It took a bit of elbow grease on my part, but I ended up with a config.xml file that works splendidly. It seems somewhat ironic to me that the CruiseControl works better with Maven 2 than Continuum does.

Google+