Skip to content

Spring Tool Suite 17 with maven no longer copies application.properties file to the target folder #929

Closed

Description

@marcgemis

Describe the bug
When you create a new Spring Boot project (2.76, Maven, Java 17) with Spring Web an application.properties file gets created. When you edit this file, e.g. add server.port=8888 and save the file, the file never appears in the target folder of the project.
This also means that the web application still starts at the default port 8080.

There is no problem with the same project is created with gradle.

Platform MacOS Monterey 12.5.1 Apple M1 chip - Eclipse STS 17.0

To Reproduce
See above

Problem does not occur in STS 14

A non-working maven project, and a working gradle project
sounds-of-animals-maven.zip
sounds-of-animals.zip

Activity

  1. martinlippert commented on Dec 19, 2022

    @martinlippert
    Member

    I can reproduce this and I think this is a problem with the m2e integration in Eclipse (since I can reproduce this with Eclipse 2022-12 RC1 JEE package as well), therefore I reported this issue via eclipse-m2e/m2e-core#1148 to the m2e project.

  2. added this to the 4.18.0.RELEASE milestone on Jan 1, 2023
  3. martinlippert commented on Jan 1, 2023

    @martinlippert
    Member

    Here is the issue from the m2e project where this got fixed: eclipse-m2e/m2e-core#1150 - now waiting for a new release of m2e to be published that includes this fix.

  4. marcgemis commented on Jan 2, 2023

    @marcgemis
    Author

    thanks for keeping me updated

  5. martinlippert commented on Jan 5, 2023

    @martinlippert
    Member

    In case you want to try the fix early, you can add the m2e snapshots update site to the preferences (Preferences -> Install/Update -> Available Update Sites, then add https://download.eclipse.org/technology/m2e/snapshots/latest/) and run a Check for Updates.

    Feel free to uncheck the JustJ JRE update, but keep everything else selected and run the update. It includes the fix for this issue.

  6. martinlippert commented on Jan 25, 2023

    @martinlippert
    Member

    Unfortunately the workaround doesn't seem to work anymore due to a new dependency being required from the latest m2e snapshot builds. I am looking into this to see what we can do here. In the meantime, run a regular maven build on the command line or via the Run As -> Maven Install menu item whenever you change those resource files.

  7. CrisLi commented on Feb 16, 2023

    @CrisLi

    this issue is still here, is there any hotfix?

  8. martinlippert commented on Feb 16, 2023

    @martinlippert
    Member

    @CrisLi The workaround described above (running stuff manually) should work, the fix for the underlying issue is implemented in the corresponding component (the Maven Integration, m2e) and we are waiting for a new release of m2e to include this fix (I guess on-time for the next major Eclipse release, coming in mid March).

    In the meantime, we have fixed the issues that were preventing us from installing the latest m2e snapshot CI builds, that works again with our latest snapshot CI builds. So if you would like to, you could go to https://dist.springsource.com/snapshot/STS4/nightly-distributions.html, download and install this latest CI build (on top of Eclipse 4.26 or 4.27, whatever you prefer) and then install the latest m2e snapshot to it (as described above). That would result in an STS environment with the m2e fix included, but would also mean to run on the latest CI builds of STS as well as m2e.

  9. 41 remaining items

  10. pcdavid commented on Dec 20, 2023

    @pcdavid

    A fix for the (potential) underlying issue in Maven has just been merged: apache/maven-filtering#77.
    There are exchanges ongoing on eclipse-m2e/m2e-core#1511 to see how this can be tested in the context of m2e and confirm.
    Not sure if this will require a new release of Maven Filtering and/or Maven itself.

  11. pcdavid commented on Dec 22, 2023

    @pcdavid

    A potential fix has just been merged in m2e itself via eclipse-m2e/m2e-core#1629
    It can be tested by updating m2e from https://download.eclipse.org/technology/m2e/snapshots/latest/ and getting org.eclipse.m2e.feature 2.4.300.20231222-1142 (or more recent).

  12. martinlippert commented on Jan 2, 2024

    @martinlippert
    Member

    Thanks a lot @pcdavid for this update, that sounds indeed quite promising. I will include the m2e snapshot update site in our builds, so that we could get a few nightly builds of STS that include this fix right away for further testing here. Will keep you posted here once those builds are around.

  13. martinlippert commented on Jan 2, 2024

    @martinlippert
    Member

    Builds that include the m2e fix are available now from here:
    https://cdn.spring.io/spring-tools/snapshot/STS4/nightly-distributions.html

    It is included in builds based on Eclipse 2023-12 (e4.30) as well as the early access builds for Eclipse 2024-03 (e4.31).

  14. martinlippert commented on Jan 2, 2024

    @martinlippert
    Member

    @pcdavid Do you think that this fixes the issue for all the cases you observed?
    @BoykoAlex Probably worth a try to double check from your end as well

  15. pcdavid commented on Jan 5, 2024

    @pcdavid

    @pcdavid Do you think that this fixes the issue for all the cases you observed?

    I have not experienced the bug since I updated, but I've not used STS much these last few days and the bug was not systematic. It looks good, but it's difficult to be sure.

  16. martinlippert commented on Jan 8, 2024

    @martinlippert
    Member

    @pcdavid Do you think that this fixes the issue for all the cases you observed?

    I have not experienced the bug since I updated, but I've not used STS much these last few days and the bug was not systematic. It looks good, but it's difficult to be sure.

    Thanks for the update, much appreciated. Let's keep an eye on this for a little longer before we finally close this item here.

  17. OLibutzki commented on Jan 10, 2024

    @OLibutzki

    As this comment states there is some relationship to apache/maven-filtering#77, too.

    So maybe we need a maven-filtering release including apache/maven-filtering#77 before this issue can be closed?

  18. BoykoAlex commented on Jan 29, 2024

    @BoykoAlex
    Contributor

    @martinlippert are we moving this to 4.22.0 to include new eclipse release with new m2e release?

  19. martinlippert commented on Jan 31, 2024

    @martinlippert
    Member

    Yes, since we don't have a new release of m2e yet that includes this and we will not ship the Spring Tools 4.21.1 release with an snapshot version of m2e, we will move the target milestone for this to the 4.22.0 release.

    If you would like to get this into the upcoming 4.21.1 release, please install the latest m2e milestone manually into the Spring Tools distribution.

  20. pcdavid commented on Feb 21, 2024

    @pcdavid

    m2e has just released a version with a fix on their side: eclipse-m2e/m2e-core#1511 (comment)
    It looks like a complete fix of the underlying problem will also require a new release of maven-filtering with apache/maven-filtering#77 (which has been merged), but personally I've been using m2e snapshots for a while and do not see the bug anymore.

  21. martinlippert commented on Feb 26, 2024

    @martinlippert
    Member

    Awesome, thanks a lot @pcdavid for the continuous feedback here, much appreciated. With that, I will close this item and mark it as solved for now. We will include the m2e 2.6 release in our upcoming Spring Tools 4.22.0 release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

Type

No type

Projects

No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions