<?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>Developers, Developers, Developers! &#187; dependency</title>
	<atom:link href="http://maksim.sorokin.dk/it/tag/dependency/feed/" rel="self" type="application/rss+xml" />
	<link>http://maksim.sorokin.dk/it</link>
	<description>Maksim Sorokin IT Blog</description>
	<lastBuildDate>Sun, 05 Feb 2012 19:37:38 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.3</generator>
		<item>
		<title>Maven + Apache Felix: Strategy to Handle non-OSGi Dependencies</title>
		<link>http://maksim.sorokin.dk/it/2011/08/09/maven-apache-felix-strategy-to-handle-non-osgi-dependencies/</link>
		<comments>http://maksim.sorokin.dk/it/2011/08/09/maven-apache-felix-strategy-to-handle-non-osgi-dependencies/#comments</comments>
		<pubDate>Tue, 09 Aug 2011 16:06:47 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[Apache Felix]]></category>
		<category><![CDATA[dependency]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[OSGi]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=821</guid>
		<description><![CDATA[This is another post in Maven + Apache Felix + CXF + DOSGi series. Sometimes in the project plain Maven dependencies has to be used. A simple strategy to use those in OSGi project handled by Maven is to have a separate module, containing all non-OSGi dependencies and converting those to OSGi bundles using Apache [...]]]></description>
			<content:encoded><![CDATA[<p>This is another post in <a href="http://maksim.sorokin.dk/it/2011/07/19/maven-apache-felix-cxf-dosgi-series/">Maven + Apache Felix + CXF + DOSGi series</a>.</p>
<p>Sometimes in the project plain Maven dependencies has to be used. A simple strategy to use those in OSGi project handled by Maven is to have a separate module, containing all non-OSGi dependencies and converting those to OSGi bundles using <a href="http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html">Apache Felix Maven Bundle Plugin</a>.<br />
So one may have the following structure of the project:</p>
<pre class="brush: plain; title: ;">
project
    ...
    project.nonOsgiDependencies
        project.nonOsgiDependencies.base64
        project.nonOsgiDependencies.mysqlConnector
        project.nonOsgiDependencies.xercesImpl
</pre>
<p>This <code>nonOsgiDependencies</code> projects would contain <span id="more-821"></span> just a <code>pom.xml</code> file, which would have a dependency on required maven dependency and would use <a href="http://felix.apache.org/site/apache-felix-maven-bundle-plugin-bnd.html">maven-bundle-plugin</a> to wrap it. Here is an example of such <code>pom.xml</code> for <code>net.iharder:base64</code></p>
<pre class="brush: xml; title: ;">
&lt;project xmlns=&quot;http://maven.apache.org/POM/4.0.0&quot; xmlns:xsi=&quot;http://www.w3.org/2001/XMLSchema-instance&quot;
  xsi:schemaLocation=&quot;http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd&quot;&gt;
  &lt;modelVersion&gt;4.0.0&lt;/modelVersion&gt;

  &lt;parent&gt;
    &lt;artifactId&gt;project.nonOsgiDependencies&lt;/artifactId&gt;
    &lt;groupId&gt;dk.sorokin.maksim&lt;/groupId&gt;
    &lt;version&gt;1.0.0-SNAPSHOT&lt;/version&gt;
  &lt;/parent&gt;

  &lt;artifactId&gt;ecosystem.nonOsgiDependencies.base64&lt;/artifactId&gt;

  &lt;name&gt;net.iharder:base64 Maven Dependency&lt;/name&gt;

  &lt;build&gt;
    &lt;plugins&gt;
      &lt;plugin&gt;
        &lt;groupId&gt;org.apache.felix&lt;/groupId&gt;
        &lt;artifactId&gt;maven-bundle-plugin&lt;/artifactId&gt;
        &lt;executions&gt;
          &lt;execution&gt;
            &lt;id&gt;wrap-dependency&lt;/id&gt;
            &lt;goals&gt;
              &lt;goal&gt;bundle&lt;/goal&gt;
            &lt;/goals&gt;
            &lt;configuration&gt;
              &lt;instructions&gt;
                &lt;Embed-Dependency&gt;*&lt;/Embed-Dependency&gt;
                &lt;Export-Package&gt;net.iharder&lt;/Export-Package&gt;
              &lt;/instructions&gt;
            &lt;/configuration&gt;
          &lt;/execution&gt;
        &lt;/executions&gt;
      &lt;/plugin&gt;
    &lt;/plugins&gt;
  &lt;/build&gt;

  &lt;dependencies&gt;
    &lt;dependency&gt;
      &lt;groupId&gt;net.iharder&lt;/groupId&gt;
      &lt;artifactId&gt;base64&lt;/artifactId&gt;
      &lt;version&gt;2.3.8&lt;/version&gt;
    &lt;/dependency&gt;
  &lt;/dependencies&gt;
&lt;/project&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2011/08/09/maven-apache-felix-strategy-to-handle-non-osgi-dependencies/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Philosophy Differences between Eclipse and Maven in Dependency Management</title>
		<link>http://maksim.sorokin.dk/it/2010/11/14/philosophy-differences-between-eclipse-and-maven-in-dependency-management/</link>
		<comments>http://maksim.sorokin.dk/it/2010/11/14/philosophy-differences-between-eclipse-and-maven-in-dependency-management/#comments</comments>
		<pubDate>Sun, 14 Nov 2010 15:35:19 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dependency]]></category>
		<category><![CDATA[Eclipse]]></category>
		<category><![CDATA[maven]]></category>
		<category><![CDATA[OSGi]]></category>
		<category><![CDATA[PDE]]></category>
		<category><![CDATA[tycho]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=418</guid>
		<description><![CDATA[Title of this post is a bit cumbersome. I want to discuss how Eclipse-OSGi world works with dependencies and compare it with Maven world. In Eclipse-OSGi world dependencies usually are defined with a range. For example: Require-Bundle: org.eclipse.ui, dk.sorokin.maksim;bundle-version=&#34;[2.0.0,3.0.0)&#34;, Numbers in build number x.y.z are meant to be x -- changes in API. Downstreamers should [...]]]></description>
			<content:encoded><![CDATA[<p>Title of this post is a bit cumbersome. I want to discuss how Eclipse-OSGi world works with dependencies and compare it with Maven world.</p>
<p>In Eclipse-OSGi world dependencies usually are defined with a range. For example:</p>
<pre class="brush: plain; title: ;">
Require-Bundle: org.eclipse.ui,
 dk.sorokin.maksim;bundle-version=&quot;[2.0.0,3.0.0)&quot;,
</pre>
<p>Numbers in build number <code>x.y.z</code> are meant to be</p>
<ul>
<li><code>x</code> -- changes in API. Downstreamers should expect code breaking. Non-backwards compatible code.</li>
<li><code>y</code> -- changes, which might lead to code breaking.</li>
<li><code>z</code> -- bugfixes</li>
</ul>
<p>Eclipse-OSGi world basically does not have understanding of "released" product. Built product is always "released" (if exposed to the public). Moreover, <em>build number does not necessarily change</em>. Thefore Eclipse-OSGi guys have problems, if they depend on online repositories. Because at any time new version of dependency with higher minor build number may appear and code may break.<br />
What Eclipse-OSGi do then? Well, it is simple. They do not use online repositories! They used "frozen" version of those, for example by using standalone Eclipse installation as target platform. Usually this "frozen" target platform is being renewed at the beginning of each sprint.</p>
<p>Let's take a look on Eclipse-OSGi dependency management world from Maven perspective. Eclipse-OSGi world guys have SNAPSHOTs, but do not have releases. That is, you <em>always grab the latest available version</em> (of course, in possible range). Obviously, if we look from this perspective, it is very dangerous to depend on latest SNAPSHOT version.<br />
In Maven world released products <em>have to depend on released versions of dependencies</em>. Moreover, when product is released, you are <em>forced</em> to change the build number. So there is no two releases with to numbers. Of course you can cheat and delete released product from maven repository and put another one, but at least you are guarded from doing that.</p>
<p>Ok, now why that matters. Lately more and more companies use Eclipse platform to build their products. And many development departments use maven heavily in the development process. Therefore they want to benefit from having maven to build Eclipse products. Tycho project allows to do that. However, beside many missing features in Tycho, there is a clashes between maven and Eclipse-OSGi world dependency ideology.</p>
<p>We already have some solutions and ideas to solve dependencies situation. However, let's wait with those until next posts..</p>
<p>Thanks to Tony Madsen for clarifications.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2010/11/14/philosophy-differences-between-eclipse-and-maven-in-dependency-management/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Dumping Maven Dependencies to Specific Folder</title>
		<link>http://maksim.sorokin.dk/it/2010/07/04/dumping-maven-dependencies-to-specific-folder/</link>
		<comments>http://maksim.sorokin.dk/it/2010/07/04/dumping-maven-dependencies-to-specific-folder/#comments</comments>
		<pubDate>Sun, 04 Jul 2010 07:27:36 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[dependency]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=270</guid>
		<description><![CDATA[In order to dump all specified dependencies, which are specified in pom.xml, one has to use Maven Dependency Plugin: &#60;plugin&#62; &#60;artifactId&#62;maven-dependency-plugin&#60;/artifactId&#62; &#60;executions&#62; &#60;execution&#62; &#60;phase&#62;package&#60;/phase&#62; &#60;goals&#62; &#60;goal&#62;copy-dependencies&#60;/goal&#62; &#60;/goals&#62; &#60;configuration&#62; &#60;outputDirectory&#62;${dependencies.dir}&#60;/outputDirectory&#62; &#60;/configuration&#62; &#60;/execution&#62; &#60;/executions&#62; &#60;/plugin&#62; where ${dependencies.dir} stands for folder where to dump the dependencies.]]></description>
			<content:encoded><![CDATA[<p>In order to dump all specified dependencies, which are specified in <code>pom.xml</code>, one has to use <a href="http://maven.apache.org/plugins/maven-dependency-plugin/plugin-info.html">Maven Dependency Plugin</a>:</p>
<pre class="brush: xml; title: ;">
  &lt;plugin&gt;
	&lt;artifactId&gt;maven-dependency-plugin&lt;/artifactId&gt;
	&lt;executions&gt;
	  &lt;execution&gt;
		&lt;phase&gt;package&lt;/phase&gt;
		&lt;goals&gt;
		  &lt;goal&gt;copy-dependencies&lt;/goal&gt;
		&lt;/goals&gt;
		&lt;configuration&gt;
		  &lt;outputDirectory&gt;${dependencies.dir}&lt;/outputDirectory&gt;
		&lt;/configuration&gt;
	  &lt;/execution&gt;
	&lt;/executions&gt;
  &lt;/plugin&gt;
</pre>
<p>where <code>${dependencies.dir}</code> stands for folder where to dump the dependencies.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2010/07/04/dumping-maven-dependencies-to-specific-folder/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Why Cyclic Project Dependencies Are Bad</title>
		<link>http://maksim.sorokin.dk/it/2010/06/18/why-cyclic-project-dependencies-are-bad/</link>
		<comments>http://maksim.sorokin.dk/it/2010/06/18/why-cyclic-project-dependencies-are-bad/#comments</comments>
		<pubDate>Fri, 18 Jun 2010 11:31:03 +0000</pubDate>
		<dc:creator>Maksim Sorokin</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[build server]]></category>
		<category><![CDATA[dependency]]></category>
		<category><![CDATA[maven]]></category>

		<guid isPermaLink="false">http://maksim.sorokin.dk/it/?p=248</guid>
		<description><![CDATA[Imagine you have a project projectA with submodules projectA.module1 and projectA.module2 a project projectB projectB dependes on projectA.module1. projectA.module2 depends on projectA.module1 too and on projectB. What is wrong here? Cyclic dependency! When projectA is built, its submodules projectA.module1 and projectA.module are built too. In your build server, for example, it may cause a infinity [...]]]></description>
			<content:encoded><![CDATA[<p>Imagine you have</p>
<ul>
<li>a project <code>projectA</code> with submodules
<ul>
<li><code>projectA.module1</code> and</li>
<li> <code>projectA.module2</code></li>
</ul>
</li>
<li>a project <code>projectB</code></li>
</ul>
<p><code>projectB</code> dependes on <code>projectA.module1</code>.<br />
<code>projectA.module2</code> depends on <code>projectA.module1</code> too and on <code>projectB</code>.</p>
<p>What is wrong here? Cyclic dependency! When <span id="more-248"></span><code>projectA</code> is built, its submodules <code>projectA.module1</code> and <code>projectA.module</code> are built too. In your build server, for example, it may cause a infinity build loop when project is built whenever dependencies are built! So in this case it would be a great idea to move module <code>projectA.module1</code> away from <code>projectA</code>.</p>
]]></content:encoded>
			<wfw:commentRss>http://maksim.sorokin.dk/it/2010/06/18/why-cyclic-project-dependencies-are-bad/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

