Why version control? This gives
us a history of a software project If we accidentally delete some code, we can look for an older version that still has the code We can see who made what changes Serves as a backup
Terminology Repository: a storage location
for projects that SVN will manage Checkout: to download a copy of a project from a repository Commit: to upload files to a repository after making changes Update: to download the latest versions of files from a repository when your local copies are out of date
Ant A software tool for
automating software build processes Similar to MAKE, but: Written in and developed primarily for Java Uses XML scripts
How Ant build files written?
Build-scripts are created from existing Ant-tasks. The Ant tasks do not prescribe any conventions or configuration. Therefore the definition of project layout is your responsibility. Advantage You have full control of whatever you are doing Disadvantage Can become a problem in bigger projects.
How to run Ant ?
Can be run from the command line By default the command line client looks for a build script build.xml in the current directory > ant To use a different build script, we have to specify it > ant -buildfile other.xml
Targets Build scripts contain targets,
the different jobs that they can performed We can specify the name of the target to run the specific target . > ant compile Note: If nothing specified will run the default target
What it Maven? Maven =
“Ant With Convention Over Configuration“ Directories Source, Tests, Resources Goals Clean, Test, Deploy, Package, Install, Site... But... you have to learn the conventions!
Maven Lifecycle validate Validate the
project is correct and all necessary information is available compile Compile the source code of the project test Test the compiled source code using a suitable unit testing framework. package Take the compiled code and package it in its distributable format, such as a JAR. verify Run any checks to verify the package is valid and meets quality criteria install Install the package into the local repository, for use as a dependency in other projects locally deploy Done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.
Create a project With the
archetype mvn archetype:generate -DarchetypeGroupId=org.apache.maven.archetypes -DgroupId=org.apache.meetup -DartifactId=calcualtor-app
Dependency management The real strength!
You only have to declare the dependencies – maven will download them setup the classpath and even deploy the dependencies with your application. Maven manages not only the direct dependencies - but even the dependencies of the dependecies (transitive dependencies)