Skip to content

Create or modify new project - maven update problem #703

New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

Closed
andrew00077 opened this issue Nov 9, 2021 · 8 comments
Closed

Create or modify new project - maven update problem #703

andrew00077 opened this issue Nov 9, 2021 · 8 comments
Labels
for: eclipse something that is specific for Eclipse type: bug

Comments

@andrew00077
Copy link

Hello,

when creating a new project with Spring Boot in STS, the system remains on status "Updating Maven Project (75%)" without any progress. It seems to be related to the update of the pom file. Steps to reproduce:

  1. create new Project
  2. Modify the pom file via context menu and "Add Starter"¨
  3. STS remains blocked at "Updating Maven Project (75%)" in the progress (and bottom right)

(ENV: STS: 4.12.1, OpenJDK 11, Windows 10)

What can be the reason?
Thanks!

@pcdavid
Copy link

pcdavid commented Nov 15, 2021

I had the same symptoms, "Updating Maven Project (75%)" , but triggered on random changes.
When it happens I get the following dialog which makes no progress at all and block any interaction with the rest of the UI:

Capture d’écran de 2021-11-15 15-03-05

I reverted the main Maven preferences to their defaults, and the issue is now gone:

Capture d’écran de 2021-11-15 19-17-23

I suspect the "Automatically update Maven projects configuration (experimental)" setting, which I had enabled before (I don't remember why).

@martinlippert
Copy link
Member

@andrew00077 Can you double check whether you had the same preference checked and see if the above advice solves the issue on your end as well?

@tzkeat
Copy link

tzkeat commented Dec 13, 2021

@martinlippert I would like to report the steps to reproduce this issue.
It occurs when creating a new Spring Boot with STS 4.13.0.

  1. Make sure there is no .m2 folder.
  2. Create a new Spring Starter Project.
  3. Add "Spring Web" and "Lombok" to the dependencies.
  4. When finished, the system will remain in the "Updating Maven Dependencies" status without progressing.
  5. If you try this again, please delete the .m2 folder.

This issue did not occur with Eclipse 2021-12 (STS plugin).

folder
new_spring
maven

I have not changed the Maven preferences (they are still the defaults).

@shadowcgray
Copy link

I can confirm that this occurs whenever Lombok is added through the Getting Started content. However, if you create a project without Lombok selected and then add the dependency and excludes to the POM after generation there appears to be no ill-effects. Additionally this occurs with or without Lombok's agent being added to Eclipse.

@alexmex90
Copy link

I can report that I see the same behavior that @shadowcgray reports, I am running STS4 in Debian 11.

Adding lombok manually on the POM file does not seem to trigger the issue.

@BoykoAlex
Copy link
Contributor

BoykoAlex commented Jan 12, 2022

The issue is import job stuck here:

   java.lang.Thread.State: TIMED_WAITING (on object monitor)
	at java.lang.Object.wait(java.base@11.0.3/Native Method)
	- waiting on <no object reference available>
	at org.eclipse.core.internal.jobs.JobManager.join(JobManager.java:1032)
	- waiting to re-lock in wait() <0x000000070919ba00> (a java.util.Collections$SynchronizedSet)
	at org.eclipse.jdt.apt.core.internal.generatedfile.GeneratedSourceFolderManager.removeFolder(GeneratedSourceFolderManager.java:508)
	at org.eclipse.jdt.apt.core.internal.generatedfile.GeneratedSourceFolderManager.folderNamePreferenceChanged(GeneratedSourceFolderManager.java:321)
	at org.eclipse.jdt.apt.core.internal.AptProject.preferenceChanged(AptProject.java:81)
	at org.eclipse.jdt.apt.core.util.AptConfig.setString(AptConfig.java:969)
	at org.eclipse.jdt.apt.core.util.AptConfig.setGenSrcDir(AptConfig.java:917)
	at org.jboss.tools.maven.apt.internal.AbstractAptConfiguratorDelegate.configureProject(AbstractAptConfiguratorDelegate.java:171)
	at org.jboss.tools.maven.apt.internal.AbstractAptProjectConfigurator.configure(AbstractAptProjectConfigurator.java:99)
	at org.eclipse.m2e.core.project.configurator.AbstractLifecycleMapping.configure(AbstractLifecycleMapping.java:124)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$2(ProjectConfigurationManager.java:515)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$$Lambda$1089/0x00000008010b5440.call(Unknown Source)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:156)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.updateProjectConfiguration(ProjectConfigurationManager.java:509)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.configureNewMavenProjects(ProjectConfigurationManager.java:298)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.lambda$0(ProjectConfigurationManager.java:178)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager$$Lambda$1060/0x0000000800fe0040.call(Unknown Source)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.executeBare(MavenExecutionContext.java:182)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:156)
	at org.eclipse.m2e.core.internal.embedder.MavenExecutionContext.execute(MavenExecutionContext.java:103)
	at org.eclipse.m2e.core.internal.embedder.MavenImpl.execute(MavenImpl.java:1416)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:148)
	at org.eclipse.m2e.core.internal.project.ProjectConfigurationManager.importProjects(ProjectConfigurationManager.java:137)
	at org.springframework.ide.eclipse.boot.wizard.importing.MavenStrategy.createEclipseProjectFromExistingMavenProject(MavenStrategy.java:133)
	at org.springframework.ide.eclipse.boot.wizard.importing.MavenStrategy$MavenCodeSetImport.run(MavenStrategy.java:84)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.importProject(NewSpringBootWizardModel.java:343)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizardModel.performFinish(NewSpringBootWizardModel.java:322)
	at org.springframework.ide.eclipse.boot.wizard.NewSpringBootWizard$1.run(NewSpringBootWizard.java:228)
	at org.eclipse.core.internal.jobs.Worker.run(Worker.java:63)

Looks like it is coming from org.jboss.tools.maven.apt.internal.AbstractAptProjectConfigurator which tries to configure eclipse project while it is being imported. Seems like it is trying to remove a folder of a project that is being imported which is probably impossible due to a lock on imported resources or resource doesn't exist in the workspace yet... Not sure...

Uninstalling "Maven Integration for Eclipse JDT APT" from Spring Tool Suite 4 Installation Details dialog solves the issue.

I'd probably pass this on to Maven Integration for Eclipse JDT APT but i could try to dive deeper into this... (@martinlippert)
Also, i have a feeling that APT maven integration shouldn't configure the project... I'd see why it attempts to do anything with it.

@kdvolder
Copy link
Member

kdvolder commented Jan 12, 2022

Also, i have a feeling that APT maven integration shouldn't configure the project

It probably gets triggered because lombok is something that involves annotation / processing so the maven project probably looks to m2e-apt as 'something with annotation processing'.

@BoykoAlex
Copy link
Contributor

Fixed with 10c692d (together with @kdvolder)
Try a snapshot build from https://dist.springsource.com/snapshot/TOOLS/nightly/e4.22 p2 repo (5 hours from now the new build with the fix should be ready)

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
for: eclipse something that is specific for Eclipse type: bug
Projects
None yet
Development

No branches or pull requests

8 participants