Skip to content

Create or modify new project - maven update problem #703

Closed

Description

@andrew00077

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!

Activity

  1. pcdavid commented on Nov 15, 2021

    @pcdavid

    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).

  2. martinlippert commented on Nov 26, 2021

    @martinlippert
    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?

  3. tzkeat commented on Dec 13, 2021

    @tzkeat

    @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).

  4. shadowcgray commented on Dec 24, 2021

    @shadowcgray

    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.

  5. alexmex90 commented on Jan 2, 2022

    @alexmex90

    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.

  6. BoykoAlex commented on Jan 12, 2022

    @BoykoAlex
    Contributor

    The issue is import job stuck here:

       java.lang.Thread.State: TIMED_WAITING (on object monitor)
    	at java.lang.Object.wait([email protected]/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.

  7. kdvolder commented on Jan 12, 2022

    @kdvolder
    Member

    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'.

  8. BoykoAlex commented on Jan 12, 2022

    @BoykoAlex
    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)

  9. added this to the 4.13.1.RELEASE milestone on Jan 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    for: eclipsetype: bug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions