gwt-dev as maven dependency issue - maven

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.

Related

Getting an error while executing goals from maven plugin flexmojos-maven-plugin

I get the below error while executing the default lifecycle 'clean install' from my maven project.
java.lang.String cannot be cast to org.apache.maven.lifecycle.mapping.LifecyclePhase
My code uses the flexmojos-maven-plugin. As per the jira thread https://issues.apache.org/jira/browse/MNG-5958 this issue has been resolved, but nowhere could I find how.
As per the solution I would have to update Lifecycle.java. Updating Lifecycle.java would mean updating maven-core.jar.
Will I have to go the extent of updating a standard jar which could impact many other files which are using this jar.
I am using maven 3.3.9 and java 8.
The problem is that the Maven guys changed quite a lot internally again with Maven 3.3.9 so currently you will have to use an older Maven version. I also doubt that I will be able to spare the time to address this in the future as Flexmojos has become more and more a beast to maintain. Therefore I am currently working on a completely new maven plugin which I am developing as part of the Apache flex project. For now I would suggest to use Maven 3.3.3 ... should work nicely with that.

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.

Reference a eclipse plugin from a regular project

this is a more conceptual question:
I want to create an application which uses the WALA framework, which itself is packaged as a eclipse plugin, built with maven-tycho. When I try to add this as an dependency no transitive dependency gets resolved, because they are covered by the tycho build.
This is the pom of the WALA project I need at least https://github.com/wala/WALA/blob/master/com.ibm.wala.core/pom.xml
Should my application be a OSGI Bundle itself or can I create a regular jar with it without having much trouble? Which approach is more practical?
If I have seen it correctly, wala.core has only two dependencies wala.util and wala.shrike (util has none, shrike depends on util). So you might as well simply include all three dependencies in your project.
On the long haul, however, you might should indeed consider creating an osgi application instead.

Statically linking maven and gradle dependencies

I am using the hector & astyanax projects. These projects used to require maven, and now astyanax requires gradle.
I would like to statically link one of these projects to my java project (which is not built using maven/gradle). I am not interested in updating the version of astyanax every time they make a new release. I am not interested in mavenizing/gradelizing my own project.
So, two problems arise: 1. Getting the astyanax jars. 2. Getting the depenedency Jars.
At first, not having time to thoroughly understand maven (get off my lawn!), I copied all of the jar files in my global .maven directory into my project, and linked to them. Problem is, it's a pretty messy solution.
Is there an easier way to get all jars needed to use a gradle/maven library? (While I don't mind using gradle to build astyanax, I don't want to use it to build my own project).
Getting jars for distribution, seems like a very basic use case, am I missing a simple way here?
astyanax is published to maven central as com.netflix.astyanax:astyanax:1.56.42. Any build tool (Grails, Maven, Gradle, Buildr, SBT) that resolves from Maven can make a dependency on Astyanax and have its dependencies transitively downloaded. That fact that it's built with Gradle doesn't change how it's consumed.
From your question, it's unclear how you want to resolve these libraries. If you don't want to use a tool (Grails, Maven, Gradle, Buildr, SBT), then you'll have to manually navigate every dependencies and its dependencies from Maven Central. It's quite uncommon for a modern java project to manually download dependencies anymore, the practicalness given the complex dependencies graph make it prohibitive.

what is the use of Maven in seleniumRC or WebDriver?

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.

Resources