I am investigating the use of Maven 3's support for Groovy poms to aid the build process within my team.
From my initial readings, I can only find articles from 2 years ago mentioning it as a feature, although not part of core Maven.
Link to Polyglot Maven seem to redirect to the Sonatype homepage.
I have read the answer to this related question, I don't fully understand what it means.
Does this mean that Maven 3 supports the generation of Groovy poms or not? Would appreciate it someone could explain in simple terms as to what this means.
Thanks
It looks like Jason van Zyl, who is the founder of the Maven project and the CTO of Sonatype, is working on it, in sort of a private beta. It is not a part of the released version of Maven 3.
See this email from Jason
What's the problem with the build process? Do you need groovy poms to get it into your team? pom.xml files will usually not written by hand. You should IDE's for that purpose. Maven 3 does not support of Groovy pom's.
Related
As I am new to learn either maven or Gradle build tools. Therefore I wonder which one I select to study between maven and Gradle and which one has more requirement and demand in the industry. I want to use these build tools for Spring and Hibernate based projects. Any suggestion would be very helpful.
Thanks
Before this is closed for "not being a good question", I'll get some comments in.
You might want to learn the same thing that most other developers want to learn. Look at the third slide of the following slideware, which shows the results of Zeroturnaround's yearly developer survey. For this set of >2k developers, when asked what technologies they were interested in learning, Gradle was at the top of the list.
You can use either Maven or Gradle to build projects using Spring or Hibernate, but it's useful to point out that both the Spring and Hibernate code bases (not necessarily the applications using them) use Gradle to build their deliverables.
Maven provided the best build solution for quite a few years, but it's difficult to customize a build, and most Maven build scripts are very "noisy". Gradle solves those problems, while providing a smooth migration path from Maven or even Ant.
I´ve been reading lot about, but since there are several web frameworks that uses Maven for the project, I got confused, so I´m not entirely sure if Maven is an archetype that defines an schema to start developing apps by following good practices, or is just some piece of sdk that converts my code to bytecode. Thanks in advance to anyone who can drag me out of my confusion and gave me the required info. BTW is that rigth to say an archetype is a directory structure?
I am not sure if you are reading enough about maven, Maven is a build system which can help you build your application, manage your dependencies, run your tests, create reports and many other things.
First link in google result is http://maven.apache.org/
Apache Maven is a software project management and comprehension tool.
Based on the concept of a project object model (POM), Maven can manage
a project's build, reporting and documentation from a central piece of
information.
Each application has many dependencies and many small tasks that needs to be done before you can run your application, developers define them in a file called POM and that will be a instruction for Maven to build the application. Maven can do pretty much everything other than writing your code. In that sense it is like Genie in the story of Aladdin, you wish for something it will bring it for you.
There is a Grails maven plugin that can populate Grails project with the same convention that Grails uses. It can work with Grails to execute your commands and many other. More importantly it will manage your dependencies.
What happened to the Maven Polyglot project that used to be at http://polyglot.sonatype.org/?
As described in this article,
One exciting new feature in Maven 3 is it's ability to work with pom files written in non-XML notations. The Maven core now provides an underlying DSL to access the Maven internals, and write POM files in the language of your choice. This currently includes scripting languages like Groovy, Ruby, and others. In short, you will be able to write a DSL for virtually any scripting language you like that can hook into the Maven internals and pilot the Maven build process.
There are several additional articles on the web that I've found referencing the feature.
http://www.thinkplexx.com/learn/article/maven-learn-material/maven3/maven3-pom-using-groovy-ruby-scala-yaml-sonatype-polyglot
http://mattgivney.blogspot.com/2011/05/maven-3-polyglot-support.html
But the polyglot site now redirects to sonatype.org and I can find no mention of this feature in the Maven 3 release notes.
So what happened? Was it cut or is it in there and just not documented in the release notes? If it did make the cut for Maven 3 could you point to some documentation. I am also interested in the translator tool mentioned by the first article I linked to.
This project is now named tesla-polyglot. I've just completed the Scala DSL for it, and tesla-polyglot should be released very soon now. We're just waiting on Maven 3.1.1 to roll out of the door.
There has been an update on the maven users list from Jason van Zyl: http://maven.40175.n5.nabble.com/What-happened-to-Polyglot-Maven-td5715529.html
I'm still working on it along with a few others. Dhanji has the Atom markup working, Kristian has implemented a Ruby DSL, and Jason Dillon has implemented a Groovy DSL which creates synthetic plugins to bind arbitrary scripting to Maven's lifecycle. My original was to see how Maven's infrastructure could be leveraged by other markups and DSLs. These examples do render to an interoperable format insofar as consumers go. Maven itself obviously cannot run a Ruby DSL but if you like the Ruby DSL you can use it to build an not affect consumers: you can build and deploy to a Maven repository and someone else can consume the dependency with stock Maven.
I have all the early adopters I can deal with one-on-one right now, because I can't deal with many really, but if you have more than a passing interest feel free to email me privately.
looks like it is still alive :-)
You won't believe it, but it's released (if you can call a 0.1 version a release).
As of April 2016,
the home page is https://github.com/takari/polyglot-maven ,
the latest release is 0.1.15
There is Polyglot Maven IDE Pack for Eclipse, that includes some plugins.
There is also maven-tiles project https://github.com/repaint-io/maven-tiles ,
and quick trying out what Maven flavor works well shows that Groovy does better than others.
Be aware of Babylon Tower problem, so it is actually better when most of developers use the same flavor.
The latest info comes from here
"Polyglot for Maven is still moving along and we've seen a lot of activity recently on the Ruby DSL by Cristian Meier from the JRuby team, and the Scala DSL by Chris Hunt from Typesafe. We hope that this initial work can serve as inspiration for helping the POM evolve. For those interested in what the XML alternatives can look like you can take a look at the existing implementations:
Ruby DSL
Groovy DSL
Scala DSL
YAML
Atom"
Can anyone explain me, for what purpose we will use Maven with seleniumRC or WebDriver? Is it like ANT - build.xml?
Your help will kindly appreciated!!
Thanks,
mra
Maven's original purpose was to handle transitive dependency management, so a developer needed only specify their "top-level" dependencies (e.g., I need Spring version n.n and webdriver version x.y).
Those dependencies have their own dependencies. Resolving those manually for all but trivial projects is difficult and error-prone. Using Maven we can make things difficult and error-prone automatically.
Kidding aside, Maven provides a lot of functionality out-of-the-box that would make for a very large Ant build.xml. Maven does handle the build process, but it also downloads your dependencies, resolves transitive dependencies, runs your tests, generates reports and a project website, and a million other things through its plugins.
Check out the docs on the Maven web site, particularly the Maven in 5 Minutes page to get started.
I was trying to figure out how mixins are defined in Maven 3, but couldn't find anything other than buzz. It is propagated as one of the big new features here and here. I am currently feeling the pain of the hierarchical structure and would like to give it a spin. Does anyone have a pointer to documentation or the source defining the syntax even?
In a comment to this answer, Brett Porter wrote:
Maven 3.0 doesn't offer mixins yet, however. – Brett Porter Feb 16 at 8:18
And AFAIK, mixins still aren't there.
Jesse Glick pointed to Maven issue 5102, so I just wanted to mention that the most recent comment there (2 Oct 2012) links to a new maven plugin that offers mixin behavior: maven-tiles. This seems to be the best option until mixin support is actually baked into Maven (something that has been delayed for several years now).
Edit 2015-Jan: tknerr pointed out that this issue has been flagged for review for Maven 4 inclusion. The Maven devs seem to believe that POM format changes are required to support this feature correctly. (As a long-time Maven user, I'm not surprised by this.)
You can use open-source plugins to introduce mixin into your pom.
There are several plugins which tackle the hierarchy complexity in form of mixin.
One of them is designed to solved the hierarchy in plugin / plugin management section.
It reads all the imported POM files and merge them to the POM file in the same manner Maven calculates the effective-pom. The plugin merges only the build, properties and profiles sections and does not merge any other elements of the pom such as dependencies, repositories, etc…
In the below snippet, the artifact sample-mixin will consume the plugin management configuration as defined in the sample-mixin pom file. No need to inherit any parent /base pom for this..
<plugin>
<groupId>com.github.odavid.maven.plugins</groupId>
<artifactId>mixin-maven-plugin</artifactId>
<version>0.1-alpha-23</version>
<extensions>true</extensions>
<configuration>
<mixins>
<mixin>
<groupId>mixin-example</groupId>
<artifactId>sample-mixin</artifactId>
<version>${project.version}</version>
</mixin>
</mixins>
</configuration>
</plugin>
For further reading, check it out:
http://rethinkingswd.blogspot.co.il/2014/09/mixin-maven-plugin-reusable-project.html
Mixins are currently scheduled for Maven 3.2 as bug MNG-5102. They are among many highly voted bugs that have not been addressed in the candidate Maven 3.1.
So much for "Paving the desire lines".