<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/css" href="/stylesheets/rss.css"?>
<rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/">
  <channel>
    <title>BlackBox : Tag maven</title>
    <link>http://www.warneronstine.com/blog/articles/tag/maven</link>
    <language>en-us</language>
    <ttl>40</ttl>
    <description>Where technology and art disappear</description>
    <item>
      <title>Is Maven going away?</title>
      <description>&lt;p&gt;First, let me say, I like &lt;a href="http://maven.apache.org"&gt;Maven&lt;/a&gt; - a lot. I&amp;#8217;ve liked the idea, if not the execution, since 1.0 (yes, I know there is some serious bad blood for the implementation of 1.0, and yes I still liked it). But I&amp;#8217;ve recently run into some irritating problems with Maven that would again, I think, require a major reworking of what it does.&lt;/p&gt;

&lt;p&gt;Here is the main issue Maven is designed to handle one language only for its compilation - primarily Java. This is rapidly starting to fall apart now that the JVM has some serious contenders besides Java, namely &lt;a href="http://groovy.apache.org"&gt;Groovy&lt;/a&gt;, &lt;a href="http://jruby.codehaus.org/"&gt;JRuby&lt;/a&gt;, &lt;a href="http://www.jython.org/"&gt;Jython&lt;/a&gt;, and &lt;a href="http://www.scala-lang.org/"&gt;Scala&lt;/a&gt;. There are some hackish things for getting Maven to deal with these, however it still only has one &amp;#8220;true&amp;#8221; source directory for compilation. A case in point is a mixed Java/Groovy project - trying to get &lt;a href="http://www.jetbrains.com/idea/"&gt;IntelliJ&lt;/a&gt; to respect the fact that I want not one, but two main source directories is a pain in the ass as I have to either tell it not to sync everytime I launch or I have to refix the source directories each time I update the project. &lt;/p&gt;

&lt;p&gt;This is what triggered this post - what happens when I want to do some &lt;a href="http://labs.adobe.com/technologies/flex/"&gt;Flex&lt;/a&gt; programming with some Java, ActionScript and MXML, all of these are true source files (and in Maven specfic directories). I&amp;#8217;m sure some Mavenite is going to say that these should be separate projects, but in alot of cases they aren&amp;#8217;t and it doesn&amp;#8217;t make sense to actually separate them into sub-projects. And I&amp;#8217;m equally as sure that some Ant-ite is going to come along and tell me to use &lt;a href="http://ant.apache.org/"&gt;Ant&lt;/a&gt; - I won&amp;#8217;t. Ant is stuck in the past and I won&amp;#8217;t use it unless I absolutely have to. I like the &amp;#8220;imposed&amp;#8221; structure that Maven offers. I can walk up to any project and know where  to find stuff instead of blindly hunting around for hours trying to piece it together like some giant source-code jigsaw puzzle, blech.&lt;/p&gt;

&lt;p&gt;So, I&amp;#8217;m at cross-roads, what should I do? There is &lt;a href="http://ant.apache.org/ivy/"&gt;Ivy&lt;/a&gt; (for dependency management -which they got from Maven natch), but that requires Ant, blech. There&amp;#8217;s also &lt;a href="http://gant.codehaus.org/"&gt;Gant&lt;/a&gt;, ok, this is better, but still Ant. &lt;a href="http://groovy.codehaus.org/GMaven"&gt;GMaven&lt;/a&gt;, but I&amp;#8217;m right back where I started.&lt;/p&gt;

&lt;p&gt;Enter, &lt;a href="http://www.gradle.org/"&gt;Gradle&lt;/a&gt;, a new Groovy-based build system that offers alot of the benefits of Maven without locking you in and the flexibility of Ant. I&amp;#8217;m not 100% sold on it yet, but I&amp;#8217;m going to give it a shot for a relatively complex project that will have a fair amount of Java, Groovy and other fun resource files. It looks interesting in that all the build files are actually Groovy scripts that are a DSL (like Gant files). Here&amp;#8217;s a short example with some dependencies (taken directly from their examples in the download).&lt;/p&gt;

&lt;pre&gt;&lt;code&gt;import org.gradle.api.tasks.util.FileSet

usePlugin('groovy')

group = 'org.gradle'
version = '1.0'

sourceCompatibility = 1.5
targetCompatibility = 1.5

dependencies {
   clientModule(['groovy'], ":groovy-all:1.6-beta-1") {
       dependency(":commons-cli:1.0")
   }
   compile project(':groovycDetector')
   testCompile ":junit:4.4"
}

compile {
   exclude('**/Exclude.java')
   groovyExclude('**/ExcludeGroovy.groovy')
   groovyJavaExclude('**/ExcludeGroovyJava.java')
}

