Frequently Used Maven Commands

Frequently used Maven commands

# Command to Clean any previously build code
mvn clean

# Command to install
mvn install

# If you are behind a proxy then add this in the $USER_HOME/.me/settings.xml
<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>http</protocol>
      <host>myproxyhost.com</host>
      <port>1234</port>
    </proxy>
  </proxies>
</settings>

# And for HTTPS traffic use this in the command line
mvn install -Dhttps.proxyHost="myproxyhost.com" -Dhttps.proxyPort="1234"

# For offline building (i.e. if you think you have all the required dependencies)
mvn –o install

# Command to install without executing unit tests
mvn install -Dmaven.test.skip=true

# Command to install but using a specific profile
mvn clean install -Ptomcat

# Command to use the Cargo Deploy plugin
mvn cargo:deploy

# Command to perform the release of a module
mvn -Dresume=false release:prepare release:perform

# Command to continue a release that stopped in the middile
mvn -Dresume=true release:prepare release:perform

# Command to do a Dryrun release
mvn release:prepare -DdryRun=true

# If SCM interactions are involved then below option can be used to provide a SCM Comment prefix
mvn -Dresume=false release:prepare release:perform -DscmCommentPrefix="Mvn Release 1.0:"

# Not all jar files are available in the Maven repository.
# Command to Upload a missing artifact jar into a local repository
mvn deploy:deploy-file -DgroupId=net.sf -DartifactId=jcsc -Dversion=0.98.1 -Dpackaging=jar -Dfile=JCSC.jar -DrepositoryId=thirdparty-jars -Durl=http://mavenrepo.comp.com/nexus/content/repositories/thirdparty-jars

# Command to create a maven project from an Artifact
mvn archetype:create -DgroupId=com.mycompany.myapp -DartifactId=basic-webapp -DarchetypeGroupId=org.apache.maven.archetypes -DarchetypeArtifactId=maven-archetype-webapp -DremoteRepositories=http://repo1.maven.org/maven2

# Command to check the version of maven plugin being used
mvn -Dplugin=install help:describe -Ddetail

# Command to Generate dependency tree
mvn dependency:tree -Doutput=dep-tree.txt

# List all dependencies of this project
mvn dependency:list

# Command to generate Site documentation
mvn site:site

# Commands to generate specific reports
mvn site:site -DgenerateReports=false -Dmaven.test.skip=true
mvn project-info-reports:summary -Dmaven.test.skip=true
mvn project-info-reports:scm project-info-reports:issue-tracking project-info-reports:index -Dmaven.test.skip=true

# Commands for various other reports
mvn taglist:taglist
mvn javancss:report
mvn dashboard:dashboard
mvn jdepend:generate
mvn changes:changes-report
mvn changes:jira-report

yum install MySQL - Remote Access

This post explains all the steps needed to install Mysql on Linux(RedHat, CentOS, Fedora) and configure it to access db from remote machines.

Install Mysql Client
$ yum install mysql

Install Mysql Server
$ yum install mysql-server

Upgrade Mysql Installation
$ mysql_upgrade

Login as root user
$ mysql -u root
mysql>

List the grants this user has
mysql> SHOW GRANTS;

Grant all privileges to login as root from any remote machine
mysql> GRANT ALL PRIVILEGES ON *.* TO 'root'@'%' IDENTIFIED BY 'password' WITH GRANT OPTION


APSRTC Online Booking - comments

Finally APSRTC started Online Ticket Booking.

http://www.apsrtc.in/APSRTCOnline

Application's response is pretty fast (may be because there is no traffic?)
My observations:
* There is no SSL during login, hope their payment gateway is secure.
* Its a struts based Java app running on IBM Websphere
* Left the default apps running: http://www.apsrtc.in/hitcount
* Developers dont know the difference between HTML comments and JSP comments. View source of the home page shows lot of commented HTML code.
* Uses struts validator framework for validations on serverside and client side. Smart way to avoid load on the server and do all validations on client first.
* While searching for From and To location, just enter % and you get all locations.

Enhance Google Reader

Enhance/Customize the appearance of Google Reader with the below Firefox plugins.

http://userscripts.org/scripts/show/12917 (Need Grease Monkey plugin)
http://userscripts.org/scripts/show/26859 (Need Grease Monkey plugin)
https://addons.mozilla.org/en-US/firefox/addon/748 (Grease Monkey)
https://addons.mozilla.org/en-US/firefox/addon/6424/ (Better GReader)