STS wizard for spring starter missing gradle option - sts-springsourcetoolsuite

Until very recently, the spring starter project wizard had a dropdown to select between maven & gradle. This is now missing and projects initialise with maven by default.
Can someone enlighten me as to why it's gone, and if there is any other automated way of initiating gradle based spring projects in STS/eclipse. It's not like I can't knock up my own gradle script, but I'm lazy like that.
Thanks

Can someone enlighten me as to why it's gone...
After some investigation I discovered that a recent change in the initializr app (http://start.spring.io) is responsible. The names for the import options in the webservice have been changed and they no longer match those used in the STS import wizard.
The import wizard ignores 'unknown' types (because it doesn't know how to import them). This causes the list of valid type options to become empty and so it is no longer shown by the STS wizard.
See https://github.com/spring-io/initializr/issues/42
I expect the problem to be fixed quickly (will update this answer when its fixed).
Update: The problematic changes to start.spring.io app have been reverted and the option should now work again in the STS wizard.
... and if there is any other automated way of initiating gradle based spring projects in STS/eclipse.
Yes, there is another thing you can use in the mean time. The "Import Getting Started Content" wizard. The short spring.io guides come in Maven and Gradle flavor. So importing one of those might be a good starting point.

Related

Vaadin + Css formatting

I'm using Vaadin 14.4.4 with Gradle 6.3 and Spring Boot.
When I was creating a website in developer's mode everything was working well. Now I switched to productionMode = true and website doesn't load a single css file.
I'm trying to use one css file per class.
After switching back to developer's mode the CSS formatting is not working as it used to.
I tried vaadinClean, vaadinBuildFrontend and vaadinPrepareFrontend but that doesn't seem to fix my problem...
Do you guys have any suggestions does any of you interfered with the same problem as I ?
From the docs of the gradle plugin for
Vaadin:
./gradlew clean build -Pvaadin.productionMode - will compile Vaadin
in production mode, then packages everything into the war/jar archive.
Automatically calls the vaadinPrepareFrontend and
vaadinBuildFrontend tasks.
Note the explicit passing of -Pvaadin.productionMode. It might seem
a bit counter intuitive to have to pass that explicitly to a task like
vaadinBuildFrontend, which sole purpose usually is to build the
production stage.

Turning off Spring Roo in STS, but still use from command line

From time to time STS seems to bog down or free while working in a Spring Root webapp. It can sometimes be ten or twenty minutes before the UI allows you to really do anything, other than go slow and queue up actions.
We've traced all the the postings/bug reports about "JPA change handler (waiting)" messages and AspectJ issues - but no real permanent solution appears. Sometimes when we upgrade Eclipse or Roo things get better for a while.
We are hoping to figure out if this is really a Roo problem or more of an a Spring/AspectJ issue.
Question: Is it possible to disable Roo in the IDE but still have it build and work OK in the IDE, just not Roo smarts going on?
I thought I just had to remove the "Roo Nature" for the project but that does not seem to completely do it - the Roo Shell keeps popping open when I do a Maven Update.
If not we'll probably look at the push-in refactoring route - but that seem to really be a one-way street.
Our webapp has about 20 domain objects and 30 controllers - it's not tiny but not huge either. We use JPA/Hibernate too.
Thank you - Richard
We ran into the same problem. It seems the JPA Daly support for Eclipse, included in the WTP, generates of a lot of JPA Event Change notifications while compiling a project. It seems in projects with aspects, like the Roo ones, this behavior is even worse and makes using the IDE very slow and even hangs sometimes.
As there is not any way to disable it through configuration, you have to remove or move the related files. Ex:
Go to the STS/Eclipse installation folder.
Run the following command::
rm -rf plugins/org.eclipse.jpt. features/org.eclipse.jpt.**
We found also another problem with the Eclipse AspectJ plugin (https://issuetracker.springsource.com/browse/STS-4037) that caused to compile all the project on each modification to any Java class in the project with Aspects applied. It is solved in the recent STS versions, but check it just in case by performing the following steps:
Go to the Project > Properties > AspectJ Compiler menu.
Check the Other > Outxml configuration property is disabled.

Spring boot hot deployment for templates and resources under IntelliJ

Is anyone aware of a mechanism to get hot deployment for resources and template working under IntelliJ 14.0.2 for a Spring Boot application.
I know that full Spring Boot support is scheduled for 14.1 but I have a project that I converted over from a standard WAR project to a Spring Boot project and I really miss the hot deployment.
At the moment I have to manually build the project that the resources are in to get hot deployment and even then it is a bit flaky sometimes. I would prefer to just save a template or a javascript/css file and get it picked up as I did when I was running my app using a local tomcat server via IntelliJ.
I could switch back to Eclipse to get this working, but my project is Scala based and IntelliJ Scala support is far superior.
So after some testing I came to few conclusions I think someone arriving here may find useful:
If you are running embedded spring boot application from IntelliJ IDEA (myself on 14 at the moment) in debug mode and you want to hot re-deploy resources you can do that via: Run -> Reload changed classes. Setting a keyboard shortcut much recommended.
Don't get fooled by Loaded classes are up to date. Nothing to reload. message. Your static resources have been updated (tested on .js files and Thymeleaf templates).
As pointed out in comments for thymeleaf templates hot-redeploy you would need:
spring.thymeleaf.cache=false
If you are running in external container IntelliJ provides extra features like action on Frame deactivation which is extremely handy for web development. This works fine as well just beware that external Jetty container on 9.2.7 will cause troubles, i.e. unload the resources on Update resources action breaking your webapp. The only fix was app restart for me. Works nicely in Tomcat 8 though.
As instructed here adding spring-boot-devtools dependency will enable static resources reloading (templates and css).
Beware that you need to select Build -> Compile for this to work.
Install jetbrains-ide-support
Start your Spring Boot app
Go in browser and open your_project_page(http://localhost:8080/)
right mouse click(on your page) -> choose "Inspect in IDEA"

intellij idea failed to generate flex compiler configuration file

I'm experiencing an issue developing in intellij idea.
Here is the situation: We have maven nested project with java+js(extjs)+html+ActionScript source code in it. The thing is, that evey time I introduce any changes to ANY pom.xml in my project intellij idea tries to generate some configuration file for flex compiler. Some time it succeed to do this and some time not. Independent on that, this task eats to many resources so intellij idea starts lagging.
Is there any way how this config file generating can be turned off?
Thanks in advance for any help!
You can disable auto import of Maven projects via Settings -> Maven -> Importing. Then uncheck "Import Maven projects automatically".
Note that AFAIK it is not possible to ignore the generation of Flex config files while this option is on.
Disable Settings | Maven | Importing | Import Maven projects automatically.

STS: Losing references in Java Build Path

I am using Spring Source Tool Suite 2.8.1 to implement Spring applications.
I frequently get build errors because references are lost for no apparent reason. In Right-click project in Package Explorer->Properties->Java Build Path->Order and Export, I find projects sometimes are deselected. And often packages are gone in Right-click project in Package Explorer->Properties->Java Build Path->Deployment Assembly.
Having to reset these settings frequently is frustrating. Is there some way I can work around these problems?
I have tried to update STS to the latest version, but the upgrade process fails with incomprehensible error messages. I want to avoid a clean install because setting up the environment again would probably be a nightmare.
Now that I know this is a maven project and you are adding references yourself, this is making sense to me. STS 2.8.x was the last STS to ship with the legacy m2e (maven plugin for Eclipse). It did not recognize build path entries added manually (it likes to have complete control over the classpath). So, what is likely happening is that you are adding these classpath entries and then an update project operation gets kicked off automatically. This will have the effect of removing all of your extra classpath entries.
You are best off doing the following:
Updgrading STS
Or just upgrading your m2e component (you will have to first uninstall the old m2e, but this should be taken care of automatically from the discovery update page).
Or, just accept the fact that you can't manually change your classpath with the legacy m2e.

Resources