1
|
- Professor
- Ismael H F Santos – ismael@tecgraf.puc-rio.br
|
2
|
- Introduction to Apache Maven 2
- Tutorial ibm developerWorks:
- Introduction to Maven 2
- http://www.javaworld.com/javaworld/jw-12-2005/jw-12-2005-maven.html
|
3
|
- SCM – Introducao
- Subversion
- Maven SCM plugin
|
4
|
|
5
|
- Initialize
- Add Files
- Commit
- View History
- Share
- Update
- Revert
- Branch
|
6
|
|
7
|
- SVN Clients & Server
- SVN Repository
|
8
|
|
9
|
- Used by Many version control systems
- The repository allows only one person to change a file at a time.
- This exclusivity policy is managed using locks.
- Very restritive solution, lock related problems
|
10
|
- Subversion, CVS, and other version control systems use it
- Users can work in parallel, never waiting for one another.
- When people work on the same files, it turns out that most of their
concurrent changes don't overlap at all;
|
11
|
- conflicts are infrequent.
- the amount of time it takes to resolve conflicts is far less than the
time lost by a locking system.
|
12
|
|
13
|
- Open Source
- http://subversion.tigris.org/
- Designed for remote users
- Unreserved checkouts
- Similar to CVS
- Checkout, edit, merge, commit
|
14
|
- Many clients possible
- Command-line client (included)
- Windows GUI client (in process)
- Other clients (more GUIs, integration with IDEs, etc)
- Apache-based network server
- WebDAV-based network protocol
- High performance, scalable, secure, and more
|
15
|
- If it is great, then it could replace CVS
- Widespread usage would establish it as a legitimate tool
- More and better clients are possible
- Peer review and testing
- Community feedback and contributions
|
16
|
- Similar to CVS
- Unreserved instead of reserved
- Client-side working copies
- Four basic steps
- Check out a “working copy”
- Make any edits
- Merge changes from server
- Commit your changes
|
17
|
- Command-line client comes standard
- Windows client: TortoiseSVN
- Linux: GTK (X Windows) client
- Integration with IDEs: SubEclipse plugin
- WebDAV clients, too!
- Microsoft Windows, Office, and others
- Open source clients such as cadaver, Nautilus, and Goliat
|
18
|
- WebDAV (DeltaV) for the network protocol
- Apache 2.0 and mod_dav
- mod_dav_svn as glue to Subversion
- High performance, scalability, and robust
- SSL provides encryption and authentication
- Proxy/firewall friendly
|
19
|
- Most CVS features
- Directory versioning
- Metadata
- Atomic commits
- Branching and tagging are cheap
- Designed for the network
- Better binary file handling
- Layered library design
|
20
|
- Global revision number rather than per-file
- Allows you to talk about “revision 2524”
- Unique identifier for a state of your project
- Simple way to tag (next slide)
- Each revision corresponds to a single commit
- Contains author, log message, and date
|
21
|
- Subversion implements “cheap copies”
- Branches are just copies of the main trunk
- Make changes in the copy
- Merge the changes back to the main trunk
- Tags are copies which are never changed
- Might not even be necessary if you simply record the global revision
number that built your product
|
22
|
|
23
|
- CVS uses a custom authentication mechanism
- Part of CVS’s custom (non-standard) protocol
- “I LOVE YOU” or “I HATE YOU”
- pserver sends passwords in the clear
- Alternate authentication schemes
- kserver, gserver
- SSH tunneling
- Subversion uses HTTP as its protocol
- Integrates with existing authentication systems
- Standardized!
|
24
|
- CVS modules
- Live in CVSROOT
- The “modules” file
- Only the administrator can alter module definitions
- Only apply to checkout
- Changes are not detected during “cvs update”
- Subversion modules
- Directory property (“svn:externals”)
- Users can define them, edit them, inspect them
- Attach to any directory
- Versioned, as with any property
- Changes are detected during “svn update”
|
25
|
- CVS keywords are automatically expanded
- User must explicitly disable this behavior
- Risk of destroying a binary file
- Subversion keywords are optionally expanded
- User must proactively enable keyword expansion
- The user states the set of keywords to expand (some or all)
- The behavior is controlled by a property: svn:keywords
|
26
|
- Directories are versioned items
- Deletes and moves are recorded
- Copy sources are remembered
|
27
|
- Any file or directory can store properties
- Properties are name/value pairs
- Some standard properties exist
- svn:ignore
- svn:mime-type
- svn:eol-style
- etc.
- User-defined properties are allowed
- Property values can be text or binary
|
28
|
- Atomic commits
- CVS can commit one file, fail on the second
- Subversion commits all changes, or nothing
- Binary file handling
- Subversion uses MIME types
- Binary diffs
- Newline and keyword handling is improved
- Subversion does not munge your files until you tell it to
|
29
|
- Designed for the network
- CVS had network support “bolted on”
- Two code paths to maintain
- Authentication poorly integrated
- Subversion has network support (based on WebDAV/DeltaV) that was
planned from the very early stages
- Binary diffs in both directions
|
30
|
- Many levels for interaction
- High-level client
- Repository access (local, remote, pipe, etc)
- Direct access to the storage
- Enables scripting
- Clients can share a lot of code
- The command-line client is a small application built on top of the
high-level client library
- GUI clients can also use the high-level library
- Library-based enables third-parties
|
31
|
- Subversion uses URLs for repository locations
- http://svn.collab.net/repos/svn/ is the actual URL for Subversion
itself
- Web browsers can view the “head”
- Full ViewCVS-like functionality coming soon
- “file” URLs are also allowed for local access
- Example: file:///home/gstein/repos/testing/
|
32
|
- Creates a local working copy
|
33
|
- Commit changes to the repository
|
34
|
- Add new files and directories
|
35
|
- Simplify directory creation
|
36
|
- Quickly sets up a new repository directory
|
37
|
- Delete files and directories
|
38
|
- Delete items directly from the repository
- Great for removing obsolete tags or branches
|
39
|
- Retrieve changes made by other users
|
40
|
- Shows changes to the working copy
|
41
|
- Copy files and directories
- Source and destination can be working copies and/or direct repository
references
|
42
|
- Move files and directories
- The source and destination must both be working copy references, or
they must both be URLs
|
43
|
- Shows changes to the working copy
|
44
|
- Shows changes that have been committed
|
45
|
- Reverts changes made to a working copy
- Replaces CVS’s idiom of “rm file; cvs update file”
|
46
|
- Provide information about files / directories
|
47
|
- Five different commands for manipulating properties on files and
directories
|
48
|
- Merges changes from two sources/revisions into a target
|
49
|
|
50
|
- Cleans up conflict files left from a conflict during “svn update” or
“svn merge”
|
51
|
- Loads new content into a repository
|
52
|
- Just like a checkout, but the .svn administrative subdirectories are
omitted
|
53
|
- Switch a working copy to a branch
|
54
|
- cvs2svn
- ViewSVN
- Hook scripts
- Send commit emails
- Simple ACL support
- Simple reserved checkouts
- Repository backup
- Libraries, scripting, svnlook
|
55
|
|
56
|
|
57
|
- Manage External Dependencies
- Retrieve Source from SCM
- Build Artifacts
- Run Tests
- Package Artifacts (jar,war,zip,tar…)
- Generate Project Reports
- Create Website of Project Info
- Deploy Website and Distributions
- Extensible via Plugins
|
58
|
|
59
|
- Maven Provides a Plug-In Architecture for 3rd Party
Applications
- Check Style Description
- Development Tool for Java Programmers
- Flexible Enough to Support Any Standard
- Checks Coding Style and Coding Structure
- Optional Checks Include J2EE Requirements
|
60
|
|
61
|
- Seamlessly integrates Maven processes with your SCM repository.
- mvn scm:diff
- mvn scm:tag
- mvn scm:status
- Dozens of SCM systems supported.
|
62
|
- Seamlessly integrates Maven processes with your SCM repository.
- scm:branch - branch the project
- scm:validate - validate the scm information in the pom
- scm:add - command to add file
- scm:unedit - command to stop editing the working copy
- scm:export - command to get a fresh exported copy
- scm:bootstrap - command to checkout and build a project
- scm:changelog - command to show the source code revisions
- scm:list - command for get the list of project files
|
63
|
- The scm plugin maps a lot of commands to a variety of scm
implementations
- checkin - commit the changes to the remote repository (scm server).
- update - updates the local working copy with the one from the remote
repository (scm server).
|
64
|
- Configuration
- ...
- <scm>
- <connection>
- scm:svn:http://somerepository.com/svn_repo/trunk
- </connection>
- <developerConnection>
-
scm:svn:https://somerepository.com/svn_repo/trunk
- </developerConnection>
- <url>http://somerepository.com/view.cvs</url>
- </scm>
- ...
- </project>
- http://maven.apache.org/scm/maven-scm-plugin/usage.html
|
65
|
- Configuration
- ...
- <scm>
- <connection>
- scm:svn:http://somerepository.com/svn_repo/trunk
- </connection>
- <developerConnection>
-
scm:svn:https://somerepository.com/svn_repo/trunk
- </developerConnection>
- <url>http://somerepository.com/view.cvs</url>
- </scm>
- ...
- </project>
- http://maven.apache.org/scm/maven-scm-plugin/usage.html
|
66
|
- Bootstrapping a Project Using a POM
- http://maven.apache.org/scm/maven-scm-plugin/examples/bootstrapping-with-pom.html
- Other SCM Commands
- http://maven.apache.org/scm/maven-scm-plugin/examples/scm-advance-features.html
|