<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Sonatype Blog &#187; Gradle</title>
	<atom:link href="http://blog.sonatype.com/people/tag/gradle/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.sonatype.com/people</link>
	<description>Sonatype is transforming software development with tools, information and services that enable organizations to build better software, faster, using open-source components.</description>
	<lastBuildDate>Thu, 16 May 2013 18:53:09 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.5.1</generator>
		<item>
		<title>Nexus Pro: Automating Staging Workflow with Gradle using the Nexus REST APIs</title>
		<link>http://blog.sonatype.com/people/2012/07/nexus-pro-automating-staging-workflow-with-gradle-using-the-nexus-rest-apis/</link>
		<comments>http://blog.sonatype.com/people/2012/07/nexus-pro-automating-staging-workflow-with-gradle-using-the-nexus-rest-apis/#comments</comments>
		<pubDate>Tue, 10 Jul 2012 13:29:42 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Gradle]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=11774</guid>
		<description><![CDATA[I recently had a request from a customer for some guidance on how to automate Staging in Nexus Professional from Gradle. Here was his core problem: he had a series of builds that needed to deploy to a staging URL and he was wondering if it was possible to automate the closing of a repository [...]]]></description>
				<content:encoded><![CDATA[<p><img src="http://www.sonatype.com/people/wp-content/uploads/2012/06/gradle_logo1.gif" alt="" title="gradle_logo" width="250" class="aligncenter size-full wp-image-11647" style="padding: 15px; float: right;" />I recently had a request from a customer for some guidance on how to automate Staging in Nexus Professional from Gradle.   Here was his core problem: he had a series of builds that needed to deploy to a staging URL and he was wondering if it was possible to automate the closing of a repository from Gradle.   It is.  While we&#8217;ve made it easy to do this in Maven with the Nexus Maven Plugin we didn&#8217;t have the equivalent example in Groovy.  This post gives some guidance to anyone who needs to call out to our REST services from Groovy.</p></p>

<p>As Nexus Professional exposes every feature as a REST endpoint it is very easy to automate these interactions in just about any language.   This sample demonstrates who to incorporate calls to Nexus REST APIs directly from your build.   It also provides a model for parsing JSON responses from Nexus and posting JSON requests.   If you are interested in more of these examples, please let us know in the comments of this post.  (One thing is sure, this particular example could use some improvement, please be harsh.)</p>

<p><span id="more-11774"></span></p>

<p>This example assumes that you are using a local instance of Nexus Professional running on port 8081.  It also assumes that you are using the default administrative credentials.  The workflow for this example would be someone staging a release, listing the staged repositories, and than closing one of those repositories.   This example is a first cut, a simple example to demonstrate that integrating Nexus REST into your Gradle build is straightforward:</p>

<pre><b>$ gradle upload</b>
<b>$ gradle stage_list</b>
:stage_list
sample_profile-004, closed
sample_profile-005, closed
sample_profile-006, open
<b>$ gradle stage_close -DrepoId="sample_profile-006"</b>
:stage_close
Repository Closed</pre>

<p>Here&#8217;s the sample Gradle build that demonstrates how to call out to Nexus REST services.  First, note that stage_list and stage_close correspond to two in-line Gradle tasks StagingCloseTask and StagingListTasks.  Both of these tasks simply set up authentication and the appropriate request headers.  They then make the appropriate HTTP call to Nexus REST endpoints.   StagingListTask shows you how to receive JSON from Nexus REST APIs and iterate through the results, StagingCloseTask shows you how to POST a JSON document (albeit very inelegantly, it does get the job done).</p>

<p>%CODE1%</p>

<p><b>Note:</b> I didn&#8217;t use HTTP Builder in the example for a reason.  While HTTP Builder would have made these examples smaller, I wanted to make sure that people had a sample Grade build they could use without having to worry about extra dependencies.   This script works with the latest Gradle 1.0 release.</p>

<p>I&#8217;m also very aware that there are likely 100 different ways to write this script and this this isn&#8217;t the most elegant solution.  The point of this post is to demonstrate the possible, expect more iterations as we continue to focus on the interoperability of Nexus to expand support beyond Maven to the rich variety of build tools our customers are using.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sonatype.com/people/2012/07/nexus-pro-automating-staging-workflow-with-gradle-using-the-nexus-rest-apis/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to Publish, Consume, and Stage Artifacts to Nexus from Gradle</title>
		<link>http://blog.sonatype.com/people/2012/06/how-to-publish-consume-and-stage-artifacts-to-nexus-from-gradle/</link>
		<comments>http://blog.sonatype.com/people/2012/06/how-to-publish-consume-and-stage-artifacts-to-nexus-from-gradle/#comments</comments>
		<pubDate>Tue, 19 Jun 2012 10:00:23 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Gradle]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=11643</guid>
		<description><![CDATA[Last week when we published a Gradle-specific evaluation guide for Nexus Professional I failed to mention that Gradle also works well with Nexus OSS. Here are some simple Knowledge Base entries from our Support portal that put the details into how to publish and consume artifacts using Gradle and Nexus: How do I configure my [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-11647" title="gradle_logo" src="http://www.sonatype.com/people/wp-content/uploads/2012/06/gradle_logo1.gif" alt="" width="224" height="62" style="margin: 10px"/>Last week when we published a <a href="http://www.sonatype.com/people/2012/06/does-nexus-pro-support-your-gradle-builds-yes-it-does/">Gradle-specific evaluation guide for Nexus Professional</a> I failed to mention that Gradle also works well with <a href="http://www.sonatype.com/nexus">Nexus OSS</a>. Here are some simple Knowledge Base entries from our <a href="http://support.sonatype.com">Support portal</a> that put the details into how to publish and consume artifacts using <a href="http://www.gradle.org">Gradle</a> and <a href="http://www.sonatype.com/nexus">Nexus</a>:</p>

<ul>
    <li><a title="How do I configure my Gradle build to publish artifacts to Nexus?" href="https://support.sonatype.com/entries/21580432-how-do-i-configure-my-gradle-build-to-publish-artifacts-to-nexus">How do I configure my Gradle build to publish artifacts to Nexus?</a> in <a href="https://support.sonatype.com/forums/20383506-nexus">Nexus OSS</a></li>
    <li><a title="How do I configure my Gradle build to download artifacts from Nexus?" href="https://support.sonatype.com/entries/21596297-how-do-i-configure-my-gradle-build-to-download-artifacts-from-nexus">How do I configure my Gradle build to download artifacts from Nexus?</a> in <a href="https://support.sonatype.com/forums/20383506-nexus">Nexus OSS</a></li>
    <li><a title="How do I stage artifacts to a Nexus Staging Profile from a Gradle build?" href="https://support.sonatype.com/entries/21597257-how-do-i-stage-artifacts-to-a-nexus-staging-profile-from-a-gradle-build">How do I stage artifacts to a Nexus Staging Profile from a Gradle build?</a> in <a href="https://support.sonatype.com/forums/20016952-nexus-professional">Nexus Pro</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://blog.sonatype.com/people/2012/06/how-to-publish-consume-and-stage-artifacts-to-nexus-from-gradle/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Does Nexus Pro support your Gradle builds?  Yes it does.</title>
		<link>http://blog.sonatype.com/people/2012/06/does-nexus-pro-support-your-gradle-builds-yes-it-does/</link>
		<comments>http://blog.sonatype.com/people/2012/06/does-nexus-pro-support-your-gradle-builds-yes-it-does/#comments</comments>
		<pubDate>Fri, 15 Jun 2012 14:29:56 +0000</pubDate>
		<dc:creator>Tim O'Brien</dc:creator>
				<category><![CDATA[Nexus]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Gradle]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=11605</guid>
		<description><![CDATA[In support of this week&#8217;s release of Gradle 1.0, here&#8217;s an evaluation guide for Nexus Professional using two, very simple Gradle projects. If you are evaluating Nexus Professional, or if you are just looking for some sample projects that configure a Gradle build to use a repository take a look at this guide. Take a [...]]]></description>
				<content:encoded><![CDATA[<p><img class="alignright  wp-image-11608" title="gradle_logo" src="http://www.sonatype.com/people/wp-content/uploads/2012/06/gradle_logo.gif" alt="" width="196" height="54" /></p>

<p>In support of this week&#8217;s release of <a href="http://gradle.org/downloads">Gradle 1.0</a>, here&#8217;s an evaluation guide for Nexus Professional using two, very simple Gradle projects. If you are evaluating Nexus Professional, or if you are just looking for some sample projects that configure a Gradle build to use a repository take a look at this guide. Take a look at this evaluation guide and download the associated sample projects. These two projects have build.gradle files that demonstrate the simplest case of configuring a Gradle build to:</p>

<ul>
    <li>Download dependencies from a Nexus Repository Group with Gradle</li>
    <li>Deploy an Artifact to a Nexus Snapshot Repository from Gradle</li>
    <li>Staging an Artifact to a Nexus Staging Repository from Gradle</li>
</ul>

<p>Update 2013-05: The evaluation guide has been updated and is now available in <a href="http://books.sonatype.com/nexus-book/reference/eval.html">HTML</a> and <a href="http://www.sonatype.com/books/nexus-book/pdf/sonatype-nexus-eval-guide.pdf">PDF</a> format.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sonatype.com/people/2012/06/does-nexus-pro-support-your-gradle-builds-yes-it-does/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to publish your Gradle project to the Central Repository</title>
		<link>http://blog.sonatype.com/people/2011/11/how-to-publish-your-gradle-project-to-the-central-repository/</link>
		<comments>http://blog.sonatype.com/people/2011/11/how-to-publish-your-gradle-project-to-the-central-repository/#comments</comments>
		<pubDate>Mon, 14 Nov 2011 15:37:38 +0000</pubDate>
		<dc:creator>Terry Bernstein</dc:creator>
				<category><![CDATA[Community]]></category>
		<category><![CDATA[How-To]]></category>
		<category><![CDATA[Sonatype]]></category>
		<category><![CDATA[Gradle]]></category>

		<guid isPermaLink="false">http://www.sonatype.com/people/?p=9514</guid>
		<description><![CDATA[Sonatype makes it easy to add your projects to the Central Repository with a free, public hosting service called OSSRH, that we recently wrote about here.  Many developers have found this a very useful service and easy to use with Apache Maven.  However, if you&#8217;ve started using Gradle, you may have wondered if you could [...]]]></description>
				<content:encoded><![CDATA[<p>Sonatype makes it easy to add your projects to the <a title="Central Repository" href="http://search.maven.org/">Central Repository</a> with a free, public hosting service called OSSRH, that we recently wrote about <a title="Blog on Sonatype OSSRH" href="http://www.sonatype.com/people/2011/10/publishing-your-artifacts-to-the-central-repository/">here</a>.  Many developers have found this a very useful service and easy to use with Apache Maven.  However, if you&#8217;ve started using Gradle, you may have wondered if you could continue using the service.  The answer is absolutely YES.</p>

<p>We were talking about creating a guide for this, but someone in the community beat us to it.  Yennick Trevels published an excellent guide in his blog that you can find <a href="http://jedicoder.blogspot.com/2011/11/automated-gradle-project-deployment-to.html">here</a>.  We highly recommend checking out his post if you want to use Gradle to deploy artifacts to the Central Repository.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.sonatype.com/people/2011/11/how-to-publish-your-gradle-project-to-the-central-repository/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
