Sign in

E-mail *, (xx@domain.com)
Password *

Register | Forgot password

Maven 3

The "General Discussion" covers general questions about GX WebManager. In this forum you can discuss all topics of GX WebManager which are not covered in one of the specific forums below.

Answered
Not marked as answered yet

Forums  >  General discussion  >  Maven 3


Author Maven 3
Cthulhu



Posts: 212

Posted: 23-10-2009 12:08

(I'm not entirely sure if you guys like me opening up a thread not directly related to WebManager, but I just thought this was interesting. If you disagree, feel free to yell at me)

I've sorta accidentally stumbled on something that said Maven 3 is in the works, and supposedly it's got a bunch of new features. So far, it's mainly an update of its internal structures, working out some of the problems present in Maven 2, but I'm sure I'll figure out more things as I go along.

Beforehand, I'd first like to say that Maven 3 is backwards compatible to Maven 2 - or at least, according to their integration tests. This means that you should be able to use your existing WCB pom.xml files alongside Maven 3, and gradually take advantage of its new and improved features.

One of the first things that jump out of the list of new features is the fact that you're no longer bound to the (overly?) verbose XML for pom configuration. Maven 3 comes with a pluggable interpreter of sorts, allowing anyone to write a parser for their own POM format. The first language that was displayed was Groovy, a scripting language that (if I have it right) can compile to Java code. But I'm not too familiar with that.

The results?

Before:


<dependencies>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.5</version>
<scope>test</scope>
</dependency>
</dependencies



After:


dependencies {
dependency {
groupId 'junit'
artifactId 'junit'
version '4.5'
scope 'test'
}
}



or, more compact (with 3 dependencies now):


dependencies {
dependency { groupId 'junit'; artifactId 'junit'; version '4.7'; scope 'test' }
dependency { groupId 'org.hamcrest'; artifactId 'hamcrest-all'; version '1.1' }
dependency { groupId 'log4j'; artifactId 'log4j'; version '1.2.12' }
}



And it'd be even more concise if you'd use YAML (read: less braces, quotes, semicolons), which I'm sure some smart fellow would make soon:


dependencies:
dependency:
groupId: junit
artifactId: junit
version: 4.5
scope: test



Of course, anything from plaintext (CSV ftw) to Brainfuck (pardon my french) would be possible with this approach. Internally it'd just get translated to Maven's old XML format, of course, but that doesn't matter to real people that have to work with it.

You can view the slides of Jason van Zyl (go Dutch roots) on Scribd, or a video of his presentation from last April (or so) on the Sonatype blog.

patricka



Posts: 280

Posted: 24-10-2009 15:04

Tomato, tomahto IMHO.

Now if that interpreter would actually run some code, that would be interesting. Although it would make things pretty complex; it's hard enough to model your project, imagine the horror if that model were to be dynamic... *cringe*

Greetings,

Patrick

williamb



Posts: 310

Posted: 24-10-2009 17:57

What would hit me is if mvn would offer some gui tools instead of command line.

Like our archetype: it's .... to copy paste those lines into cmd. A nice GUI would be awesome.

patricka



Posts: 280

Posted: 26-10-2009 11:49

You would probably like the pom.xml editor of m2eclipse, William.

A colleague was trying to figure out a way to check out archetypes straight from Eclipse, but I fear he encountered problems there. Would be very interesting to get it to work, though.

Greetings,

Patrick

williamb



Posts: 310

Posted: 27-10-2009 17:58

Patrick,

what was the reason again that we didn't use m2eclipse? The was something with it, right (I remember trying some year back)? Or should I go ahead and use it!

Cthulhu



Posts: 212

Posted: 29-10-2009 12:12

William, because XML > all GUI tools? .

I have m2eclipse and the graphical editor, but I still prefer to edit the XML directly. And I had a problem with updating a value somewhere taking a minute or so before it had processed all the characters, but that seems to have been fixed.

As for a dynamic POM, I can't see the benefits in it :/. Replacement variables as they are right now (parent.version etc) are fine to me. And you can already have a number of profiles for different build types (regular compile, test, deploy etc), although those often have lots of duplicate entries (which should be fixable with Maven 3).

Back to top

New message: "Maven 3"
Message:
bold boitalicd underline url quote code smile cool eek grin mad razz sad wink
 
© 2012 GX Software B.V.

Disclaimer

This website (Connect.gxsoftware.com) may discuss or contain opinions, (sample) coding, software or other information that does not include GX official interfaces, instructions or guidelines and therefore is not supported by GX. Changes made based on this information are not supported.  GX will not be held liable for any damages caused by using or misusing the information, software, instructions, code or methods suggested on this website, and anyone using these methods does so at his/her own risk. GX offers no guarantees and assumes no responsibility or liability of any type with respect to the content of this website, including any liability resulting from incompatibility between the content of this website and the materials and services offered by GX. By using this website you will not hold, or seek to hold, GX responsible or liable with respect to the content of this website.