manifest.mainAttributes(myprop: 'myvalue')
metaInf &amp;lt;&amp;lt; new FileSet(new File(srcRoot, 'metaInfFiles'))

test.options.systemProperties['org.gradle.integtest.buildDir'] = buildDir.absolutePath
&lt;/code&gt;&lt;/pre&gt;

&lt;p&gt;I will try and keep everyone up to date as I continue to investigate this new build system. They also state that they are going to be supporting polyglot programming in the near future which I&amp;#8217;m looking forward to.&lt;/p&gt;</description>
      <pubDate>Sun, 06 Jul 2008 07:49:33 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:f693853e-5003-4e42-bab5-7bf1838bfc9f</guid>
      <author>Warner Onstine</author>
      <link>http://www.warneronstine.com/blog/articles/2008/07/06/is-maven-going-away</link>
      <category>programming</category>
      <category>maven</category>
      <category>java</category>
      <category>groovy</category>
      <category>scala</category>
      <category>polyglot</category>
      <trackback:ping>http://www.warneronstine.com/blog/articles/trackback/321</trackback:ping>
    </item>
    <item>
      <title>First Maven plugin</title>
      <description>&lt;p&gt;I&amp;#8217;ve been working on &lt;a href="http://warneronstine.com/cgi-bin/trac.cgi"&gt;Chama&lt;/a&gt; recently and have been making some good progress. One of the last big hurdles before getting all of the Model, View, Controller generation working has been:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Connecting to a database and gathering metadata - 90% complete (just have the relationship, primary key, foreign key stuff to work out)&lt;/li&gt;
&lt;li&gt;Getting Chama packaged up as a real distributable app that you can download and get up and going quickly&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Rather than go through a whole bunch of Ant copy scripts and integrating that with my Maven build I decided to write a plugin that would copy everything over into a specific directory structure and zip up for me (and I can also add in the tar.gz stuff real easy now too). I gotta say it wasn&amp;#8217;t &lt;em&gt;too&lt;/em&gt; difficult, although the docs leave a lot to be desired in this department. With all the plugins out there you would think this would be more fleshed out, especially since they want everyone to move away from the old Jelly scripts that people wrote in Maven 1. Anyways, it&amp;#8217;s fairly simple to do with some caveats.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;There appear to be no docs on what all the custom expressions are such as:
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;expression="${project}"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;expression="${project.build.directory}"&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;expression="${component.org.codehaus.plexus.archiver.manager.ArchiverManager}"&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;li&gt;Or if you can actually use expressions like these when setting default values of properties (you can, at least that&amp;#8217;s what I&amp;#8217;ve gathered by looking at other plugins)&lt;/li&gt;
&lt;li&gt;And if you do or do not need to have getters and setters for your variables that you&amp;#8217;ve &amp;#8220;annotated&amp;#8221; (I say that in quotes because it doesn&amp;#8217;t act like true annotations, or at least there isn&amp;#8217;t a package in Maven called annotations where you can find docs on all of these)
&lt;ul&gt;
&lt;li&gt;My assumption is that at least the setters are necessary so that it can use those to populate the variables you want Maven to populate your plugin with)&lt;/li&gt;
&lt;/ul&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;All that said it was mostly easy to write my little packaging plugin as I was willing to dig through the source code of some of the existing plugins that were doing similar things (&lt;a href="http://svn.apache.org/viewvc/maven/plugins/trunk/maven-assembly-plugin/"&gt;maven-assembly-plugin&lt;/a&gt; and &lt;a href="http://svn.apache.org/viewvc/maven/plugins/trunk/maven-war-plugin/"&gt;maven-war-plugin&lt;/a&gt;). That isn&amp;#8217;t to say that I&amp;#8217;m 100% sure I understand exactly how everything works (good idea but not 100% ;-).&lt;/p&gt;

&lt;p&gt;If I get a chance I&amp;#8217;ll see if I can contribute something a little more to the plugin docs than what is there currently because others shouldn&amp;#8217;t have to do what I did to get through this and it isn&amp;#8217;t that difficult once you know the secret handshake.&lt;/p&gt;</description>
      <pubDate>Thu, 21 Dec 2006 22:04:27 -0700</pubDate>
      <guid isPermaLink="false">urn:uuid:7c902436-527a-4d5b-ae69-e3372e899787</guid>
      <author>Warner Onstine</author>
      <link>http://www.warneronstine.com/blog/articles/2006/12/21/first-maven-plugin</link>
      <category>programming</category>
      <category>maven</category>
      <category>java</category>
      <category>chama</category>
      <trackback:ping>http://www.warneronstine.com/blog/articles/trackback/231</trackback:ping>
    </item>
  </channel>
</rss>
