manen ant svn
DESCRIPTION
TRANSCRIPT
![Page 1: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/1.jpg)
Apache build projects A practical session on Apache Maven, Ant and Subversion
By. S. Suhothayan & Prabath Abaysekara
![Page 2: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/2.jpg)
Subversion (SVN)
If more than one developer is working on a project - how can they all make changes to the source code...?
![Page 3: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/3.jpg)
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
![Page 4: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/4.jpg)
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
![Page 5: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/5.jpg)
How its done…
More than one developer is working on a
project...
from: OpenMRS
![Page 6: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/6.jpg)
How its done…
more than one developer to works on the same revision
file... and trying to commit at the same time!
from: OpenMRS
![Page 7: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/7.jpg)
How its done…
What if the changes are on the same line !!!
from: OpenMRS
![Page 8: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/8.jpg)
from: OpenMRS
![Page 9: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/9.jpg)
Ant
A software tool for automating software build processes
Similar to MAKE, but:
Written in and developed primarily for Java
Uses XML scripts
![Page 10: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/10.jpg)
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.
![Page 11: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/11.jpg)
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
![Page 12: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/12.jpg)
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
![Page 13: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/13.jpg)
Maven
A software project management and comprehension
tool.
![Page 14: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/14.jpg)
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!
![Page 15: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/15.jpg)
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.
![Page 16: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/16.jpg)
Create a project
With the archetype
mvn archetype:generate \
-DarchetypeGroupId=org.apache.maven.archetypes \
-DgroupId=org.apache.meetup \
-DartifactId=calcualtor-app
![Page 17: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/17.jpg)
Dependencies
Dependencies are uniquely identified by their
Group
Artifact
Version
Declare dependencies in the POM and the Maven will find
it for you!
![Page 18: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/18.jpg)
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)
![Page 19: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/19.jpg)
Maven Repositories
Repositories are used to host dependencies
1.Remote
The servers that hold released binaries
e.g. Artifactory, Nexus
2.Local
~/.m2/repository
![Page 20: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/20.jpg)
Maven Plugins
Reporting
Test Coverage (Sonar)
Javadoc auto-generation
CheckStyle
FindBugs
Ant
![Page 21: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/21.jpg)
Releasing your project
Single command to deploy
Pushing artifact to server
(Almost) Single Command To Release your project!
mvn release:prepare release:perform
![Page 22: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/22.jpg)
Demo
![Page 23: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/23.jpg)
Q & A
![Page 24: Manen Ant SVN](https://reader033.vdocuments.mx/reader033/viewer/2022050808/54c6a8bf4a795902368b4592/html5/thumbnails/24.jpg)
Thank You