Archive for July, 2010

ant: delete, copy, jar, mkdir tasks

Tuesday, July 27th, 2010

Ant Task Overview

Delete

<delete>
   <fileset dir="WEB-INF/lib" includes="**/some*.jar" excludes="**/some-other*.jar" />
</delete>

Ant Delete Doc

Copy

<copy todir="../new/dir">
    <fileset dir="src_dir"/>
</copy>

<copy todir="../dest/dir">
    <fileset dir="src_dir">
      <exclude name="**/*.java"/>
    </fileset>
</copy>

<copy todir="../dest/dir">
    <fileset dir="src_dir" excludes="**/*.java"/>
</copy>

Ant Copy Doc

maven: Plugin for building executable jar manifest

Sunday, July 25th, 2010
<plugin>
  <groupId>org.apache.maven.plugins</groupId>
  <artifactId>maven-jar-plugin</artifactId>
  <configuration>
    <archive>
      <manifest>
        <addClasspath>true</addClasspath>
        <mainClass>org.example.MyStart</mainClass>
      </manifest>
    </archive>
  </configuration>
 </plugin>

Source: Maven Guide > Guide to Working with Manifests

Jetty: Configuration, Web Application, Virtual Hosting

Thursday, July 22nd, 2010

Set a WebApp directly from directory (without .war file)

    <!-- =========================================================== -->
    <!-- Set handler Collection Structure                            -->
    <!-- =========================================================== -->
    <Set name="handler">
      <New id="Handlers" class="org.eclipse.jetty.server.handler.HandlerCollection">
        <Set name="handlers">
         <Array type="org.eclipse.jetty.server.Handler">
           <Item>
             <New id="akuiContext" class="org.eclipse.jetty.webapp.WebAppContext">
                <Set name="contextPath">/mywebapp</Set>
                <Set name="resourceBase">/path/to/single/mywebapp</Set>
             </New>
           </Item>
         </Array>
        </Set>
      </New>
    </Set>

Remote Debuging

#format: -agentlib:jdwp=name1[=value1],name2[=value2]...
java -agentlib:jdwp=transport=dt_socket,server=y,address=8000,suspend=n start.jar

help: prints a brief message on how to use it and exits the VM.

server: (“n” or “y”) If “y,” listen for a debugger application to attach; otherwise, attach to the debugger application at the specified address.

address: transport address for the connection. If server=n, attempt to attach to a debugger application at this address. If server=y, listen for a connection at this address.

timeout: If server=y, this specifies the timeout, in milliseconds, to wait for the debugger to attach. If server=n, this specifies the timeout, in milliseconds, to use when attaching to the debugger.

suspend: If “y,” JVM suspends the execution until a debugger connects to the debuggee JVM.

More info: Techrepublic and Source: StackOverflow

Other links

Pics: Know you icons, Part I and II

Monday, July 19th, 2010

Great posts about icons from PSD-TUTS:

Know Your Icons Part I

Know Your Icons Part II
Know Your Icons

Maven: Maven Tips & Quick Start & Cheat Sheet

Monday, July 19th, 2010

Skip Test

mvn -Dmaven.test.skip=true package

Official JBoss Repository for Hibernate and more

<repository>
 <id>jboss-repository-group</id>
 <name>jboss-repository-group</name>
 <url>https://repository.jboss.org/nexus/content/groups/public/</url>
 <layout>default</layout>
</repository>

Note: the “http://repository.jboss.org/maven2/” is deprecated. Use the above one (Announcement, Getting Started Doc ).

Generate Source

mvn source:jar

maven source doc

Generate Source

mvn javadoc:jar

maven javadoc doc

Publishing Artifacts to Central Repository

Maven Sonatype/Maven Central commands

Publish Snapshots

mvn clean deploy

Or better with source

mvn clean source:jar javadoc:jar deploy

Stage the release

# prepare it (will create the new tag in sonatype SVN, automatically checking in on your behalf).
mvn release:clean
mvn release:prepare
#stage the release
mvn release:perform

Maven will checkout the tag you just prepared, then build and deploy it into Nexus staging repository.

release it

Other Links

Linux: Add User to Group

Friday, July 9th, 2010

Add group to user

usermod -a -G mygroup myuser

Change primary user group

usermod -g mygroup myuser

Source

Pics: 20 Free 3D icons

Thursday, July 8th, 2010

20 3D icons

20 3D icons

Font: Free Fonts

Thursday, July 8th, 2010

Friday Fresh Free Font
Friday Fresh Free Font

Professional Fonts

CSS: HTML5/CSS3 Nice Looking Button

Tuesday, July 6th, 2010
a.btn {
width: 250px;
padding: 10px 25px 10px 25px;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #ffffff;
text-shadow: -1px -1px 2px #618926;
background: -moz-linear-gradient(#98ba40, #a6c250 35%, #618926);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #98ba40),color-stop(.35, #a6c250),color-stop(1, #618926));
border: 1px solid #618926;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}

a.btn:hover {
width: 250px;
padding: 10px 25px 10px 25px;
font-family: Arial;
font-size: 16px;
text-decoration: none;
color: #ffffff;
text-shadow: -1px -1px 2px #465f97;
background: -moz-linear-gradient(#245192, #1e3b73 75%, #12295d);
background: -webkit-gradient(linear,left top,left bottom,color-stop(0, #245192),color-stop(.75, #1e3b73),color-stop(1, #12295d));
border: 1px solid #0f2557;
border-radius: 3px;
-moz-border-radius: 3px;
-webkit-border-radius: 3px;
}

CSS3 Button
Source: Create a CSS3 Call to Action Button