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

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.

Related

Spring2.x and Spring3.x maven dependency

i have a question about maven transitive dependency.
i have a project A and dependency the project b and spring 2.x but the project b dependency spring 3.x
you known the spring framework splited several modules.
so the problem as below.
if i exclusive the spring3.x dependency in project A i'm afraid the project can running because the project b need spring3.x api and project A dependency B
if i remove the spring2.x in project A ,i'm afraid the project A can't running too,maybe some old api be removed at spring3.x
anybody have some solutions for this scenario
This is not a maven or spring issue - its more related to the design of your software. You need to make a decision which spring version you are going with. Usually upgrading spring is not the biggest mess, sometimes you need to change the set of dependencies as they move stuff around - but Google is quite helpful with this - or findjar.com.
I assume both A and B run in the same process (or classloader)? You are not deploying them separately? So you need to decide which spring version to use. If you can't change dependencies in project B use their spring version. If you can: take the newer one and upgrade spring in project B.
Maven sadly does not include a magic jar mechanism. If you need different versions of the same jar around something like OSGi might help - but thats a looooong shot. And a complicated one as well. And usually not necessary. Maven (as you have noticed) helps you to manage the dependencies. Which one to use is your choice to make.

Gradle context sensitive support in STS/Eclipse

I am trying to evaluate Gradle as next-gen build tool for some of my future projects.
Steps I've done so far:
I have Java 7 installed on my machine.
Installed Gradle 2.0
Installed Spring Tool Suite 3.6.1, went to dashboard and added support for
Gradle and installed also Groovy-Eclipse package.
Now when I start Gradle projects from scratch or I clone some of the projects from github,
I am not able to get context sensitive help, like Ctrl + Space to autocomplete stuff in
build.gradle file.
I was reading a lot of documentation on net about this, and couldn't find proper answer, so if someone can give me some idea is it working?
Previously I was using Maven, and m2-eclipse, so when I type in pom.xml I am able to do Ctrl + Space which prevents me to make typo mistakes.
NOTE: Just please note that I've enabled Gradle DSL support for my Gradle projects.
Thank You
Gradle's build language is much more dynamic, extensible, and powerful than a Maven POM, and hence it's much harder to develop full IDE support for it. Recent versions of the Eclipse Gradle Plugin have limited editing support, and work is underway to take it to the next level. IntelliJ 14 is already further along, but expect to see further improvements there as well.

Intellij Debugging picking up old version project files

I am debugging code in Intellij. I use maven to build the project and there are various versions of the project sitting in the local .m2 repository. Intellij keeps on picking the old version of the code from the previous snapshot of the project when I start debugging. How do I make IntelliJ debug the latest code from the local repository?
You can tell Intellij 2016 to ask you each time which source code to step through.
File->Settings->Debugger
Show alternative source switcher
Try removing .jar and .war files that contain your code from your ~/.m2/repository/
For me the issue is that I built something and it is now registered in Maven under what Maven considers a newer version, but isn't what I was currently working on. I compiled, say, version "2.1" to debug something and then went back to working on "sand-box-idea-SNAPSHOT". I keep thinking why isn't Intellij picking up my latest sand box change but it's because it's deferring to the Maven version 2.1 which Maven assumes is better than 'sand-box-SNAPSHOT'.
It may be that you have some plug-ins interfering with IntelliJ's build process. I know that the Google Protocol Buffers Plugin can cause my Intellij to be unable to detect dirty classes that need to be re-compiled.
I've met similar behavior, maybe it can help you :-)
I developed app (using maven) and during the time I change output packaging from jar to war. Maven repository than contained both versions, jar and war, because maven does not remove old jar when you change it. As project pointed to mvn repository, it still used old reference to jar but new version within war was updated.
I was really upset as maven compilation and tests worked fine but Idea used me old version. I've had rebuild idea project and it worked later fine.
I have seen this very recently after upgrading from IDEA 13 to IDEA 14. It seems like launching configurations created in IDEA 13 are no longer automatically triggering a mvn package prior to launch.
In order to fix this I manually added a mvn goal in the "Before Launch" dialog.

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

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.

STS M2E 'Plugin execution not covered by lifecycle configuration" Error - Flex-Mojos

I am trying to write my pom.xml for a multimodal flex application. I have been using this resource as an example:
http://www.sonatype.com/books/mvnref-book/reference/flex-dev-sect-creating-with-archetype.html
I am using M2E v1.01 but I am faced with a number of 'Plugin execution not covered by lifecycle configuration" errors. As far as I can see - there are no m2E connectors available to resolve this and I have tried all the Maven advice I can find - to include:
Clean
Update dependencies
Update project configuration
The problem only occurs if the project is declared as swc or swf package. My next move to ask Eclipse to 'permanently mark goal as ignored' - which seems a little brash.
Any advice would be appreciated.
Thanks in advance.
With STS 2.8.0, we have upgraded m2eclipse to be version 1.0. However, this can cause a bit of trouble with existing projects. I wrote a blog on this a couple of months ago.
http://blog.springsource.org/2011/10/18/upgrading-maven-integration-for-springsource-tool-suite-2-8-0/
Essentially, the new architecture for m2eclipse requires that each maven plugin you use must be mapped to one Eclipse plugin to handle the plugin's execution inside of Eclipse. This obviously causes problems since not every maven plugin author has the knowledge or time to create also create and maintain an Eclipse plugin.
By marking the plugin as ignored, you are saying that the plugin should never be executed inside of Eclipse (implying that whenever you need it to be executed, you will do so from the command line). Once marked as ignored, you can then change it to execute, which means that it should always be executed whenever the associated lifecycle is performed in Eclipse. This may cause performance problems, and so only do it if you know the risks.
If all this is too much for you, then STS provides a downgrade option to revert to an older version of m2eclipse. Go to the Dashboard extensions page. Unfortunately, you will have to manually revert all changes to your .project and .classpath files (we provide an auto-upgrade mechanism, but not a downgrade mechanism...presumably everything is in version control).
Any questions or problems should be sent to the STS forums:
http://forum.springsource.org/forumdisplay.php?32-SpringSource-Tool-Suite
You can check this alpha connector "Flex Maven Integration for Flash Builder" on the eclipse marketplace: http://marketplace.eclipse.org/node/648556.

Resources