Added: dev/buildr/1.5.0/site/packaging.html
==============================================================================
--- dev/buildr/1.5.0/site/packaging.html (added)
+++ dev/buildr/1.5.0/site/packaging.html Sat Sep 17 06:18:39 2016
@@ -0,0 +1,423 @@
+<html>
+  <head>
+    <meta content='text/html;charset=UTF-8' http-equiv='Content-Type'>
+    <title>buildr &mdash; Packaging</title>
+    <style type='text/css'>
+      @import 'css/default.css';
+      @import 'css/syntax.css';
+    </style>
+    <style media='print' type='text/css'>
+      @import 'css/print.css';
+    </style>
+    <meta content='Official Buildr documentation from the people in the know' 
name='subject'>
+    <link href='images/favicon.png' rel='shortcut icon'>
+  </head>
+  <body>
+    <div id='wrap'>
+      <div id='header'>
+        <a href='http://buildr.apache.org/' title="Build like you code"><img 
alt='buildr' src='images/buildr.png'></a>
+        <div class='tagline'>Build like you code</div>
+      </div>
+      <div id='pages'>
+        <ol class='toc'>
+          <li>Start Here
+            <ol class="toc">
+              <li><a href='index.html'>Welcome</a></li>
+              <li><a href='quick_start.html'>Quick Start</a></li>
+              <li><a href='installing.html'>Installing & Running</a></li>
+              <li><a 
href='http://cwiki.apache.org/confluence/display/BUILDR/Index'>Community 
Wiki</a></li>
+            </ol>
+          </li>
+          <li>Using Buildr
+            <ol class="toc">
+              <li><a href='buildr.pdf'>This Guide (PDF)</a></li>
+              <li><a href='projects.html'>Projects</a></li>
+              <li><a href='building.html'>Building</a></li>
+              <li><a href='artifacts.html'>Artifacts</a></li>
+              <li><a href='packaging.html'>Packaging</a></li>
+              <li><a href='testing.html'>Testing</a></li>
+              <li><a href='releasing.html'>Releasing</a></li>
+              <li><a href='settings_profiles.html'>Settings/Profiles</a></li>
+              <li><a href='languages.html'>Languages</a></li>
+              <li><a href='more_stuff.html'>More Stuff</a></li>
+              <li><a href='extending.html'>Extending Buildr</a></li>
+              <li><a 
href='http://cwiki.apache.org/confluence/display/BUILDR/Buildr+HowTos'>How-Tos</a></li>
+            </ol>
+          </li>
+          <li>Reference
+            <ol class="toc">
+              <li><a href='rdoc/Buildr.html'>API</a></li>
+              <li><a href='http://docs.rubyrake.org'>Rake</a></li>
+              <li><a href='https://rubygems.org/gems/Antwrap'>Antwrap</a></li>
+              <li><a 
href='http://cwiki.apache.org/confluence/display/BUILDR/Common+Problems+and+Solutions'>Troubleshooting</a></li>
+            </ol>
+          </li>
+          <li>Get Involved
+            <ol class="toc">
+              <li><a href='download.html'>Download</a></li>
+              <li><a href='mailing_lists.html'>Mailing Lists</a></li>
+              <li><a href='http://www.twitter.com/buildr'>Twitter</a></li>
+              <li><a 
href='http://issues.apache.org/jira/browse/Buildr'>Issues/Bugs</a></li>
+              <li><a href='https://builds.apache.org/view/A-F/view/Buildr'>CI 
Jobs</a></li>
+              <li><a href='contributing.html'>Contributing</a></li>
+            </ol>
+          </li>
+          <li>
+            <form action='http://www.google.com/' 
onsubmit="document.getElementById('gQuery').value += ' site:buildr.apache.org'">
+              <input name='q' size='20' type='text' id='gQuery'>
+              <input name='sa' type='submit' value='Search'>
+              <img alt='Google Custom Search' 
src='http://www.google.com/coop/images/google_custom_search_smnar.gif'>
+            </form>
+          </li>
+        </ol>
+      </div>
+      <div id='content'>
+        <h1 id='packaging'>Packaging</h1>
+        <ol class="toc"><li><a href="#referencing">Specifying And Referencing 
Packages</a></li><li><a href="#zip">Packaging ZIPs</a></li><li><a 
href="#jar">Packaging JARs</a></li><li><a href="#war">Packaging 
WARs</a></li><li><a href="#aar">Packaging AARs</a></li><li><a 
href="#ear">Packaging EARs</a></li><li><a href="#bundle">Packaging OSGi 
Bundles</a></li><li><a href="#tar">Packaging Tars and GZipped 
Tars</a></li><li><a href="#install_upload">Installing and 
Uploading</a></li><li><a href="#source_javadoc">Packaging Sources and 
JavaDocs</a></li></ol>
+        <p>For our next trick, we&#8217;re going to try and create an artifact 
ourselves.  We&#8217;re going to start with:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span> <span 
class="ss">:jar</span></code></pre></figure><p>We just told the project to 
create a <span class="caps">JAR</span> file in the <code>target</code> 
directory, including all the classes (and resources) that we previously 
compiled into <code>target/classes</code>.  Or we can create a <span 
class="caps">WAR</span> file:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span> <span 
class="ss">:war</span></code></pre></figure><p>The easy case is always easy, 
but sometimes we have more complicated use cases which we&#8217;ll address 
through the rest of this section.</p>
+<p>Now let&#8217;s run the build, test cases and create these packages:</p>
+<figure class="highlight"><pre><code class="language-sh" data-lang="sh"><span 
class="nv">$ </span>buildr package</code></pre></figure><p>The 
<code>package</code> task runs the <code>build</code> task (remember: 
<code>compile</code> and <code>test</code>) and then runs each of the packaging 
tasks, creating packages in the projects&#8217; target directories.</p>
+<p class="tip">The <code>package</code> task and <code>package</code> methods 
are related, but that relation is different from other task/method pairs.  The 
<code>package</code> method creates a file task that points to the package in 
the <code>target</code> directory and knows how to create it.  It then adds 
itself as a prerequisite to the <code>package</code> task. Translation: you can 
create multiple packages from the same project.</p>
+<h2 id="referencing">Specifying And Referencing Packages</h2>
+<p>Buildr supports several packaging types, and so when dealing with packages, 
you have to indicate the desired package type.  The packaging type can be the 
first argument, or the value of the <code>:type</code> argument.  The following 
two are equivalent:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span> <span class="ss">:jar</span>
+<span class="n">package</span> <span class="ss">:type</span><span 
class="o">=&gt;</span><span class="ss">:jar</span></code></pre></figure><p>If 
you do not specify a package type, Buildr will attempt to infer one.</p>
+<p>In the documentation you will find a number of tasks dealing with specific 
packaging types (<code>ZipTask</code>, <code>JarTask</code>, etc).  The 
<code>package</code> method is a convenience mechanism that sets up the package 
for you associates it with various project life cycle tasks.</p>
+<p>To package a particular file, use the <code>:file</code> argument, for 
example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span> <span 
class="ss">:zip</span><span class="p">,</span> <span 
class="ss">:file</span><span class="o">=&gt;</span><span 
class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/interesting.zip&#39;</span><span 
class="p">)</span></code></pre></figure><p>This returns a file task that will 
run as part of the project&#8217;s <code>package</code> task (generating all 
packages).  It will invoke the <code>build</code> task to generate any 
necessary prerequisites, before creating the specified file.</p>
+<p>The package type does not have to be the same as the file name extension, 
but if you don&#8217;t specify the package type, it will be inferred from the 
extension.</p>
+<p>Most often you will want to use the second form to generate packages that 
are also artifacts.  These packages have an artifact specification, which you 
can use to reference them from other projects (and buildfiles).  They are also 
easier to share across projects: artifacts install themselves in the local 
repository when running the <code>install</code> task, and upload to the remote 
repository when running the <code>upload</code> task (see <a 
href="#install_upload">Installing and Uploading</a>).</p>
+<p>The artifact specification is based on the project name (using dashes 
instead of colons), group identifier and version number, all three obtained 
from the project definition.  You can specify different values using the 
<code>:id</code>, <code>:group</code>, <code>:version</code> and 
<code>:classifier</code> arguments.  For example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">define</span> <span 
class="s1">&#39;killer-app&#39;</span><span class="p">,</span> <span 
class="ss">:version</span><span class="o">=&gt;</span><span 
class="s1">&#39;1.0&#39;</span> <span class="k">do</span>
+  <span class="c1"># Generates silly-1.0.jar</span>
+  <span class="n">package</span> <span class="ss">:jar</span><span 
class="p">,</span> <span class="ss">:id</span><span class="o">=&gt;</span><span 
class="s1">&#39;silly&#39;</span>
+
+  <span class="c1"># Generates killer-app-la-web-1.x.war</span>
+  <span class="n">project</span> <span class="s1">&#39;la-web&#39;</span> 
<span class="k">do</span>
+    <span class="n">package</span> <span class="ss">:war</span><span 
class="p">,</span> <span class="ss">:version</span><span 
class="o">=&gt;</span><span class="s1">&#39;1.x&#39;</span>
+  <span class="k">end</span>
+
+  <span class="c1"># Generates killer-app-the-api-1.0-sources.zip</span>
+  <span class="n">project</span> <span class="s1">&#39;teh-api&#39;</span> 
<span class="k">do</span>
+    <span class="n">package</span> <span class="ss">:zip</span><span 
class="p">,</span> <span class="ss">:classifier</span><span 
class="o">=&gt;</span><span class="s1">&#39;sources&#39;</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><p>The file name is determined 
from the identifier, version number, classifier and extension associated with 
that packaging type.</p>
+<p>If you do not specify the packaging type, Buildr attempt to infer it from 
the project definition.  In the general case it will use the default packaging 
type, <span class="caps">ZIP</span>.  A project that compiles Java classes will 
default to <span class="caps">JAR</span> packaging; for other languages, 
consult the specific documentation.</p>
+<p>A single project can create multiple packages.  For example, a Java project 
may generate a <span class="caps">JAR</span> package for the runtime library 
and another <span class="caps">JAR</span> containing just the <span 
class="caps">API</span>; a <span class="caps">ZIP</span> file for the source 
code and another <span class="caps">ZIP</span> for the documentation. Make sure 
to always call <code>package</code> with enough information to identify the 
specific package you are referencing.  Even if the project only defines a 
single package, calling the <code>package</code> method with no arguments does 
not necessarily refer to that one.</p>
+<p>You can use the <code>packages</code> method to obtain a list of all 
packages defined in the project, for example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">project</span><span class="p">(</span><span 
class="s1">&#39;killer-app:teh-impl&#39;</span><span class="p">)</span><span 
class="o">.</span><span class="n">packages</span><span class="o">.</span><span 
class="n">first</span>
+<span class="n">project</span><span class="p">(</span><span 
class="s1">&#39;killer-app:teh-impl&#39;</span><span class="p">)</span><span 
class="o">.</span><span class="n">packages</span><span class="o">.</span><span 
class="n">select</span> <span class="p">{</span> <span class="o">|</span><span 
class="n">pkg</span><span class="o">|</span> <span class="n">pkg</span><span 
class="o">.</span><span class="n">type</span> <span class="o">==</span> <span 
class="ss">:zip</span> <span class="p">}</span></code></pre></figure><h2 
id="zip">Packaging ZIPs</h2>
+<p><span class="caps">ZIP</span> is the most common form of packaging, used by 
default when no other packaging type applies.  It also forms the basis for many 
other packaging types (e.g. <span class="caps">JAR</span> and <span 
class="caps">WAR</span>).  Most of what you&#8217;ll find here applies to other 
packaging types.</p>
+<p>Let&#8217;s start by including additional files in the <span 
class="caps">ZIP</span> package.  We&#8217;re going to include the 
<code>target/docs</code> directory and <code>README</code> file:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs&#39;</span><span class="p">),</span> <span 
class="s1">&#39;README&#39;</span></code></pre></figure><p>The 
<code>include</code> method accepts files, directories and file tasks.  You can 
also use file pattern to match multiple files and directories.  File patterns 
include asterisk (<code>*</code>) to match any file name or part of a file 
name, double asterisk (<code>**</code>) to match directories recursively, 
question mark (<code>?</code>) to match any character, square braces 
(<code>[]</code>) to match a set of characters, and curly braces 
(<code>{}</code>) to match one of several names.</p>
+<p>And the same way you <code>include</code>, you can also 
<code>exclude</code> specific files you don&#8217;t want showing up in the 
<span class="caps">ZIP</span>.  For example, to exclude <code>.draft</code> and 
<code>.raw</code> files:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span><span class="p">(</span><span class="n">_</span><span 
class="p">(</span><span class="s1">&#39;target/docs&#39;</span><span 
class="p">))</span><span class="o">.</span><span class="n">exclude</span><span 
class="p">(</span><span class="s1">&#39;*.draft&#39;</span><span 
class="p">,</span> <span class="s1">&#39;*.raw&#39;</span><span 
class="p">)</span></code></pre></figure><p>So far we&#8217;ve included files 
under the root of the <span class="caps">ZIP</span>.  Let&#8217;s include some 
files under a given path using the <code>:path</code> option:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs&#39;</span><span class="p">),</span> <span 
class="ss">:path</span><span class="o">=&gt;</span><span 
class="s2">&quot;</span><span class="si">#{</span><span 
class="nb">id</span><span class="si">}</span><span class="s2">-</span><span 
class="si">#{</span><span class="n">version</span><span 
class="si">}</span><span class="s2">&quot;</span></code></pre></figure><p>If 
you need to use the <code>:path</code> option repeatedly, consider using the 
<code>tap</code> method instead.  For example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">path</span><span class="p">(</span><span 
class="s2">&quot;</span><span class="si">#{</span><span 
class="nb">id</span><span class="si">}</span><span class="s2">-</span><span 
class="si">#{</span><span class="n">version</span><span 
class="si">}</span><span class="s2">&quot;</span><span class="p">)</span><span 
class="o">.</span><span class="n">tap</span> <span class="k">do</span> <span 
class="o">|</span><span class="n">path</span><span class="o">|</span>
+  <span class="n">path</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs&#39;</span><span class="p">)</span>
+  <span class="n">path</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;README&#39;</span><span class="p">)</span>
+<span class="k">end</span></code></pre></figure><p class="tip">The 
<code>tap</code> method is not part of the core library, but a very useful 
extension.  It takes an object, yields to the block with that object, and then 
returns that object.</p>
+<p class="note">To allow you to spread files across different paths, the 
include/exclude patterns are specific to a path.  So in the above example, if 
you want to exclude some files from the &#8220;target/docs&#8221; directory, 
make sure to call <code>exclude</code> on the path, not on the <span 
class="caps">ZIP</span> task itself.</p>
+<p>If you need to include a file or directory under a different name, use the 
<code>:as</code> option.  For example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span><span class="p">(</span><span class="n">_</span><span 
class="p">(</span><span 
class="s1">&#39;corporate-logo-350x240.png&#39;</span><span class="p">),</span> 
<span class="ss">:as</span><span class="o">=&gt;</span><span 
class="s1">&#39;logo.png&#39;</span><span 
class="p">)</span></code></pre></figure><p>You can also use 
<code>:as=&gt;'.'</code> to include all files from the given directory.  For 
example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs/*&#39;</span><span class="p">)</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs&#39;</span><span class="p">),</span> <span 
class="ss">:as</span><span class="o">=&gt;</span><span 
class="s1">&#39;.&#39;</span></code></pre></figure><p>These two perform 
identically.  They both include all the files from the <code>target/docs</code> 
directory, but not the directory itself, and they are both lazy, meaning that 
the files can be created later and they will still get packaged into the zip 
package.</p>
+<p>For example, when you use <code>package :jar</code>, under the hood it 
specifies to include all the files from <code>target/classes</code> with 
<code>:as=&gt;'.'</code>.  Even though this happens during project definition 
and nothing has been compiled yet (and in fact <code>target/classes</code> may 
not even exist yet), the .class files generated during compilation are still 
packaged in the .jar file, as expected.</p>
+<p>If you need to get rid of all the included files, call the 
<code>clean</code> method. Some packaging types default to adding various files 
and directories, for example, <span class="caps">JAR</span> packaging will 
include all the compiled classes and resources.</p>
+<p>You can also merge two <span class="caps">ZIP</span> files together, 
expanding the content of one <span class="caps">ZIP</span> into the other.  For 
example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">merge</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;part1.zip&#39;</span><span class="p">),</span> <span 
class="n">_</span><span class="p">(</span><span 
class="s1">&#39;part2.zip&#39;</span><span 
class="p">)</span></code></pre></figure><p>If you need to be more selective, 
you can apply the include/exclude pattern to the expanded <span 
class="caps">ZIP</span>.  For example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># Everything but the libs</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:zip</span><span class="p">)</span><span class="o">.</span><span 
class="n">merge</span><span class="p">(</span><span class="n">_</span><span 
class="p">(</span><span class="s1">&#39;bigbad.war&#39;</span><span 
class="p">))</span><span class="o">.</span><span class="n">exclude</span><span 
class="p">(</span><span class="s1">&#39;libs/**/*&#39;</span><span 
class="p">)</span></code></pre></figure><h2 id="jar">Packaging JARs</h2>
+<p><span class="caps">JAR</span> packages extend <span class="caps">ZIP</span> 
packages with support for Manifest files and the <span 
class="caps">META</span>-<span class="caps">INF</span> directory.  They also 
default to include the class files found in the <code>target/classes</code> 
directory.</p>
+<p>You can tell the <span class="caps">JAR</span> package to include a 
particular Manifest file:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:jar</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span> <span class="ss">:manifest</span><span 
class="o">=&gt;</span><span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;src/main/MANIFEST.MF&#39;</span><span 
class="p">)</span></code></pre></figure><p>Or generate a manifest from a 
hash:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:jar</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span> <span class="ss">:manifest</span><span 
class="o">=&gt;</span><span class="p">{</span> <span 
class="s1">&#39;Copyright&#39;</span><span class="o">=&gt;</span><span 
class="s1">&#39;Acme Inc (C) 2007&#39;</span> <span 
class="p">}</span></code></pre></figure><p>You can also generate a <span 
class="caps">JAR</span> with no manifest with the value <code>false</code>, 
create a manifest with several sections using an array of hashes, or create it 
from a proc.</p>
+<p>In large projects, where all the packages use the same manifest, it&#8217;s 
easier to set it once on the top project using the <code>manifest</code> 
project property. Sub-projects inherit the property from their parents, and the 
<code>package</code> method uses that property if you don&#8217;t override it, 
as we do above.</p>
+<p>For example, we can get the same result by specifying this at the top 
project:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">manifest</span><span class="o">[</span><span 
class="s1">&#39;Copyright&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span class="s1">&#39;Acme Inc (C) 
2007&#39;</span></code></pre></figure><p>If you need to mix-in the 
project&#8217;s manifest with values that only one package uses, you can do so 
easily:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:jar</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span> <span class="ss">:manifest</span><span 
class="o">=&gt;</span><span class="n">manifest</span><span 
class="o">.</span><span class="n">merge</span><span class="p">(</span><span 
class="s1">&#39;Main-Class&#39;</span><span class="o">=&gt;</span><span 
class="s1">&#39;com.acme.Main&#39;</span><span 
class="p">)</span></code></pre></figure><p>If you need to include more files in 
the <code>META-INF</code> directory, you can use the <code>:meta_inf</code> 
option.  You can give it a file, or array of files.  And yes, there is a 
<code>meta_inf</code> project property you can set once to include the same set 
of file in all the JARs.  It works like this:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">meta_inf</span> <span 
class="o">&lt;&lt;</span> <span class="n">file</span><span 
class="p">(</span><span class="s1">&#39;DISCLAIMER&#39;</span><span 
class="p">)</span> <span class="o">&lt;&lt;</span> <span 
class="n">file</span><span class="p">(</span><span 
class="s1">&#39;NOTICE&#39;</span><span 
class="p">)</span></code></pre></figure><p>If you have a <code>LICENSE</code> 
file, it&#8217;s already included in the <code>meta_inf</code> list of 
files.</p>
+<p>Other than that, <code>package :jar</code> includes the contents of the 
compiler&#8217;s target directory and resources, which most often is exactly 
what you intend it to do. If you want to include other files in the <span 
class="caps">JAR</span>, instead or in addition, you can do so using the 
<code>include</code> and <code>exclude</code> methods.  If you do not want the 
target directory included in your <span class="caps">JAR</span>, simply call 
the <code>clean</code> method on it:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:jar</span><span class="p">)</span><span class="o">.</span><span 
class="n">clean</span><span class="o">.</span><span 
class="n">include</span><span class="p">(</span> <span 
class="n">only_these_files</span> <span 
class="p">)</span></code></pre></figure><h2 id="war">Packaging WARs</h2>
+<p>Pretty much everything you know about JARs works the same way for WARs, so 
let&#8217;s just look at the differences.</p>
+<p>Without much prompting, <code>package :war</code> picks the contents of the 
<code>src/main/webapp</code> directory and places it at the root of the <span 
class="caps">WAR</span>, copies the compiler target directory into the 
<code>WEB-INF/classes</code> path, and copies any compiled dependencies into 
the <code>WEB-INF/libs</code> paths.</p>
+<p>Again, you can use the <code>include</code> and <code>exclude</code> 
methods to change the contents of the <span class="caps">WAR</span>.  There are 
two convenience options you can use to make the more common changes.  If you 
need to include a classes directory other than the default:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:war</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span> <span class="ss">:classes</span><span 
class="o">=&gt;</span><span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/additional&#39;</span><span 
class="p">)</span></code></pre></figure><p>If you want to include a different 
set of libraries other than the default:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:war</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span> <span class="ss">:libs</span><span 
class="o">=&gt;</span><span 
class="no">MYSQL_JDBC</span></code></pre></figure><p>Both options accept a 
single value or an array.  The <code>:classes</code> option accepts the name of 
a directory containing class files, initially set to 
<code>compile.target</code> and <code>resources.target</code>.  The 
<code>:libs</code> option accepts artifact specifications, file names and 
tasks, initially set to include everything in 
<code>compile.dependencies</code>.</p>
+<p>As you can guess, the package task has two attributes called 
<code>classes</code> and <code>libs</code>; the <code>with</code> method merely 
sets their value.  If you need more precise control over these arrays, you can 
always work with them directly, for example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># Add an artifact to the existing set:</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:war</span><span class="p">)</span><span class="o">.</span><span 
class="n">libs</span> <span class="o">+=</span> <span 
class="n">artifacts</span><span class="p">(</span><span 
class="no">MYSQL_JDBC</span><span class="p">)</span>
+<span class="c1"># Remove an artifact from the existing set:</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:war</span><span class="p">)</span><span class="o">.</span><span 
class="n">libs</span> <span class="o">-=</span> <span 
class="n">artifacts</span><span class="p">(</span><span 
class="no">LOG4J</span><span class="p">)</span>
+<span class="c1"># List all the artifacts:</span>
+<span class="nb">puts</span> <span class="s1">&#39;Artifacts included in WAR 
package:&#39;</span>
+<span class="nb">puts</span> <span class="n">package</span><span 
class="p">(</span><span class="ss">:war</span><span class="p">)</span><span 
class="o">.</span><span class="n">libs</span><span class="o">.</span><span 
class="n">map</span><span class="p">(</span><span class="o">&amp;</span><span 
class="ss">:to_spec</span><span class="p">)</span></code></pre></figure><h3 
id="war_extra_assets">Compiling Assets</h3>
+<p>In modern web applications, it is common to use tools that compile and 
compress assets. i.e. <a href="http://coffeescript.org/";>Coffeescript</a> is 
compiled into javascript and <a href="http://sass-lang.com/";>Sass</a> compiles 
into <span class="caps">CSS</span>. Buildr provides support using a simple 
<code>assets</code> abstraction. Directory or file tasks can be added to the 
<code>assets.paths</code> configuration variable for a project and the contents 
will be included in the package.</p>
+<h4 id="coffeescript">Integrating CoffeeScript</h4>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">target_dir</span> <span class="o">=</span> 
<span class="n">_</span><span class="p">(</span><span 
class="ss">:target</span><span class="p">,</span> <span 
class="ss">:generated</span><span class="p">,</span> <span 
class="s2">&quot;coffee/main/webapp&quot;</span><span class="p">)</span>
+<span class="n">source_dir</span> <span class="o">=</span> <span 
class="n">_</span><span class="p">(</span><span class="ss">:source</span><span 
class="p">,</span> <span class="ss">:main</span><span class="p">,</span> <span 
class="ss">:coffee</span><span class="p">)</span>
+
+<span class="n">assets</span><span class="o">.</span><span 
class="n">paths</span> <span class="o">&lt;&lt;</span> <span 
class="n">file</span><span class="p">(</span><span class="n">target_dir</span> 
<span class="o">=&gt;</span> <span class="o">[</span><span 
class="no">FileList</span><span class="o">[</span><span 
class="s2">&quot;</span><span class="si">#{</span><span 
class="n">source_dir</span><span class="si">}</span><span 
class="s2">/**/*.coffee&quot;</span><span class="o">]]</span><span 
class="p">)</span> <span class="k">do</span>
+  <span class="nb">puts</span> <span class="s2">&quot;Compiling 
coffeescript&quot;</span>
+  <span class="n">sh</span> <span class="s2">&quot;coffee --bare --compile 
--output </span><span class="si">#{</span><span 
class="n">target_dir</span><span class="si">}</span><span class="s2"> 
</span><span class="si">#{</span><span class="n">source_dir</span><span 
class="si">}</span><span class="s2">&quot;</span>
+  <span class="n">touch</span> <span class="n">target_dir</span>
+<span class="k">end</span></code></pre></figure><h4 id="sass">Integrating 
Sass</h4>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">target_dir</span> <span class="o">=</span> 
<span class="n">_</span><span class="p">(</span><span 
class="ss">:target</span><span class="p">,</span> <span 
class="ss">:generated</span><span class="p">,</span> <span 
class="s2">&quot;sass/main/webapp&quot;</span><span class="p">)</span>
+<span class="n">source_dir</span> <span class="o">=</span> <span 
class="n">_</span><span class="p">(</span><span class="ss">:source</span><span 
class="p">,</span> <span class="ss">:main</span><span class="p">,</span> <span 
class="ss">:sass</span><span class="p">)</span>
+
+<span class="n">assets</span><span class="o">.</span><span 
class="n">paths</span> <span class="o">&lt;&lt;</span> <span 
class="n">file</span><span class="p">(</span><span class="n">target_dir</span> 
<span class="o">=&gt;</span> <span class="o">[</span><span 
class="no">FileList</span><span class="o">[</span><span 
class="s2">&quot;</span><span class="si">#{</span><span 
class="n">source_dir</span><span class="si">}</span><span 
class="s2">/**/*.scss&quot;</span><span class="o">]]</span><span 
class="p">)</span> <span class="k">do</span>
+  <span class="nb">puts</span> <span class="s2">&quot;Compiling 
scss&quot;</span>
+  <span class="n">sh</span> <span class="s2">&quot;scss -q --update 
</span><span class="si">#{</span><span class="n">source_dir</span><span 
class="si">}</span><span class="s2">:</span><span class="si">#{</span><span 
class="n">target_dir</span><span class="si">}</span><span 
class="s2">&quot;</span>
+  <span class="n">touch</span> <span class="n">target_dir</span>
+<span class="k">end</span></code></pre></figure><h2 id="aar">Packaging 
AARs</h2>
+<p>Axis2 service archives are similar to JAR&#8217;s (compiled classes go into 
the root of the archive) but they can embed additional libraries under /lib and 
include <code>services.xml</code> and <span class="caps">WSDL</span> files.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:aar</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span><span class="p">(</span><span class="ss">:libs</span><span 
class="o">=&gt;</span><span 
class="s1">&#39;log4j:log4j:jar:1.1&#39;</span><span class="p">)</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:aar</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span><span class="p">(</span><span 
class="ss">:services_xml</span><span class="o">=&gt;</span><span 
class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/services.xml&#39;</span><span class="p">),</span>
+                   <span class="ss">:wsdls</span><span 
class="o">=&gt;</span><span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/*.wsdl&#39;</span><span 
class="p">))</span></code></pre></figure><p>The <code>libs</code> attribute is 
a list of .jar artifacts to be included in the archive under /lib.  The default 
is no artifacts; compile dependencies are not included by default.</p>
+<p>The <code>services_xml</code> attribute points to an Axis2 services 
configuration file called <code>services.xml</code> that will be placed in the 
<code>META-INF</code> directory inside the archive.  The default behavior is to 
point to the <code>services.xml</code> file in the project&#8217;s 
<code>src/main/axis2</code> directory.  In the second example above we set it 
explicitly.</p>
+<p>The <code>wsdls</code> attribute is a collection of file names or glob 
patterns for <span class="caps">WSDL</span> files that get included in the 
<code>META-INF</code> directory.  In the second example we include <span 
class="caps">WSDL</span> files from the <code>target</code> directory, 
presumably created by an earlier build task.  In addition, <span 
class="caps">AAR</span> packaging will include all files ending with 
<code>.wsdl</code> from the <code>src/main/axis2</code> directory.</p>
+<p>If you already have <span class="caps">WSDL</span> files in the 
<code>src/main/axis2</code> directory but would like to perform some filtering, 
for example, to set the <span class="caps">HTTP</span> port number, consider 
ignoring the originals and including only the filtered files, for example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># Host name depends on environment.</span>
+<span class="n">host</span> <span class="o">=</span> <span 
class="no">ENV</span><span class="o">[</span><span 
class="s1">&#39;ENV&#39;</span><span class="o">]</span> <span 
class="o">==</span> <span class="s1">&#39;test&#39;</span> <span 
class="p">?</span> <span class="s1">&#39;test.host&#39;</span> <span 
class="p">:</span> <span class="s1">&#39;ws.example.com&#39;</span>
+<span class="n">filter</span><span class="o">.</span><span 
class="n">from</span><span class="p">(</span><span class="n">_</span><span 
class="p">(</span><span class="s1">&#39;src/main/axis2&#39;</span><span 
class="p">))</span><span class="o">.</span><span class="n">into</span><span 
class="p">(</span><span class="n">_</span><span class="p">(</span><span 
class="ss">:target</span><span class="p">))</span><span class="o">.</span>
+  <span class="kp">include</span><span class="p">(</span><span 
class="s1">&#39;services.xml&#39;</span><span class="p">,</span> <span 
class="s1">&#39;==*==.wsdl&#39;</span><span class="p">)</span><span 
class="o">.</span><span class="n">using</span><span class="p">(</span><span 
class="s1">&#39;http_port&#39;</span><span class="o">=&gt;</span><span 
class="s1">&#39;8080&#39;</span><span class="p">,</span>
+                                              <span 
class="s1">&#39;http_host&#39;</span><span class="o">=&gt;</span><span 
class="n">host</span><span class="p">)</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:aar</span><span class="p">)</span><span class="o">.</span><span 
class="n">wsdls</span><span class="o">.</span><span class="n">clear</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:aar</span><span class="p">)</span><span class="o">.</span><span 
class="n">with</span><span class="p">(</span><span 
class="ss">:services_xml</span><span class="o">=&gt;</span><span 
class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/services.xml&#39;</span><span class="p">),</span>
+                   <span class="ss">:wsdls</span><span 
class="o">=&gt;</span><span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/==*==.wsdl&#39;</span><span 
class="p">))</span></code></pre></figure><h2 id="ear">Packaging EARs</h2>
+<p><span class="caps">EAR</span> packaging is slightly different from <span 
class="caps">JAR</span>/<span class="caps">WAR</span> packaging.  It&#8217;s 
main purpose is to package components together, and so it includes special 
methods for handling component inclusion that take care to update 
application.xml and the component&#8217;s classpath.</p>
+<p><span class="caps">EAR</span> packages support four component types:</p>
+<table>
+       <tr>
+               <th>Argument  </th>
+               <th>Component                     </th>
+       </tr>
+       <tr>
+               <td> <code>:war</code>      </td>
+               <td> J2EE Web Application (<span class="caps">WAR</span>).     
</td>
+       </tr>
+       <tr>
+               <td> <code>:ejb</code>      </td>
+               <td> Enterprise Java Bean (<span class="caps">JAR</span>).     
</td>
+       </tr>
+       <tr>
+               <td> <code>:jar</code>      </td>
+               <td> J2EE Application Client (<span class="caps">JAR</span>).  
</td>
+       </tr>
+       <tr>
+               <td> <code>:lib</code>      </td>
+               <td> Shared library (<span class="caps">JAR</span>).           
</td>
+       </tr>
+</table>
+<p>This example shows two ways for adding components built by other 
projects:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span> <span class="o">&lt;&lt;</span> 
<span class="n">project</span><span class="p">(</span><span 
class="s1">&#39;coolWebService&#39;</span><span class="p">)</span><span 
class="o">.</span><span class="n">package</span><span class="p">(</span><span 
class="ss">:war</span><span class="p">)</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">add</span> <span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;commonLib&#39;</span><span 
class="p">)</span> <span class="c1"># By default, the JAR 
package</span></code></pre></figure><p>Adding a <span class="caps">WAR</span> 
package assumes it&#8217;s a <span class="caps">WAR</span> component and treats 
it as such, but <span class="caps">JAR</span> packages can be any of three 
component types, so by default they are all treated as shared libraries.  If 
you want to add an <span class="caps">EJB</span> or Application Client 
component, you need to say so explicitly, either passing 
<code>:type=&gt;package</code>, or by passing the component type in the 
<code>:type</code> option.</p>
+<p>Here are three examples:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># Assumed to be a shared library.</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">add</span> <span 
class="s1">&#39;org.springframework:spring:jar:2.6&#39;</span>
+<span class="c1"># Component type mapped to package.</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">add</span> <span class="ss">:ejb</span><span 
class="o">=&gt;</span><span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;beanery&#39;</span><span 
class="p">)</span>
+<span class="c1"># Adding component with specific package type.</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">add</span> <span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;client&#39;</span><span 
class="p">),</span> <span class="ss">:type</span><span 
class="o">=&gt;</span><span class="ss">:jar</span></code></pre></figure><p>By 
default, <span class="caps">WAR</span> components are all added under the 
<code>/war</code> path, and likewise, <span class="caps">EJB</span> components 
are added under the <code>/ejb</code> path, shared libraries under 
<code>/lib</code> and Application Client components under <code>/jar</code>.</p>
+<p>If you want to place components in different locations you can do so using 
the <code>:path</code> option, or by specifying a different mapping between 
component types and their destination directory.  The following two examples 
are equivalent:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># Specify once per component.</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">add</span> <span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;coolWebService&#39;</span><span 
class="p">)</span><span class="o">.</span><span class="n">package</span><span 
class="p">(</span><span class="ss">:war</span><span class="p">),</span> <span 
class="ss">:path</span><span class="o">=&gt;</span><span 
class="s1">&#39;coolServices&#39;</span>
+<span class="c1"># Configure once and apply to all added components.</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">dirs</span><span class="o">[</span><span class="ss">:war</span><span 
class="o">]</span> <span class="o">=</span> <span 
class="s1">&#39;coolServices&#39;</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span> <span class="o">&lt;&lt;</span> 
<span class="n">project</span><span class="p">(</span><span 
class="s1">&#39;coolWebService&#39;</span><span class="p">)</span><span 
class="o">.</span><span class="n">package</span><span class="p">(</span><span 
class="ss">:war</span><span class="p">)</span></code></pre></figure><p><span 
class="caps">EAR</span> packages include an <code>application.xml</code> file 
in the <code>META-INF</code> directory that describes the application and its 
components.  This file is created for you during packaging, by referencing all 
the components added to the <span class="caps">EAR</span>.  There are a couple 
of things you will typically want to change.</p>
+<ul>
+       <li><strong>display-name</strong> &#8212; The application&#8217;s 
display name defaults to the project&#8217;s identifier.  You can change that 
by setting the <code>display_name</code> attribute.</li>
+</ul>
+<ul>
+       <li><strong>description</strong> &#8212; The application&#8217;s 
description defaults to the project&#8217;s comment.  You can change that by 
setting the <code>description</code> attribute.</li>
+</ul>
+<ul>
+       <li><strong>context-root</strong> &#8212; <span class="caps">WAR</span> 
components specify a context root, based on the package identifier, for 
example, &#8220;cool-web-1.0.war&#8221; will have the context root 
&#8220;cool-web&#8221;.  To specify a different context root, add the <span 
class="caps">WAR</span> package with the <code>context_root</code> option.</li>
+</ul>
+<p>Again, by example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">display_name</span> <span class="o">=</span> <span 
class="s1">&#39;MyCoolWebService&#39;</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">description</span> <span class="o">=</span> <span 
class="s1">&#39;MyCoolWebService: Making coolness kool again&#39;</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">add</span> <span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;coolWebService&#39;</span><span 
class="p">)</span><span class="o">.</span><span class="n">package</span><span 
class="p">(</span><span class="ss">:war</span><span class="p">),</span> <span 
class="ss">:context_root</span><span class="o">=&gt;</span><span 
class="s1">&#39;coolness&#39;</span></code></pre></figure><p>If you need to 
disable the context root (e.g. for Portlets), set <code>context_root</code> to 
<code>false</code>.</p>
+<p>It is also possible to add <code>security-role</code> tags to the 
<code>application.xml</code> file by appending a hash with <code>:id</code>, 
<code>:description</code> and <code>:name</code> to the 
<code>security_role</code> array, like so:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">security_roles</span> <span class="o">&lt;&lt;</span> <span 
class="p">{</span><span class="ss">:id</span><span class="o">=&gt;</span><span 
class="s1">&#39;SecurityRole_123&#39;</span><span class="p">,</span>
+               <span class="ss">:description</span><span 
class="o">=&gt;</span><span class="s1">&#39;Read only user&#39;</span><span 
class="p">,</span> <span class="ss">:name</span><span 
class="o">=&gt;</span><span class="s1">&#39;coolUser&#39;</span><span 
class="p">}</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:ear</span><span class="p">)</span><span class="o">.</span><span 
class="n">security_roles</span> <span class="o">&lt;&lt;</span> <span 
class="p">{</span><span class="ss">:id</span><span class="o">=&gt;</span><span 
class="s1">&#39;SecurityRole_456&#39;</span><span class="p">,</span>
+               <span class="ss">:description</span><span 
class="o">=&gt;</span><span class="s1">&#39;Super user&#39;</span><span 
class="p">,</span> <span class="ss">:name</span><span 
class="o">=&gt;</span><span class="s1">&#39;superCoolUser&#39;</span><span 
class="p">}</span></code></pre></figure><h2 id="bundle">Packaging OSGi 
Bundles</h2>
+<p>OSGi bundles are jar files with additional metadata stored in the manifest. 
Buildr uses an external tool <a href="http://www.aqute.biz/Code/Bnd";>Bnd</a> to 
create the package. Directives and properties can be explicitly passed to the 
build tool and buildr will provide reasonable defaults for properties that can 
be derived from the project model. Please see the bnd tool for documentation on 
the available properties.</p>
+<p>The bundle packaging format is included as an addon so the build file must 
explicitly require the addon using using <code>require "buildr/bnd"</code> and 
must add a remote repository from which the bnd can be downloaded. A typical 
project that uses the bundle packaging addon may look something like;</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="nb">require</span> <span 
class="s2">&quot;buildr/bnd&quot;</span>
+
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">remote</span> <span class="o">&lt;&lt;</span> <span 
class="s2">&quot;http://central.maven.org/maven2&quot;</span>
+<span class="c1"># uncomment the next version to override the version of 
bnd</span>
+<span class="c1"># Buildr::Bnd.version = &#39;0.0.384&#39;</span>
+
+<span class="n">define</span> <span class="s1">&#39;myProject&#39;</span> 
<span class="k">do</span>
+  <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Import-Package&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span class="s2">&quot;*;resolution:=optional&quot;</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Export-Package&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span class="s2">&quot;*;version=</span><span 
class="si">#{</span><span class="n">version</span><span 
class="si">}</span><span class="s2">&quot;</span>
+  <span class="k">end</span>
+  <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+<span class="k">end</span></code></pre></figure><p>The <code>[]</code> method 
on the bundle package is used to provide directives to the bnd tool that are 
not inherited by sub-projects while the standard &#8216;manifest&#8217; setting 
is used to define properties that inherited by sub-projects.</p>
+<h3>Defaults</h3>
+<p>The addon sets the following bnd parameters;</p>
+<ul>
+       <li><tt>&#8220;Bundle-Version&#8221;</tt> defaults to the project 
version.</li>
+       <li><tt>&#8220;Bundle-SymbolicName&#8221;</tt> defaults to the 
concatenation of the project group and project id, replacing &#8216;:&#8217; 
characters with &#8216;.&#8217;.</li>
+       <li><tt>&#8220;Bundle-Name&#8221;</tt> defaults to the project 
description if present else the project name</li>
+       <li><tt>&#8220;Bundle-Description&#8221;</tt> defaults to the project 
description.</li>
+       <li><tt>&#8220;-classpath&#8221;</tt> is set to the compile target 
directory and any compile time dependencies.</li>
+       <li><tt>&#8220;Include-Resource&#8221;</tt> defaults to the dir 
project.resources.target if it exists.</li>
+</ul>
+<h3>Parameters</h3>
+<h4>classpath_element</h4>
+<p>The user can also specify additional elements that are added to the 
classpath using the &#8216;classpath_element&#8217; method. If the parameter to 
this element is a task, artifact, artifact namespace etc. then it will be 
resolved prior to invoking bnd.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="o">.</span><span class="n">.</span><span 
class="o">.</span>
+<span class="n">define</span> <span class="s1">&#39;foo&#39;</span> <span 
class="k">do</span>
+  <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+    <span class="c1"># This dependency will be added to classpath</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath_element</span> <span 
class="s1">&#39;someOtherExistingFile.zip&#39;</span>
+    <span class="c1"># All of these dependencies will be invoked and added to 
classpath</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath_element</span> <span class="n">artifact</span><span 
class="p">(</span><span 
class="s1">&#39;com.sun.messaging.mq:imq:jar:4.4&#39;</span><span 
class="p">)</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath_element</span> <span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;bar&#39;</span><span class="p">)</span> 
<span class="c1"># Adds all the packages</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath_element</span> <span 
class="s1">&#39;org.apache.ant:ant:jar:1.8.0&#39;</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath_element</span> <span class="n">file</span><span 
class="p">(</span><span class="s1">&#39;myLocalFile.jar&#39;</span><span 
class="p">)</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="k">end</span>
+
+  <span class="n">project</span> <span class="s1">&#39;bar&#39;</span> <span 
class="k">do</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><h4>classpath</h4>
+<p>The user can specify the complete classpath using the 
&#8216;classpath&#8217; method. The classpath should be an array of elements. 
If the element is a task, artifact, artifact namespace etc. then it will be 
resolved prior to invoking bnd.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="o">.</span><span class="n">.</span><span 
class="o">.</span>
+<span class="n">define</span> <span class="s1">&#39;foo&#39;</span> <span 
class="k">do</span>
+  <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath</span> <span class="o">[</span> <span 
class="n">project</span><span class="o">.</span><span 
class="n">compile</span><span class="o">.</span><span 
class="n">target</span><span class="p">,</span>
+                    <span 
class="s1">&#39;someOtherExistingFile.zip&#39;</span><span class="p">,</span>
+                    <span class="n">artifact</span><span 
class="p">(</span><span 
class="s1">&#39;com.sun.messaging.mq:imq:jar:4.4&#39;</span><span 
class="p">),</span>
+                    <span class="n">project</span><span 
class="p">(</span><span class="s1">&#39;bar&#39;</span><span class="p">),</span>
+                    <span 
class="s1">&#39;org.apache.ant:ant:jar:1.8.0&#39;</span><span class="p">,</span>
+                    <span class="n">file</span><span class="p">(</span><span 
class="s1">&#39;myLocalFile.jar&#39;</span><span class="p">)</span> <span 
class="o">]</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="k">end</span>
+
+  <span class="n">project</span> <span class="s1">&#39;bar&#39;</span> <span 
class="k">do</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><h3>Examples</h3>
+<h4>Including non-class resources in a bundle</h4>
+<p>Bnd can be used to include non-class resources in a bundle. The following 
example includes all resources in &#8216;src/etc&#8217; into the bundle.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">define</span> <span 
class="s1">&#39;myproject&#39;</span> <span class="k">do</span>
+  <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Include-Resource&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span class="n">project</span><span class="o">.</span><span 
class="n">_</span><span class="p">(</span><span 
class="s1">&#39;src/etc&#39;</span><span class="p">)</span> <span 
class="o">+</span> <span class="s1">&#39;/&#39;</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><h4>Using bnd to wrap an 
existing jar</h4>
+<p>Bnd can be used to wrap an existing jar as an OSGi bundle. The following 
example wraps the OpenMQ <span class="caps">JMS</span> provider as an OSGi 
bundle.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="o">.</span><span class="n">.</span><span 
class="o">.</span>
+<span class="c1"># Add repository for OpenMQ</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">remote</span> <span class="o">&lt;&lt;</span> <span 
class="s1">&#39;http://download.java.net/maven/2&#39;</span>
+
+<span class="n">desc</span> <span class="s1">&#39;OSGi bundle for OpenMQ JMS 
provider client library&#39;</span>
+<span class="n">define</span> <span 
class="s1">&#39;com.sun.messaging.mq.imq&#39;</span> <span class="k">do</span>
+  <span class="n">project</span><span class="o">.</span><span 
class="n">version</span> <span class="o">=</span> <span 
class="s1">&#39;4.4&#39;</span>
+  <span class="n">project</span><span class="o">.</span><span 
class="n">group</span> <span class="o">=</span> <span 
class="s1">&#39;iris&#39;</span>
+  <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Import-Package&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span class="s2">&quot;*;resolution:=optional&quot;</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Export-Package&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span 
class="s2">&quot;com.sun.messaging.*;version=</span><span 
class="si">#{</span><span class="n">version</span><span 
class="si">}</span><span class="s2">&quot;</span>
+    <span class="n">bnd</span><span class="o">.</span><span 
class="n">classpath_element</span> <span 
class="s1">&#39;com.sun.messaging.mq:imq:jar:4.4&#39;</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><h4>Create an OSGi bundle with 
an Activator</h4>
+<p>The following example presents a basic buildfile for building an OSGi 
bundle with an activator.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="o">.</span><span class="n">.</span><span 
class="o">.</span>
+<span class="c1"># repository for OSGi core bundle</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">remote</span> <span class="o">&lt;&lt;</span> <span 
class="s1">&#39;https://repository.apache.org/content/repositories/releases&#39;</span>
+
+<span class="n">desc</span> <span class="s1">&#39;Hello World 
bundle&#39;</span>
+<span class="n">define</span> <span class="s1">&#39;helloworld&#39;</span> 
<span class="k">do</span>
+  <span class="n">project</span><span class="o">.</span><span 
class="n">version</span> <span class="o">=</span> <span 
class="s1">&#39;1.0&#39;</span>
+  <span class="n">project</span><span class="o">.</span><span 
class="n">group</span> <span class="o">=</span> <span 
class="s1">&#39;org.example&#39;</span>
+  <span class="n">compile</span><span class="o">.</span><span 
class="n">with</span> <span 
class="s1">&#39;org.apache.felix:org.osgi.core:jar:1.4.0&#39;</span>
+  <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Export-Package&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span 
class="s2">&quot;org.example.helloworld.api.*;version=</span><span 
class="si">#{</span><span class="n">version</span><span 
class="si">}</span><span class="s2">&quot;</span>
+    <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Bundle-Activator&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span 
class="s2">&quot;org.example.helloworld.Activator&quot;</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><h4>Inheriting parameters for 
bnd tool</h4>
+<p>The following example shows how you can use &#8216;manifest&#8217; to 
define a bnd parameter that is inherited by all child sub-projects. The 
&#8220;Bundle-License&#8221; defined in the top level project is passed to the 
bnd tool when generating both the &#8216;fe&#8217; and &#8216;fi&#8217; 
sub-projects but the &#8216;fo&#8217; sub-project overrides this parameter with 
a local value.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="o">.</span><span class="n">.</span><span 
class="o">.</span>
+<span class="n">define</span> <span class="s1">&#39;myproject&#39;</span> 
<span class="k">do</span>
+  <span class="n">manifest</span><span class="o">[</span><span 
class="s1">&#39;Bundle-License&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span 
class="s2">&quot;http://www.apache.org/licenses/LICENSE-2.0&quot;</span>
+  <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+  <span class="n">define</span> <span class="s1">&#39;fe&#39;</span> <span 
class="k">do</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+    <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+      <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+    <span class="k">end</span>
+  <span class="k">end</span>
+
+  <span class="n">define</span> <span class="s1">&#39;fi&#39;</span> <span 
class="k">do</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+    <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+      <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+    <span class="k">end</span>
+  <span class="k">end</span>
+
+  <span class="n">define</span> <span class="s1">&#39;fo&#39;</span> <span 
class="k">do</span>
+    <span class="o">.</span><span class="n">.</span><span class="o">.</span>
+    <span class="n">package</span><span class="p">(</span><span 
class="ss">:bundle</span><span class="p">)</span><span class="o">.</span><span 
class="n">tap</span> <span class="k">do</span> <span class="o">|</span><span 
class="n">bnd</span><span class="o">|</span>
+      <span class="n">bnd</span><span class="o">[</span><span 
class="s1">&#39;Bundle-License&#39;</span><span class="o">]</span> <span 
class="o">=</span> <span 
class="s2">&quot;http://www.apache.org/licenses/LICENSE-1.1&quot;</span>
+    <span class="k">end</span>
+  <span class="k">end</span>
+<span class="k">end</span></code></pre></figure><h2 id="tar">Packaging Tars 
and GZipped Tars</h2>
+<p>Everything you know about working with <span class="caps">ZIP</span> files 
translates to Tar files, the two tasks are identical in more respect, so here 
we&#8217;ll just go over the differences.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span><span class="p">(</span><span 
class="ss">:tar</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs&#39;</span><span class="p">),</span> <span 
class="s1">&#39;README&#39;</span>
+<span class="n">package</span><span class="p">(</span><span 
class="ss">:tgz</span><span class="p">)</span><span class="o">.</span><span 
class="n">include</span> <span class="n">_</span><span class="p">(</span><span 
class="s1">&#39;target/docs&#39;</span><span class="p">),</span> <span 
class="s1">&#39;README&#39;</span></code></pre></figure><p>The first line 
creates a Tar archive with the extension <code>.tar</code>, the second creates 
a GZipped Tar archive with the extension <code>.tgz</code>.</p>
+<p>In addition to packaging that includes the archive in the list of 
installed/released files, you can use the method <code>tar</code> to create a 
<code>TarTask</code>. This task is similar to <code>ZipTask</code>, and 
introduces the <code>gzip</code> attribute, which you can use to tell it 
whether to create a regular file, or GZip it.  By default the attribute it set 
to true (GZip) if the file name ends with either <code>.gz</code> or 
<code>.tgz</code>.</p>
+<h2 id="install_upload">Installing and Uploading</h2>
+<p>You can bring in the artifacts you need from remote repositories and 
install them in the local repositories.  Other projects have the same 
expectation, that your packages be their artifacts.</p>
+<p>So let&#8217;s create these packages and install them in the local 
repository where other projects can access them:</p>
+<figure class="highlight"><pre><code class="language-sh" data-lang="sh"><span 
class="nv">$ </span>buildr install</code></pre></figure><p>If you changes your 
mind you can always:</p>
+<figure class="highlight"><pre><code class="language-sh" data-lang="sh"><span 
class="nv">$ </span>buildr uninstall</code></pre></figure><p>That works between 
projects you build on the same machine.  Now let&#8217;s share these artifacts 
with other developers through a remote repository:</p>
+<figure class="highlight"><pre><code class="language-sh" data-lang="sh"><span 
class="nv">$ </span>buildr upload</code></pre></figure><p>Of course, 
you&#8217;ll need to tell Buildr about the release server:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">repositories</span><span 
class="o">.</span><span class="n">release_to</span> <span class="o">=</span> 
<span 
class="s1">&#39;sftp://john:secret@release/usr/share/repo&#39;</span></code></pre></figure><p>If
 you have separate repositories for releases and snapshots, you can specify 
them accordingly. Buildr takes care of picking the correct one.</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">repositories</span><span 
class="o">.</span><span class="n">release_to</span> <span class="o">=</span> 
<span 
class="s1">&#39;sftp://john:secret@release/usr/share/repo/releases&#39;</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">snapshot_to</span> <span class="o">=</span> <span 
class="s1">&#39;sftp://john:secret@release/usr/share/repo/snapshots&#39;</span></code></pre></figure><p>This
 example uses the <span class="caps">SFTP</span> protocol.  In addition, you 
can use the <span class="caps">HTTP</span> protocol &#8212; Buildr supports 
<span class="caps">HTTP</span> and <span class="caps">HTTPS</span>, Basic 
Authentication and uploads using <span class="caps">PUT</span> &#8212; or point 
to a directory on your file system.</p>
+<p>The <span class="caps">URL</span> in this example contains the release 
server (&#8220;release&#8221;), path to repository 
(&#8220;user/share/repo&#8221;) and username/password for access.  The way 
<span class="caps">SFTP</span> works, you specify the path on the release 
server, and give the user permissions to create directories and files inside 
the repository.  The file system path is different from the path you use to 
download these artifacts through an <span class="caps">HTTP</span> server, and 
starts at the root, not the user&#8217;s home directory.</p>
+<p>Of course, you&#8217;ll want to specify the release server <span 
class="caps">URL</span> in the Buildfile, but leave the username/password 
settings private in your local <code>buildr.rb</code> file. Let&#8217;s break 
up the release server settings:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># build.rb, loaded first</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">release_to</span><span class="o">[</span><span 
class="ss">:username</span><span class="o">]</span> <span class="o">=</span> 
<span class="s1">&#39;john&#39;</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">release_to</span><span class="o">[</span><span 
class="ss">:password</span><span class="o">]</span> <span class="o">=</span> 
<span class="s1">&#39;secret&#39;</span>
+
+<span class="c1"># Buildfile, loaded next</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">release_to</span><span class="o">[</span><span 
class="ss">:url</span><span class="o">]</span> <span class="o">=</span> <span 
class="s1">&#39;sftp://release/usr/share/repo&#39;</span></code></pre></figure><p>The
 <code>upload</code> task takes care of uploading all the packages created by 
your project, along with their associated <span class="caps">POM</span> files 
and MD5/SHA1 signatures (Buildr creates these for you).</p>
+<p>If you need to upload other files, you can always extend the 
<code>upload</code> task and use <code>repositories.release_to</code> in 
combination with <code>URI.upload</code>.  You can also extend it to upload to 
different servers, for example, to publish the documentation and test coverage 
reports to your site:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># We&#39;ll let some other task decide how to 
create &#39;docs&#39;</span>
+<span class="n">task</span> <span class="s1">&#39;upload&#39;</span><span 
class="o">=&gt;</span><span class="s1">&#39;docs&#39;</span> <span 
class="k">do</span>
+  <span class="n">uri</span> <span class="o">=</span> <span 
class="no">URI</span><span class="p">(</span><span 
class="s2">&quot;sftp://</span><span class="si">#{</span><span 
class="n">username</span><span class="si">}</span><span 
class="s2">:</span><span class="si">#{</span><span 
class="n">password</span><span class="si">}</span><span 
class="s2">@var/www/docs&quot;</span><span class="p">)</span>
+  <span class="n">uri</span><span class="o">.</span><span 
class="n">upload</span> <span class="n">file</span><span 
class="p">(</span><span class="s1">&#39;docs&#39;</span><span class="p">)</span>
+<span class="k">end</span></code></pre></figure><h3 
id="uploading-options">Uploading Options</h3>
+<p>For convenience, you can also pass <a 
href="http://net-ssh.github.com/ssh/v2/api/classes/Net/SSH.html#M000002";>any 
option of Net::<span class="caps">SSH</span></a> when configuring the remote 
repository.</p>
+<p>If you need to enforce to use password-only authentication for example, you 
can set this option:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="c1"># Set password authentication only</span>
+<span class="n">repositories</span><span class="o">.</span><span 
class="n">release_to</span><span class="o">[</span><span 
class="ss">:options</span><span class="o">]</span> <span class="o">=</span> 
<span class="p">{</span><span class="ss">:ssh_options</span><span 
class="o">=&gt;</span><span class="p">{</span><span 
class="ss">:auth_methods</span><span class="o">=&gt;</span> <span 
class="s1">&#39;password&#39;</span><span 
class="p">}}</span></code></pre></figure><h2 id="source_javadoc">Packaging 
Sources and JavaDocs</h2>
+<p>IDEs can take advantage of source packages to help you debug and trace 
through compiled code.  We&#8217;ll start with a simple example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span> <span 
class="ss">:sources</span></code></pre></figure><p>This one creates a <span 
class="caps">ZIP</span> package with the classifier &#8220;sources&#8221; that 
will contain all the source directories in that project, typically 
<code>src/main/java</code>, but also other sources generated from Apt, JavaCC, 
XMLBeans and friends.</p>
+<p>You can also generate a <span class="caps">ZIP</span> package with the 
classifier &#8220;javadoc&#8221; that contains the JavaDoc documentation for 
the project.  It uses the same set of documentation files generated by the 
project&#8217;s <code>doc</code> task, so you can use it in combination with 
the <code>doc</code> method.  For example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package</span> <span class="ss">:javadoc</span>
+<span class="n">doc</span> <span class="ss">:windowtitle</span><span 
class="o">=&gt;</span><span class="s1">&#39;Buggy but 
Works&#39;</span></code></pre></figure><p>By default Buildr picks the 
project&#8217;s description for the window title.</p>
+<p>You can also tell Buildr to automatically create sources and JavaDoc 
packages in all the sub-projects that have any source files to package or 
document. Just add either or both of these methods in the top-level project:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package_with_sources</span>
+<span class="n">package_with_javadoc</span></code></pre></figure><p>You can 
also tell it to be selective using the <code>:only</code> and 
<code>:except</code> options.<br />
+For example:</p>
+<figure class="highlight"><pre><code class="language-ruby" 
data-lang="ruby"><span class="n">package_with_javadoc</span> <span 
class="ss">:except</span><span class="o">=&gt;</span><span 
class="s1">&#39;la-web&#39;</span></code></pre></figure><p>We packaged the 
code, but will it actually work? Let&#8217;s see <a href="testing.html">what 
the tests say</a>.</p>
+      </div>
+      <div id='footer'>Copyright &copy; 2007-2016 The Apache Software 
Foundation</div>
+    </div>
+  </body>
+</html>

Added: dev/buildr/1.5.0/site/preface.html
==============================================================================
--- dev/buildr/1.5.0/site/preface.html (added)
+++ dev/buildr/1.5.0/site/preface.html Sat Sep 17 06:18:39 2016
@@ -0,0 +1,60 @@
+<html>
+  <head>
+    <meta content='text/html;charset=UTF-8' http-equiv='Content-Type' />
+    <title>buildr</title>
+    <style type='text/css'>
+      @import 'css/default.css';
+      @import 'css/syntax.css';
+    </style>
+    <style media='print' type='text/css'>
+      @import 'css/print.css';
+    </style>
+    <meta content='Official Buildr documentation from the people in the know' 
name='subject' />
+    <link href='images/favicon.png' rel='shortcut icon' />
+  </head>
+  <body>
+    <div id='wrap'>
+      <div id='content'>
+        <p class="title"><img src="images/zbuildr.png" alt="" /></p>
+<ol class='toc'>
+  <li><a href="quick_start.html">Quick Start</a></li>
+  <li><a href="installing.html">Installing and Running</a></li>
+  <li><a href="projects.html">Projects</a></li>
+  <li><a href="building.html">Building</a></li>
+  <li><a href="artifacts.html">Artifacts</a></li>
+  <li><a href="packaging.html">Packaging</a></li>
+  <li><a href="testing.html">Testing</a></li>
+  <li><a href="settings_profiles.html">Settings &amp; Profiles</a></li>
+  <li><a href="languages.html">Languages</a></li>
+  <li><a href="more_stuff.html">More Stuff</a></li>
+  <li><a href="extending.html">Extending Buildr</a></li>
+  <li><a href="contributing.html">Contributing</a></li>
+</ol>
+<p class="preface"><img src="images/asf-logo.png" alt="" /></p>
+<p>Copyright 2007-2016 Apache Buildr</p>
+<p>Licensed under the Apache License, Version 2.0 (the &#8220;License&#8221;); 
you may not use this file except in compliance with the License. You may obtain 
a copy of the License at</p>
+http://www.apache.org/licenses/<span class="caps">LICENSE</span>-2.0
+<p>Unless required by applicable law or agreed to in writing, software 
distributed under the License is distributed on an &#8220;AS IS&#8221; <span 
class="caps">BASIS</span>, <span class="caps">WITHOUT</span> <span 
class="caps">WARRANTIES</span> OR <span class="caps">CONDITIONS</span> OF <span 
class="caps">ANY</span> <span class="caps">KIND</span>, either express or 
implied. See the License for the specific language governing permissions and 
limitations under the License.</p>
+<div class='preface quotes'>
+<p><a href="http://www.codecommit.com/blog";>Daniel Spiewak</a>:</p>
+<blockquote>
+<p>If you think about it, the question isn’t “Why use Buildr?”, it’s 
really “Why use anything else?” The advantages afforded by Buildr are so 
substantial, I really can’t see myself going with any other tool, at least 
not when I have a choice.</p>
+</blockquote>
+<p><a href="http://tristanhunt.com/";>Tristan Juricek</a>:</p>
+<blockquote>
+<p>That’s still the strongest sell: it builds everything I need, and as 
I’ve needed more, I just got things working without a lot of fuss.</p>
+</blockquote>
+<p><a href="http://offthelip.org/";>Matthieu Riou</a>:</p>
+<blockquote>
+<p>We used to rely on Ant, with a fairly extensive set of scripts. It worked 
but was expensive to maintain. The biggest mistake afterward was to migrate to 
Maven2. I could write pages of rants explaining all the problems we ran into 
and we still ended up with thousands of lines of <span 
class="caps">XML</span>.</p>
+</blockquote>
+<p><a href="http://www.javakaffee.de/blog/";>Martin Grotzke</a>:</p>
+<blockquote>
+<p>The positive side effect for me as a java user is that I learn a little 
ruby, and that’s easy but lots of fun… :-)</p>
+</blockquote>
+</div>
+<p>p(preface).</p>
+      </div>
+    </div>
+  </body>
+</html>


Reply via email to