<?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>Blog @ SIB Visions &#187; Ant</title>
	<atom:link href="http://blog.sibvisions.com/tag/ant/feed/" rel="self" type="application/rss+xml" />
	<link>https://blog.sibvisions.com</link>
	<description>Blog @ SIB Visions</description>
	<lastBuildDate>Mon, 13 Apr 2026 09:47:01 +0000</lastBuildDate>
		<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Eclipse 2018.12 with ANT and JRE 6</title>
		<link>https://blog.sibvisions.com/2019/03/16/eclipse-2018-12-with-ant-and-jre-6/</link>
		<comments>https://blog.sibvisions.com/2019/03/16/eclipse-2018-12-with-ant-and-jre-6/#comments</comments>
		<pubDate>Sat, 16 Mar 2019 13:16:34 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8256</guid>
		<description><![CDATA[The support for ANT and JRE6 with Eclipse 2018.12.
The plugin was created for:
Version: 2018-12 (4.10.0)
Build id: 20181214-0600
Don't forget the -clean start (read the original article for more details)!
One more thing you should do:
Photon includes ANT > 1.10. This version requires Java 8. In order to use Java 6, you have to download ANT 1.9.x. Simply [...]]]></description>
			<content:encoded><![CDATA[<p>The support for ANT and JRE6 with Eclipse 2018.12.</p>
<p>The plugin was created for:</p>
<div class="codesnip-container" >Version: 2018-12 (4.10.0)<br />
Build id: 20181214-0600</div>
<p>Don't forget the -clean start (read the original article for more details)!</p>
<p>One more thing you should do:</p>
<p>Photon includes ANT > 1.10. This version requires Java 8. In order to use Java 6, you have to download ANT 1.9.x. Simply download ANT and set the ANT Home to your version, via </p>
<div class="codesnip-container" >(Window >>) Preferences >> ANT >> Runtime >> Ant Home...</div>
<p>If you try to use the bundled ANT with JRE 6, it will fail with an Exception.</p>
<p>Download the plugin from <a href="https://blog.sibvisions.com/wp-content/uploads/2019/03/ANT_plugin_JRE6_2018_12.zip">here</a>. It works for us - no warranty!</p>
<p>More Details:  <a href="https://blog.sibvisions.com/2018/09/20/eclipse-photon-with-ant-and-jre6/">Eclipse Photon with ANT and JRE6</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2019/03/16/eclipse-2018-12-with-ant-and-jre-6/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eclipse Photon with ANT and JRE6</title>
		<link>https://blog.sibvisions.com/2018/09/20/eclipse-photon-with-ant-and-jre6/</link>
		<comments>https://blog.sibvisions.com/2018/09/20/eclipse-photon-with-ant-and-jre6/#comments</comments>
		<pubDate>Thu, 20 Sep 2018 06:34:57 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=8139</guid>
		<description><![CDATA[The support for ANT and JRE6 with Eclipse Photon.
The plugin was created for:
Version: Photon Release (4.8.0)
Build id: 20180619-1200
Don't forget the -clean start (read the original article for more details)!
One more thing you should do:
Photon includes ANT > 1.10. This version requires Java 8. In order to use Java 6, you have to download ANT 1.9.x. [...]]]></description>
			<content:encoded><![CDATA[<p>The support for ANT and JRE6 with Eclipse Photon.</p>
<p>The plugin was created for:</p>
<div class="codesnip-container" >Version: Photon Release (4.8.0)<br />
Build id: 20180619-1200</div>
<p>Don't forget the -clean start (read the original article for more details)!</p>
<p>One more thing you should do:</p>
<p>Photon includes ANT > 1.10. This version requires Java 8. In order to use Java 6, you have to download ANT 1.9.x. Simply download ANT and set the ANT Home to your version, via </p>
<div class="codesnip-container" >(Window >>) Preferences >> ANT >> Runtime >> Ant Home...</div>
<p>If you try to use the bundled ANT with JRE 6, it will fail with an Exception.</p>
<p>Download the plugin from <a href="https://blog.sibvisions.com/wp-content/uploads/2018/09/ANT_plugin_JRE6_Photon.zip">here</a>. It works for us - no warranty!</p>
<p>More Details:  <a href="https://blog.sibvisions.com/2018/03/15/eclipse-oxygen-2-with-ant-and-jre6/">Eclipse Oxygen.2 with ANT and JRE6</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2018/09/20/eclipse-photon-with-ant-and-jre6/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Eclipse Oxygen.1 with ANT and JRE6</title>
		<link>https://blog.sibvisions.com/2017/10/08/eclipse-oxygen-1-with-ant-and-jre6/</link>
		<comments>https://blog.sibvisions.com/2017/10/08/eclipse-oxygen-1-with-ant-and-jre6/#comments</comments>
		<pubDate>Sun, 08 Oct 2017 21:21:06 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">https://blog.sibvisions.com/?p=7321</guid>
		<description><![CDATA[Long awaited, now it's here 
The support for ANT and JRE6 with Eclipse Oxygen.1 (September 2017).
This is a follow-up post for: Eclipse NEON with ANT and JRE6
The plugin was created for:
Version: Oxygen.1 Release (4.7.1)
Build id: 20170914-1200
Don't forget the -clean start (read the original article for more details)!
Download the plugin from here. It works for us [...]]]></description>
			<content:encoded><![CDATA[<p>Long awaited, now it's here <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
The support for ANT and JRE6 with Eclipse Oxygen.1 (September 2017).</p>
<p>This is a follow-up post for: <a href="https://blog.sibvisions.com/2016/06/30/eclipse-neon-with-ant-and-jre6/">Eclipse NEON with ANT and JRE6</a></p>
<p>The plugin was created for:</p>
<div class="codesnip-container" >Version: Oxygen.1 Release (4.7.1)<br />
Build id: 20170914-1200</div>
<p>Don't forget the -clean start (read the original article for more details)!</p>
<p>Download the plugin from <a href="https://blog.sibvisions.com/wp-content/uploads/2017/10/ANT_plugin_JRE6_Oxygen.1.zip">here</a>. It works for us - no warranty!</p>
<p>For more details about the installation, read <a href="http://blog.sibvisions.com/2015/09/25/eclipse-mars-with-ant-and-jre-6-story/">this article</a>.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2017/10/08/eclipse-oxygen-1-with-ant-and-jre6/feed/</wfw:commentRss>
		<slash:comments>20</slash:comments>
		</item>
		<item>
		<title>Eclipse NEON with ANT and JRE6</title>
		<link>https://blog.sibvisions.com/2016/06/30/eclipse-neon-with-ant-and-jre6/</link>
		<comments>https://blog.sibvisions.com/2016/06/30/eclipse-neon-with-ant-and-jre6/#comments</comments>
		<pubDate>Thu, 30 Jun 2016 15:05:31 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=5712</guid>
		<description><![CDATA[This is a follow-up post for: Eclipse MARS with ANT and JRE 6 (story).
New Eclipse version, same problem. We have an updated ant plugin for you.
The plugin was created for:
Version: Neon Release (4.6.0)
Build id: 20160613-1800
Don't forget the -clean start (read the original article for more details).
Download the plugin from here. It works for us - [...]]]></description>
			<content:encoded><![CDATA[<p>This is a follow-up post for: <a href="http://blog.sibvisions.com/2015/09/25/eclipse-mars-with-ant-and-jre-6-story/">Eclipse MARS with ANT and JRE 6 (story)</a>.</p>
<p>New Eclipse version, same problem. We have an updated ant plugin for you.<br />
The plugin was created for:</p>
<div class="codesnip-container" >Version: Neon Release (4.6.0)<br />
Build id: 20160613-1800</div>
<p>Don't forget the <em>-clean</em> start (read the original article for more details).</p>
<p>Download the plugin from <a href="http://bit.ly/29onA6b">here</a>. It works for us - <strong>no warranty</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2016/06/30/eclipse-neon-with-ant-and-jre6/feed/</wfw:commentRss>
		<slash:comments>17</slash:comments>
		</item>
		<item>
		<title>Eclipse MARS with ANT and JRE 6 (story)</title>
		<link>https://blog.sibvisions.com/2015/09/25/eclipse-mars-with-ant-and-jre-6-story/</link>
		<comments>https://blog.sibvisions.com/2015/09/25/eclipse-mars-with-ant-and-jre-6-story/#comments</comments>
		<pubDate>Fri, 25 Sep 2015 21:54:59 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[Eclipse]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=5045</guid>
		<description><![CDATA[Eclipse Mars is available since June 25th. We didn't update our IDEs because it wasn't needed. 
Some days ago we played around with JavaFXPorts Eclipse plugin. This plugin requires Eclipse Mars. So far so good. We made some tests with Mars, and everything was fine. We installed all required plugins for our internal and customer [...]]]></description>
			<content:encoded><![CDATA[<p>Eclipse Mars is available since June 25th. We didn't update our IDEs because it wasn't needed. </p>
<p>Some days ago we played around with <a href="http://gluonhq.com/open-source/javafxports/">JavaFXPorts</a> Eclipse plugin. This plugin requires Eclipse Mars. So far so good. We made some tests with Mars, and everything was fine. We installed all required plugins for our internal and customer projects and configured a first workspace....<br />
After everything was done, we tried to work with Eclipse Mars - no problems... BUT we have many projects with Java 6 compatibility. </p>
<p><strong>Why Java 6?</strong></p>
<p>Some big legacy projects/applications and Oracle Forms compatibility. There are more reasons, but it's not unusual to be backwards compatible, especially for frameworks and libraries!</p>
<p>Long story, short: <em>It's not possible to start an ANT task with Java 6</em>, because Java 7 is required. A nice error message appears:</p>
<p><center><strong>JRE version less than 1.7 is not supported.</strong></center></p>
<p>BUT it's still possible to choose any JRE in Runtime configuration dialog.<br />
Why shouldn't it be possible to start ANT with "any" JRE?</p>
<p>We tried to find help in the world wide web and found some postings about our problem:</p>
<p><a href="http://stackoverflow.com/questions/31052878/run-eclipse-mars-with-java-1-6">http://stackoverflow.com/questions/31052878/run-eclipse-mars-with-java-1-6</a><br />
<a href="http://stackoverflow.com/questions/31808102/eclipse-mars-ant-doesnt-support-jdk-1-6-anymore">http://stackoverflow.com/questions/31808102/eclipse-mars-ant-doesnt-support-jdk-1-6-anymore</a></p>
<p>And two bug database entries:</p>
<p><a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=474386">https://bugs.eclipse.org/bugs/show_bug.cgi?id=474386</a><br />
<a href="https://bugs.eclipse.org/bugs/show_bug.cgi?id=461031">https://bugs.eclipse.org/bugs/show_bug.cgi?id=461031</a></p>
<p>It's absolutely incomprehensible why the first ticket is in state: <strong>RESOLVED INVALID</strong> and the<br />
second one: <strong>VERIFIED FIXED</strong>.<br />
OK, the second one was for a different requirement, but the first one explains the problem.</p>
<p><strong>Why did the developer ignore the user requirement? </strong></p>
<p>It's possible to call ANT with "any" JRE, without Eclipse and other IDEs don't have such crazy limitations! We didn't plan to use another IDE just for building our software!</p>
<p>I can't live with recommended workarounds because suggested steps were not usuable with big projects!<br />
So, we tried to solve the problem for us. The source code of the ANT plugin is available <a href="http://git.eclipse.org/c/platform/eclipse.platform.git/refs/tags">here</a>, so it shouldn't be a problem to "fix" the problem.</p>
<p>After reading source code, we found that the only reason why it's not possible to use JREs < version 7, is Java 7 Syntax:</p>
<ul>
<li>Diamond operator, e.g. List&lt;MyObject&gt; list = new ArrayList<>();</li>
<li>try-with-resources, e.g. try (InputStream stream = createInputStream()) { ...}</li>
</ul>
<p>And of course, the plugin was configured for execution environment JavaSE-1.7. </p>
<p>Our solution: Removed Java version check in class <em>org.eclipse.ant.internal.launching.launchConfigurations.AntLaunchDelegate</em>, method launch:</p>
<div class="codesnip-container" >
<div class="java codesnip" style="font-family:monospace;"><span class="co1">//String path = configuration.getAttribute(IJavaLaunchConfigurationConstants.ATTR_JRE_CONTAINER_PATH, new String(&quot;&quot;)); //$NON-NLS-1$</span><br />
<span class="co1">//if (!path.isEmpty()) {</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; IPath jrePath = Path.fromPortableString(path);</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; IVMInstall vm = JavaRuntime.getVMInstall(jrePath);</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; if (vm instanceof AbstractVMInstall) {</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; AbstractVMInstall install = (AbstractVMInstall) vm;</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; String vmver = install.getJavaVersion();</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // versionToJdkLevel only handles 3 char versions = 1.5, 1.6, 1.9, etc</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (vmver.length() &gt; 3) {</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; vmver = vmver.substring(0, 3);</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; int ver = (int) (CompilerOptions.versionToJdkLevel(vmver) &gt;&gt;&gt; 16);</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; if (ver &lt; ClassFileConstants.MAJOR_VERSION_1_7) {</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // IStatus status = new Status(IStatus.ERROR, AntLaunching.PLUGIN_ID, 1,</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // AntLaunchConfigurationMessages.AntLaunchDelegate_Launching__0__2, null);</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; // throw new CoreException(status);</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }</span><br />
<span class="co1">//&nbsp; &nbsp; &nbsp; }</span><br />
<span class="co1">//}</span></div>
</div>
<p>We set the execution environment for <em>org.eclipse.ant.launching</em>, <em>org.eclipse.ant.core</em> and <em>org.eclipse.ant.ui</em> to JavaSE-1.6 and made the source code compatible with Java 6 syntax.</p>
<p>After we built the required jar files, we had problems with Eclipse, because there was something like a plugin cache (not sure what exactly). We made a test with <strong>-clean</strong> command line parameter and were happy. It was possible to start ANT tasks - with JRE 6 - without modifications, directly via Eclipse.</p>
<p>It's not difficult to create your own ANT plugin, but <a href="http://blog.sibvisions.com/wp-content/uploads/2015/09/ANT_plugin_JRE6_Mars.zip">here</a> are our jar files.<br />
The libs were built for</p>
<div class="codesnip-container" >Version: Mars Release (4.5.0)<br />
Build id: 20150621-1200</div>
<p>The tag-id of the ANT plugin source code: <strong>I20150430-1445</strong>.</p>
<p><strong>Installation?</strong></p>
<ul>
<li><a href="http://blog.sibvisions.com/wp-content/uploads/2015/09/ANT_plugin_JRE6_Mars.zip">Download the zip</a> archive, extract the content to &lt;eclipse_dir&gt;/plugins.</li>
<li>Start eclipse with parameter -clean (only once)</li>
<li>Configure JRE6 for your ANT task, via <em>Externals Tool configuration...</em></li>
</ul>
<p>Feel free to use our changed files but we don't guarantee that it doesn't destroy your Eclipse Mars installation <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
We didn't have any problems so far, but send us your impressions.</p>
<p>We didn't publish the changed source code right now, but let us know if you need it - it's still under EPL.</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2015/09/25/eclipse-mars-with-ant-and-jre-6-story/feed/</wfw:commentRss>
		<slash:comments>56</slash:comments>
		</item>
		<item>
		<title>Maven deployment via Ant</title>
		<link>https://blog.sibvisions.com/2013/07/16/maven-deployment-via-ant/</link>
		<comments>https://blog.sibvisions.com/2013/07/16/maven-deployment-via-ant/#comments</comments>
		<pubDate>Tue, 16 Jul 2013 13:48:44 +0000</pubDate>
		<dc:creator>rjahn</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[Ant]]></category>
		<category><![CDATA[JVx]]></category>
		<category><![CDATA[Maven]]></category>

		<guid isPermaLink="false">http://blog.sibvisions.com/?p=2361</guid>
		<description><![CDATA[We are no Maven lovers, because it helps to forget how things work. But we think the dependency management is useful. It's great for developers who need specific library versions without managing them manually.
The user aspect is one thing, but nobody tells you that it's not trivial to release libraries. One problem is the pre-deployment [...]]]></description>
			<content:encoded><![CDATA[<p>We are no Maven lovers, because it helps to forget how things work. But we think the dependency management is useful. It's great for developers who need specific library versions without managing them manually.</p>
<p>The user aspect is one thing, but nobody tells you that it's not trivial to release libraries. One problem is the pre-deployment process. Before you are able to deploy your jar files, you have to do a lot of things like GPG key generation, publishing GPG key, find the right repository, prepare your build, special pom cration and so on.</p>
<p>If you already have release builds with version numbers, javadoc and source archives, you'll save a lot of time. If you don't have complete and clean release builds - see you later.</p>
<p>Let's start with a good documentation about requirements:<br />
<a href="https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide">https://docs.sonatype.org/display/Repository/Sonatype+OSS+Maven+Repository+Usage+Guide</a></p>
<p>Of course, it assumes that you'll use Sonatype as your repository, but all others are not too different.</p>
<p>This posting is not a complete documentation. It simply shows the problems we had.</p>
<p><strong>Our simple pom files:</strong><br />
<a href="http://sourceforge.net/p/jvx/code/4829/tree/trunk/java/library/maven/jvxall/pom.xml">pom.xml (jvxall)</a><br />
<a href="http://sourceforge.net/p/jvx/code/4829/tree/trunk/java/library/maven/jvxclient/pom.xml">pom.xml (jvxclient)</a></p>
<p>The first is with dependencies and the second without, because our client doesn't have dependencies.</p>
<p>The real problems started with the integration in our ant script, because the documentation of Maven plugins were awful. It's easier to read the source code than to find out how plugins work. One example: Read following <a href="http://maven.apache.org/plugins/maven-gpg-plugin/sign-and-deploy-file-mojo.html">plugin documentation</a> and tell me the valid values for "types" and "classifier". There are no examples on the page! Google around and copy/paste a little bit - awful!</p>
<p><strong>Here's a working ant call</strong></p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;typedef</span> <span class="re0">resource</span>=<span class="st0">&quot;org/apache/maven/artifact/ant/antlib.xml&quot;</span> </span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">uri</span>=<span class="st0">&quot;antlib:org.apache.maven.artifact.ant&quot;</span> </span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">classpath</span>=<span class="st0">&quot;${build}/maven/maven-ant-tasks-2.1.3.jar&quot;</span> <span class="re2">/&gt;</span></span></p>
<p><span class="sc3"><span class="re1">&lt;condition</span> <span class="re0">property</span>=<span class="st0">&quot;gpgexecutable&quot;</span> </span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp;<span class="re0">value</span>=<span class="st0">&quot;C:\Program Files\GNU\GnuPG\pub\gpg.exe&quot;</span> <span class="re0">else</span>=<span class="st0">&quot;gpg&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;and<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;os</span> <span class="re0">family</span>=<span class="st0">&quot;Windows&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;/and<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/condition<span class="re2">&gt;</span></span></span></p>
<p><span class="sc3"><span class="re1">&lt;artifact:mvn<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;org.apache.maven.plugins:maven-gpg-plugin:1.4:sign-and-deploy-file&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Durl=${mvn.url}&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-DrepositoryId=${mvn.id}&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-DpomFile=${maven.tmp}/jvxall/pom.xml&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Dfile=${mvn.jvx.jar}&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Dfiles=${mvn.jvx.sources.jar},${mvn.jvx.javadoc.jar}&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Dclassifiers=sources,javadoc&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Dtypes=jar,jar&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Pgpg&quot;</span> <span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;arg</span> <span class="re0">value</span>=<span class="st0">&quot;-Dgpg.executable=${gpgexecutable}&quot;</span> <span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;/artifact:mvn<span class="re2">&gt;</span></span></span></div>
</div>
<p>Above call submits e.g. jvx-1.1.jar, jvx-1.1-javadoc.jar and jvx-1.1-sources.jar to the repository.</p>
<p>Why one call instead of 3 separate calls, as described in the documentation? </p>
<p><strong>Short:</strong> It's better <img src='https://blog.sibvisions.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /><br />
<strong>Long:</strong> It's better to submit all dependent files in one "maven session". Above call creates a new maven project and if you call this command per file, there's no logical connection between them. If you plan to deploy snapshot releases - forget it - it doesn't work with different calls because every upload gets a new buildnumber. But all files need the same buildnumber! Such deployments can't be used. If you read the Sonatype document, you saw that "deploy" task didn't deploy javadoc and sources! The "stage" task did. I'm not sure, but I think they had the same problem with separate uploads! Trust me, above call works with snapshots and final releases.</p>
<p><strong>Our naming conventions</strong></p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;mvn.jvx.jar&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;${release}/maven/${release.name}-${versionnumber}${maven.version.postfix}.jar&quot;</span> <span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;mvn.jvx.sources.jar&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;${release}/maven/${release.name}-${versionnumber}${maven.version.postfix}-sources.jar&quot;</span> <span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;mvn.jvx.javadoc.jar&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;${release}/maven/${release.name}-${versionnumber}${maven.version.postfix}-javadoc.jar&quot;</span> <span class="re2">/&gt;</span></span></div>
</div>
<p>(${maven.version.postfix} is <strong>-SNAPSHOT</strong> for snapshot releases and empty for final releases)</p>
<p><strong>Repository Id, URL</strong></p>
<p>${mvn.id} = sonatype-nexus-staging<br />
${mvn.url} = https://oss.sonatype.org/service/local/staging/deploy/maven2</p>
<p><strong>Other problems?</strong></p>
<p>Proxy settings for Maven, Use an external GPG key, Autentication. </p>
<p>If you copy the following settings.xml to &lt;users.home&gt;/.m2 and modify it to fit your needs, it should solve all problems:</p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span><span class="re2">?&gt;</span></span></p>
<p><span class="sc3"><span class="re1">&lt;settings<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;servers<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;server<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;id<span class="re2">&gt;</span></span></span>sonatype-nexus-snapshots<span class="sc3"><span class="re1">&lt;/id<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;username<span class="re2">&gt;</span></span></span>username<span class="sc3"><span class="re1">&lt;/username<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;password<span class="re2">&gt;</span></span></span>password<span class="sc3"><span class="re1">&lt;/password<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/server<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;server<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;id<span class="re2">&gt;</span></span></span>sonatype-nexus-staging<span class="sc3"><span class="re1">&lt;/id<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;username<span class="re2">&gt;</span></span></span>username<span class="sc3"><span class="re1">&lt;/username<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;password<span class="re2">&gt;</span></span></span>password<span class="sc3"><span class="re1">&lt;/password<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/server<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/servers<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;profiles<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;profile<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;id<span class="re2">&gt;</span></span></span>gpg<span class="sc3"><span class="re1">&lt;/id<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;properties<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;gpg.passphrase<span class="re2">&gt;</span></span></span>gpgkey<span class="sc3"><span class="re1">&lt;/gpg.passphrase<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/properties<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/profile<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/profiles<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;proxies<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;proxy<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;id<span class="re2">&gt;</span></span></span>firewall<span class="sc3"><span class="re1">&lt;/id<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;active<span class="re2">&gt;</span></span></span>true<span class="sc3"><span class="re1">&lt;/active<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;protocol<span class="re2">&gt;</span></span></span>http<span class="sc3"><span class="re1">&lt;/protocol<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;host<span class="re2">&gt;</span></span></span>10.0.0.1<span class="sc3"><span class="re1">&lt;/host<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;port<span class="re2">&gt;</span></span></span>3128<span class="sc3"><span class="re1">&lt;/port<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;username<span class="re2">&gt;</span></span><span class="re1">&lt;/username<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;password<span class="re2">&gt;</span></span><span class="re1">&lt;/password<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;nonProxyHosts<span class="re2">&gt;</span></span></span>localhost,127.0.0.1<span class="sc3"><span class="re1">&lt;/nonProxyHosts<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/proxy<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;proxy<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;id<span class="re2">&gt;</span></span></span>firewall-2<span class="sc3"><span class="re1">&lt;/id<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;active<span class="re2">&gt;</span></span></span>true<span class="sc3"><span class="re1">&lt;/active<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;protocol<span class="re2">&gt;</span></span></span>https<span class="sc3"><span class="re1">&lt;/protocol<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;host<span class="re2">&gt;</span></span></span>10.0.0.1<span class="sc3"><span class="re1">&lt;/host<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;port<span class="re2">&gt;</span></span></span>3128<span class="sc3"><span class="re1">&lt;/port<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;username<span class="re2">&gt;</span></span><span class="re1">&lt;/username<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;password<span class="re2">&gt;</span></span><span class="re1">&lt;/password<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;nonProxyHosts<span class="re2">&gt;</span></span></span>localhost,127.0.0.1<span class="sc3"><span class="re1">&lt;/nonProxyHosts<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/proxy<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/proxies<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/settings<span class="re2">&gt;</span></span></span></div>
</div>
<p>We configured the proxy via ant build.xml</p>
<div class="codesnip-container" >
<div class="xml codesnip" style="font-family:monospace;"><span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;proxy.check&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;condition</span> <span class="re0">property</span>=<span class="st0">&quot;proxy.enabled&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;and<span class="re2">&gt;</span></span></span><br />
&nbsp; &nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;socket</span> <span class="re0">server</span>=<span class="st0">&quot;10.0.0.1&quot;</span> <span class="re0">port</span>=<span class="st0">&quot;3128&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <span class="sc3"><span class="re1">&lt;/and<span class="re2">&gt;</span></span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;/condition<span class="re2">&gt;</span></span></span><br />
<span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></p>
<p><span class="sc3"><span class="re1">&lt;target</span> <span class="re0">name</span>=<span class="st0">&quot;proxy&quot;</span> <span class="re0">depends</span>=<span class="st0">&quot;proxy.check&quot;</span> <span class="re0">if</span>=<span class="st0">&quot;proxy.enabled&quot;</span><span class="re2">&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;proxy.host&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;10.0.0.1&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;proxy.port&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;3128&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;proxy.user&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; <span class="sc3"><span class="re1">&lt;property</span> <span class="re0">name</span>=<span class="st0">&quot;proxy.pass&quot;</span> <span class="re0">value</span>=<span class="st0">&quot;&quot;</span><span class="re2">/&gt;</span></span><br />
&nbsp; &nbsp; <br />
&nbsp; <span class="sc3"><span class="re1">&lt;setproxy</span> <span class="re0">proxyhost</span>=<span class="st0">&quot;${proxy.host}&quot;</span> <span class="re0">proxyport</span>=<span class="st0">&quot;${proxy.port}&quot;</span> </span><br />
<span class="sc3"> &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="re0">proxyuser</span>=<span class="st0">&quot;${proxy.user}&quot;</span> <span class="re0">proxypassword</span>=<span class="st0">&quot;${proxy.password}&quot;</span><span class="re2">/&gt;</span></span><br />
<span class="sc3"><span class="re1">&lt;/target<span class="re2">&gt;</span></span></span></div>
</div>
<p>Simply add "proxy" task as dependency of another task.</p>
<p>Maybe it's easier to release libraries with other build systems or maybe it works out-of-the-box with Maven itself, but the whole process is really bad.</p>
<p>Good luck!</p>
]]></content:encoded>
			<wfw:commentRss>https://blog.sibvisions.com/2013/07/16/maven-deployment-via-ant/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
