Professional Documents
Culture Documents
Visit refcardz.com to browse and download the entire DZone Refcardz collection
brought to you by...
#98
Get More Refcardz! Visit refcardz.com
CONTENTS INCLUDE:
n
n
Repository Management
Repository Coordinates
Getting Started with
Maven Repository Management
n
Project Dependencies
n
Remote Repositories
n
Proxy Repositories
Hosted Repositories and more...
By Jason Van Zyl
n
Release Artifacts
These are specific, point-in-time releases. Released artifacts
are considered to be solid, stable, and perpetual in order to
guarantee that builds which depend upon them are repeatable
over time. Released JAR artifacts are associated with PGP
signatures and checksums verify both the authenticity and
integrity of the binary software artifact. The Central Maven
repository stores release artifacts.
Snapshot Artifacts
Snapshots capture a work in progress and are used during
development. A Snapshot artifact has both a version number
such as “1.3.0” or “1.3” and a timestamp. For example, a
snapshot artifact for commons-lang 1.3.0 might have the name
commons-lang-1.3.0-20090314.182342-1.jar.
Nexus Pro. After you fill out a simple registration form, a upper right-hand corner of the web page, and you should see
download link will be sent via email. the login dialog.
Installing Java
Nexus Open Source and Nexus Professional only have one
prerequisite, a Java Runtime Environment (JRE) compatible
with Java 5 or higher. To download the latest release of the Sun
JDK, go to http://developers.sun.com/downloads/.
RUNNING NEXUS To use Nexus, you will configure Maven to check Nexus instead
of the public repositories. To do this, you’ll need to edit your
When you start Nexus for the first time, it will be running mirror settings in your ~/.m2/settings.xml file.
on http://localhost:8081/nexus/. To start Nexus, find the
Update your Maven Settings
appropriate startup script for your platform in the
Place the following XML into a file named ~/.m2/settings.
${NEXUS_HOME}/bin/jsw directory.
xml. This Maven Settings file configures your Maven builds to
Starting Nexus fetch artifacts from the public group of the Nexus installation
The following example listing starts Nexus using the script for available at http://localhost:8081/nexus/
Mac OS X. The Mac OS X wrapper is started with a call to
<settings>
nexus start: <mirrors>
<mirror>
$ cd ~/nexus-webapp-1.6.0 <!--This sends everything else to /public -->
$ ls ./bin/jsw/ <id>nexus</id>
aix-ppc-32/ linux-ppc-64/ solaris-sparc-32/ <mirrorOf>*</mirrorOf>
aix-ppc-64/ linux-x86-32/ solaris-sparc-64/ <url>http://localhost:8081/nexus/content/groups/public</url>
hpux-parisc-32/ linux-x86-64/ solaris-x86-32/ </mirror>
hpux-parisc-64/ macosx-universal-32/ windows-x86-32/ </mirrors>
$ chmod -R a+x bin <profiles>
$ ./bin/jsw/macosx-universal-32/nexus start <profile>
Nexus Repository Manager... <id>nexus</id>
$ tail -f logs/wrapper.log <repositories>
INFO ... [ServletContainer:default] -SelectChannelConnector@0.0.0.0:8081 <repository>
<id>central</id>
<url>http://central</url>
Configuring Nexus as a Service <releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
When installing Nexus, you will often want to configure Nexus </repository>
</repositories>
as a service. To configure Nexus as a service on Windows: <pluginRepositories>
<pluginRepository>
(A) Open a Command Prompt <id>central</id>
<url>http://central</url>
(B) Change directories to C:/Program Files/nexus-webapp-1.6.0 <releases><enabled>true</enabled></releases>
<snapshots><enabled>true</enabled></snapshots>
(C) Change directories to bin/jsw/windows-x86-32 </pluginRepository>
(D) Run InstallNexus.bat to install Nexus as a Windows Service </pluginRepositories>
</profile>
(E) Run “net start nexus-webapp” to start the Nexus service </profiles>
<activeProfiles>
<!--make the profile active all the time -->
To configure Nexus as a service on Linux: <activeProfile>nexus</activeProfile>
</activeProfiles>
(A) Copy bin/jsw/$PLATFORM/nexus to /etc/init.d </settings>
DZone,
DZone, Inc.
Inc. || www.dzone.com
www.dzone.com
4
Getting Started with Maven Repository Management
<settings> Once you select Proxy Repository you will see the New Proxy
…
<servers> Repository form shown here:
<server>
<id>releases</id>
<username>deployment</username>
<password>deployment123</password>
</server>
<server>
<id>snapshots</id>
<username>deployment</username>
<password>deployment123</password>
</server>
</servers>
…
</settings>
PROXY REPOSITORIES If the remote index has been successfully downloaded and
processed, the Browse Index tab for the Maven Central
This section details working with Proxy Repositories. repository will display thousands of artifacts.
Nexus Professional is a central point of access to external For more information about Sonatype’s Nexus, see the
repositories which provides the necessary controls to make following resources:
sure that only approved artifacts enter into your software Free Nexus Book:
development environment. Central features of Nexus http://books.sonatype.com/nexus-book
Professional are:
Nexus OSS Site:
Nexus Procurement Suite: Gives Nexus administrators control http://nexus.sonatype.org
of what artifacts are allowed into an organization from a remote Nexus Pro Site:
repository. http://www.sonatype.com/products/nexus
Nexus Staging Suite: Provides workflow support for software
releases. Artifacts can be deployed to staging repositories, Participate in the Nexus Community
tested, and promoted only after they have been tested and Everyone is welcome to participate in the Nexus community
certified. as a developer or user. To participate, take advantage of the
following resources:
Hosting Project Web Sites: With Nexus Professional, you can
publish Maven project sites directly to your repository manager. Nexus IRC Channel:
#nexus on irc.codehaus.org:6667
Support for OSGi Repositories: Nexus Professional
supports OBR and P2 repositories used in OSGi and Eclipse Subscribe to the Nexus User Mailing List:
development. nexus-user-subscribe@sonatype.org
Subscribe to the Nexus Developer Mailing List:
Enterprise LDAP Support: Nexus Professional adds support
nexus-dev-subscribe@sonatype.org
for LDAP clustering, and supporting mixed authentication
configurations for multiple sources of security information Subscribe to the Nexus Pro User Mailing List:
including Atlassian’s Crowd server. nexus-pro-users-subscribe@sonatype.org
In addition to these features, Nexus Pro also adds support for Checkout Nexus Source Code from Subversion:
Artifact Bundles, Centralized Management of Maven Settings, http://svn.sonatype.org/nexus/trunk
Custom Repository Metadata, Self-serve User Account Sign-up, Browse the Nexus JIRA Project:
and Artifact Validation and Verification. https://issues.sonatype.org/browse/NEXUS
READ NOW
http://books.sonatype.com/nexus-book
#82
CONTENTS INCLUDE:
■
■
About Cloud Computing
Usage Scenarios Getting Started with
Aldon Cloud#64Computing
■
Underlying Concepts
Cost
by...
■
Upcoming Refcardz
youTechnologies ®
■
Data
t toTier
brough Comply.
borate.
Platform Management and more...
■
Chan
ge. Colla By Daniel Rubio
tion:
dz. com
tegra ternvasll
ABOUT CLOUD COMPUTING one time events. TEN TS
INC ■
HTML LUD E:
us Ind Anti-PPaat
Basics
Automated growthHTM
ref car
nuorn
■
Valid
ation one time events, cloud ML
connected to what is now deemed the ‘cloud’. Having the capability to support
Java EE Security
Usef
Du
ti
■
ul M.
computing platforms alsoulfacilitate
4 Open the gradual growth curves
n an
Page Source
o
■
s
Vis it
C
faced by web applications. Tools
Core
By Key ■
Elem
atte
has changed substantially in recent years, especially with Structur
E: al Elem ents
INC LUD gration
NTS
P the entrance of service providers like Amazon, Google and Large scale growth scenarios involvingents
specialized
and mor equipment
rdz !
HTML
CO NTE Microsoft. es e... away by
(e.g. load balancers and clusters) are all but abstracted
Continu at Every e chang
m
About ns to isolat
relying on a cloud computing platform’s technology.
Software i-patter
space
■
n
Re fca
e Work
Build
riptio
and Ant
Desc
These companies have a Privat
are in long deployed
trol repos
itory
webmana applications
ge HTM
L BAS
■
Build
re
Repo
This Refcard active
will introduce are within
to you to cloud riente computing, with an
d units
RATION etc. Some platforms ram support large grapRDBMS deployments.
■
The src
dy Ha
softw
e ine loping and Java s written in hical on of
INTEG attribute
task-o it all
softwar emphasis onDeve es by
Mainl these
ines providers, so youComm can better understand
also rece JavaScri user interfac web develop and the rris
Vis it
OUS
Network Security
codel chang desc
ding e code Task Level as the
www.dzone.com
Subversion
reposit ed via particu tions that e Pay only cieswhat you consume you cho platform fine. b></ ed insid
anti-pa Amazon’s cloud computing
the curr isome
heavily basedmoron
tagge or
lain the nden For each (e.g. WAR es t
ent stan ose to writ more e imp a></ e
not lega each othe
and x” solu b> is
be exp text) to “fi are duc al Depe
Web application deployment ge until
nden a few years
t librari agonmen
t enviro was similar that will softwaredard
industry standard and virtualization app
e HTM technology.
ortant,
tterns to pro Minim packa
Mo re
CI can ticular con used can rity all depe all targe
s will L or XHT arent. Reg the HTM l, but r. Tags
etimes Anti-pa they
tend
es, but to most phone services:
y Integ alizeplans with le that
late fialloted resources, ts with an and XHT simplify all help ML, und ardless
L VS
XHTM <a><
in a par hes som
Centr
end,
Binar
pro cess. the practic enti ng incurred costgeme
nt
whether sucha single
temp
resources on
were consumed
enviro
nmen
orthenot. Virtualization ML your
othe
you prov
erstand of L
b></
in e t muchallows aare physical piece ofr hardware ideto be HTML
rily bad cy Mana based
approac ed with the cial, but, implem
Creat
rties are nt targe es to actually web cod a solid
nden
into differe
of the ing has
necessa pared to
chang
efi Depe prope itting utilized by multiple operating
function systems.simplerThis allows ing.resourcesfoundati job adm been arou
associat to be ben
er
Ge t
te builds commo
are not Fortuna
late Verifi e comm than on
n com Cloud computing asRun it’sremo
known etoday has changed this.
befor alitytohas irably, nd for
They they
etc.
Temp Build (e.g. bandwidth, memory,
n elem CPU) be allocated exclusively totely exp that job som
lts whe
ually,
appear effects. rm a
Privat y, contin nt team Every mov
entsinstances. ed to CSS
used
to be, HTML
ected.
has exp e time. Whi
ed resu tion The various resourcesPerfo consumed by webperio applications
dicall (e.g.
opme pag
individual operating system because Brow Early
adverse unintend Integra
d Builds sitory Build r to devel common e (HTML . ser HTM anded le it has
web dev manufacture L had very
Stage Repo
e ous bandwidth, memory, CPU) are tallied
Integ
ration on a per-unit CI serve basis or XHT far done
duc extensio .) All are limited more than
an
Continu Refcard
Build from
e.com
DZone, Inc.
Cloud Computing
the not
s on
expand
ISBN-13: 978-1-934238-98-1
140 Preston Executive Dr. ISBN-10: 1-934238-98-8
Suite 100
50795
Cary, NC 27513