Springsourcetoolsuite sample project throwing maven dependency issues - spring

I am new to STS and installed the latest version yesterday. Once installed I went to New->Spring Template Project->Simple Spring Batch Project and followed the instructions like giving a project name, specifying a package name and clicked finish.
The project is showing a lot of errors. I tried updating maven dependencies and clicked almost all logical options in maven. I even see that org.springframework is not resolved. I see "Failed to read artificat descriptor errors".
Can anybody guide me here? Since this is a sample project I expected it to compile and run straight away. Am i missing something?
My STS version is 2.7.2 and maven is 4.0

Unfortunately, some of the template projects are a bit out of date. I'd recommend posting on the STS forum for a bit of help on getting them working.
http://forum.springsource.org/forumdisplay.php?32-SpringSource-Tool-Suite

Related

Grails 3 project getting 'Cannot resolve symbol in IntelliJ IDEA' for various files

I am using Grails 3.3.8 with IntelliJ IDEA Ultimate 2018.1, but the view editor doesn't show it correctly for some reason even though I have all the configuration and dependencies. The same error/warning comes in gsp's as well. Also I am using the shiro-plugin and get the error's for its tags saying that it's not allowed.
No issue is faced while running the app but not sure why the code is not detected by IntelliJ correctly. I also tried Refresh All Gradle projects many times and even did a grails clean and build but they still show.
Note: I have the same project running on Grails 2.5.6 and it detects all fine in the same IDE version. This is when I upgraded the project to 3.3.8.

IntelliJ SpringBoot dependency problems

I'm trying to follow several tutorials on how to use Spring Boot, however I keep running into issues where none of my dependencies are working properly. Below is an image displaying my problem.
I've tried making sure that I installed Maven correctly, however I imagine there is something that I'm doing wrong. I think that I have Maven in the proper Paths but, but I can't tell why it would still be providing the errors that it does. I've followed what it stated to do for Windows users, and have as follows.
Whenever I run mvn -version I am getting the following.
Can anyone help guide me in order to properly have Maven working on IntelliJ?
If you are using IntelliJ IDEA then I suggest using Spring Initializr which would create sample application with correctly configured maven setup is you choose Maven Project for Type:
http://blog.jetbrains.com/idea/2015/03/develop-spring-boot-applications-more-productively-with-intellij-idea-14-1/
Are you using Gradle or Maven to import required dependencies? If not, follow the guides here:
http://docs.spring.io/spring-boot/docs/current-SNAPSHOT/reference/htmlsingle/
If you have them setup, try to click one of the error and then click the red light bulb icon, see what it suggests you to do.

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.

Project import error when using Eclipse

I am getting the following error when trying to import some existing project (couple of years old project).
"No marketplace entries found to handle maven-antrun-plugin:1.3:run in Eclipse. Please see Help for more information."
I have tried to read information on this error.. but can't find anything that tell what's wrong, and how to fix it.
Help? I have Eclipse Indigo, and M2E Eclipse Plugin
Update - Looks like this is related to Eclipse Indigo having Maven 3, and my pom xml files being old (maven2). I am reverting back to Eclipse Ganymede... :(
This probably relates to a M2E connector not existing for the "run" goal of the maven-antrun-plugin. See http://objectledge.org/confluence/display/TOOLS/M2E+Connectors for more information.
Eclipse is only able to perform a subset of Maven build functions, and the M2E Eclipse plugin helps expand Eclipse's repertoire using its "Connectors", which are available for download in the Marketplace.

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