Advertisement
NoSalt

CreateMavenDirs.sh

Apr 26th, 2012
53
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 1.25 KB | None | 0 0
  1. #!/bin/bash
  2. ################################################################################
  3. #
  4. # Name: createMavenDirs.sh
  5. #
  6. # Author: Brian Alston
  7. #
  8. # Date Created: 2010-12-29
  9. #
  10. # Description: This script will create all of the necessarry files and
  11. #              directories for a Maven project.
  12. #
  13. # Change Log: 2011-04-06 - Added the functionality to populate the pom.xml file.
  14. #                          "Variablized" some of the parameters.
  15. #
  16. ################################################################################
  17. if [ $# != 1 ] ; then
  18.     echo "Usage: createMavenDirs.sh name"
  19.     exit 1
  20. fi
  21. timestamp=`date +"%Y-%m-%d-%s"`
  22. projectName="${1}_${timestamp}"
  23. groupID="com.nosaltnetwork"
  24. version="0.1"
  25. pomFill="<?xml version=\"1.0\" encoding=\"UTF-8\"?>\n<project>\n\t<modelVersion>4.0.0</modelVersion>\n\t<groupId>${groupID}.${1}</groupId>\n\t<artifactId>${1}</artifactId>\n\t<name>\${artifactId}</name>\n\t<version>${version}</version>\n</project>"
  26.  
  27. clear
  28.  
  29. mkdir -p ${projectName}/src/{main/{java,resources/META-INF,filters,assembly,config,webapp/WEB-INF},test/{java,resources,filters},site}
  30. touch ${projectName}/{LICENSE,NOTICE,README}.txt
  31. touch ${projectName}/pom.xml
  32. echo -e ${pomFill} > ${projectName}/pom.xml
  33.  
  34. tree ${projectName}
  35.  
  36. exit 0
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement