Spring Roo says "Version is required for org.apache.maven.plugins:maven-compiler-plugin" - spring

I am trying out Spring Roo 1.2.2 and can't get past this error:
roo> hint
Version is required for org.apache.maven.plugins:maven-compiler-plugin
My maven version: Apache Maven 2.2.1
Appreciate any help.
Update:
Changing the directory and trying again makes it disappear! But I would still like to know what it was looking at, thanks.

Roo 1.2.2 has issues working with maven plugin versions. You will need to make sure that all your plugin declarations in every module have version tag specified. Similar problem is described here http://forum.springsource.org/showthread.php?132520-Multimodule-application-issue-Spring-Roo-1-2-2
Besides that I assume that you are trying to use Roo 1.2.2. on existing codebase. Than you need to follow this http://static.springsource.org/spring-roo/reference/html/existing.html
Although it is not said in this documentation, you possibly will need Maven 3 (3.0.4 comes with Roo/STS distribution) I suggest using this. It would be better first to migrate your project to Maven 3.

You should always start roo in an empty directory (or already existing roo project directory) because the working directory is scanned by roo. In your case a POM is probably detected.
Also notice that roo becomes very slow when working from a "crowded" directory.

Related

Grails CXF plugin not found

I am trying to implement SOAP services in my app, the best plugin I found is CXF, but I couln't install it, it looks like that I should put some additional repository.
I raised an issue in the source page, but if someone has faced this before, can share the solution plz?
If you are trying to use version 3.1.2 of the plugin, you want org.grails.plugins:cxf:3.1.2, not org.grails.plugins:grails-cxf:3.1.2.
The problem is that the plugin's documentation talks about to use the version 3.1.2, but the latest version in the repository is the 3.0.9

Java3D Maven Repository for 1.5.2

I'm at my wit's end trying to get Java3D working with Maven. The latest version in the Maven core repository is 1.3.1, but there don't seem to be any 64-bit dll files (without installers) that will work with such an early version! It seems that the 1.5.2 dll I donwloaded is incompatible (unsurprisingly).
Does anyone know of a repository that has at least version 1.4.0?
Otherwise, looks like I'm going to have to learn JOGL instead and change all my code.
Rather make a request for enhancement. Maybe we could publish Maven on Maven Central or at least in our development repository. Please check whether you're using Java 3D 1.6, look at that if you don't know how to install it.

Where can I find updated and "unbloated" webapp archetypes for maven?

I'm pretty new to maven and I'm trying to find a good archetype for creating a webapp "starting point" for a Spring MVC project. I have been rtfm-ing, googling and installed many of the archetypes I've found in lists presented here on SO and other places, but I never found one fitting my needs.
Example 1: I installed org.apache.maven.archetypes -
maven-archetype-webapp, but it seems outdated, as it uses JRE 1.5,
JUnit 3.8.1 and also it's missing src/test/java, src/test/resources
and src/main/resources by default.
Example 2: Using eclipse, I created a new "Spring MVC Project" from "Spring Template
Project", which also set up Maven for me, but it installs loads of
stuff I'm not sure I even need.
I also tried some other archetypes, like from AppFuse and Cocoon, but the "bloating" in their basic webapp archetypes was even worse.
What I'm after is kind of what the maven-archetype-webapp is giving me, but an "updated" version that also includes the test and resource directories.
So I guess my question is two folded:
1. Is there an "updated" version of the maven-archetype-webapp archetype?
...and/or...
2. Is there a way for me, as a maven newbie, to create my own archetype that fits my needs?
... or have I totally been misunderstanding the concept of archetypes?
Is there an "updated" version of the maven-archetype-webapp archetype?
AFAIK, version 1.0 is the last version (and is not very up-to-date). BTW, it seems it doesn't define the source code level (so I guess 1.5 you have is coming from your IDE)
Is there a way for me, as a maven newbie, to create my own archetype that fits my needs?
Creating a new artifact is quite simple. Here are the details.
Is it so simple for a maven newbie ? Well, it depends... but according the quality of your post, it seems you understood the basics so yes, it should be easy to do.
Basically an archetype is nothing more than:
the target project structure you need (with some files like pom.xml, web.xml, ...)
a file describing the resources that need to be included in this structure.
Take a look at maven-archetype-webapp-1.0.jar (i.e. unzip it) and you will immediately understand why the directories are missing and from where junit-3.8.1 comes from.
Note: you will find the maven-archetype-webapp-1.0.jar in your maven repository. (Probably here : /.m2/repository/org/apache/maven/artifacts/maven-archetype-webapp/1.0/... but I didn't check)

How should I set up a Maven/Groovy project in STS?

I have a project that uses some Java and some Groovy, and it's all built with Maven. We use the GMaven plugin to compile the Groovy. I've been using Eclipse and have got fed up with the "Plugin execution not covered by lifecycle" message that indicates Eclipse is incapable of doing what my command-line does (I've tried adding the ignore/execute config to fix it, but it never works properly), so I've switched to Spring Tool Suite, which claims to have full Groovy support. How should I set it all up? So far I've had exactly the same experience as with regular Eclipse, but given that SpringSource are responsible for Groovy, I figure there must be a way of doing it.
Have you read this thread?
http://forum.springsource.org/showthread.php?130130-Working-with-Mavenized-Grails-projects-in-GGTS-3-1-0-Updated-for-3-1-0-release/page2
For grails projects, you do not need to use gmaven or the groovy-eclipse-compiler. You must be using the 3.1.0 STS (which is not actually released yet, but you can get this
You also must be using Grails 2.1.1.
You can secretly get a 3.1.0 release build by going to this download page:
http://www.springsource.org/downloads/sts-ggts
Instead of clicking on the links, copy them and substitute 3.1.0 for 3.0.0.

No AspectJ getter/setter -- upgrade Roo from 1.1.5 to 1.2.1

I am upgrading current project from Roo 1.1.5 to 1.2.1.
I have noticed there are some new features in Roo 1.2.1 to facilitate JPA functionality, i.e. #RooEntity to #RooJpaActiveRecord, but I thought when I open Roo shell in STS it could handler that conversion automatically...I can still achieve that manually, however, after I change the annotation name, no matter I use poll now or re-build the project, all the getter/setter/finder/entityManager are error out due to no AspectJ injection, actually I can see the aspectJ files are generated, STS just cannot identify them with the entity java file. So suddenly the whole project falls apart.
Please, geniuses on the stack, let me know how to fix that. Many thanks in advance.
I have figured out the solution:
Simply speaking: make sure running the project as a Maven project.
How: Right click project->Configure->Convert to Maven Project. Then run Right click project -> Maven -> Update Project Configuration.
Maven will build the project once again with aspect injection. I think the problem is previously my project is compiled under Spring Tools -> Update Maven Dependencies where if the STS/AspectJ Tool stop working, then the project will suffer from missing aspect injection(still thinking it is could be a remaining bug of STS, this issue may be very specific but still STS fail the job).
Sorry I have to answer my own question
Make sure you clean your project eclipse style. That is run Project->Clean.

Resources