what is the use of Maven in seleniumRC or WebDriver? - maven

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.

Related

Ant to maven conversion

I need to convert few projects from ant to maven. I know the basics of both, also read a lot of articles on how to. However, is it a good idea to write a pom using eclipse? Or is it better to write it without using eclipse? The M2Eclipse plugin needs maven to be tweaked more, will the changes related to M2Eclipse cause problems when the war is built on jenkins?
Pros of using Eclipse IDE:
The formatting of pom.xml will be taken care, when you add the 'maven-eclipse-codestyle.xml' to the code formatter, as mentioned here. Formatting will be harder when you do it without an IDE.
The auto-completion feature of eclipse will make your coding easier, since it will automatically sense the open tags and close them. You need to close all the open tags manually, if you don`t use an IDE.
You can view the dependency hierarchy of the dependencies added and hence it might be a bit helpful while managing the dependencies.This can be extremely useful ,when you have transitive dependencies (Dependencies within other dependencies). You can find more about transitive dependencies here.
An IDE will warn you of common mistakes that may occur while coding (something like, 'forgetting to close an open tag','placing a tag in an incorrect location'). This will save a whole lot of time. If you don`t use an IDE, you need to correct the mistakes only when you get an exception after executing a maven command.
Eclipse will warn of missing artifacts (when the dependencies are not present in the local repository), which can help you to fix it before executing the maven goal.
Cons of using Eclipse IDE:
m2e plugin will throw 'Plugin execution not covered by lifecycle configuration' errors all over your pom.xml files. These errors won`t affect your build, but may be quite annoying.
I personally have done migration from Ant to Maven2. IMO it is better to write pom.xml on your own so that you wont face any last minute surprises as well as you will get complete overall knowledge on what you are exactly doing with your pom file.
However if you still want to go with m2e, from my experience it did not create any problems at all. Regarding the build - I guess there shouldn't be any issue. You can refer this link if you need more info about m2e and jekins - m2e and jenkins

gwt-dev as maven dependency issue

Though i haven't any experience with gwt, my current task is integrating existing gwt project with maven. Some of the project java classes extend from com.google.gwt.core.ext.generator which is part of gwt-dev.jar. My issue is that gwt-dev.jar is not recommended to be included as maven dependency(even with provided scope), but in that case my project can't be compiled. How such kind of problem can be resolved ?
Thanks in advance.
If you're referring to the warning printed by Mojo's Maven Plugin for GWT, you can ignore it. If it ever causes issues, it'd mean you don't have split your client and server code in separate modules. gwt-dev as a dependency is the recommended setup, Mojo's Maven Plugin for GWT just hasn't updated yet.

Grails 2.3 dependency management maven or BuildConfig

There is a lot of talk about maven being the dependency resolution engine of choice (or Aether more specifically). What is the result of this change from an application development perspective? Going forward am I meant to use an external pom file to capture my dependencies rather than BuildConfig? Do I run create-pom on legacy projects upgraded to 2.3x? Is there a recommended approach?
The recommended approach is to express your dependencies in BuildConfig.groovy and let Grails take care of it from there. You don't need to generate a pom file unless you are trying to integrate your Grails build as part of some other build (like a Maven build). The normal thing to do, unless you have some specific reason to do otherwise, is to use the Grails build system which by default in recent versions will use aether to do the resolution, but that is largely an implementation detail and all you typically have to interact with is BuildConfig.groovy.
I hope that helps.

Is Maven a framework that provides mainly an archetype like domain.controller-view in grails?

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.

Generating dependency charts for Maven

Are there any good tools that can scan many levels into maven projects / subprojects and generate reports or charts about all of the dependencies, version discrepancies between the same packages in different projects, etc etc?
Is there some other smart way to manage large maven projects that have several layers of subprojects with a large number of dependencies in each one?
Get a repository manager like Nexus, use the Maven Dependency plugin, use Sonar, use Hudson/Jenkins, check out Sonatype Insight and the Insight for CI plugin, use the dependency viewer in Eclipse, use a parent pom for your organization to centralize dependency versions and so on. Lots to do for you.
You can use Jenkins. It has got all you need to do with a maven project.
Jenkins with sonar the best combination for managing huge maven projects.
Depending on how "deep" you want to go, the maven site builds can use the reporting plugins to generate much of what you want. If you want much more info, then something like Sonar is probably more of what you want.
The simplest solution is to use the maven-dependency-plugin which can produce reports either ASCII or in different formats. Or you use the dependency-hierarchy in your IDE (m2e Plugin Eclipse) to look into the dependencies.

Resources