Skip to content

m2e plugin does not copy resources from src/main/resources, probably regression in 2022-12Β #1302

@robserm

Description

@robserm

I noticed that the newest Eclipse 2022-12 does not copy resources, this is a regression compared to Eclipse 2022-09 .
Steps to reproduce:
-import the attached project as "Existing Maven Project'
resources_problem.zip
-select file examples.stackmachine.RunnableStackMachine and from context menu choose "Run As-> Java Application"

the result is NPE:
Exception in thread "main" java.lang.NullPointerException: Cannot invoke "java.net.URL.toExternalForm()" because "location" is null
at java.desktop/javax.swing.ImageIcon.(ImageIcon.java:234)
at examples.stackmachine.RunnableStackMachine$ImageButton.(RunnableStackMachine.java:372)
at examples.stackmachine.RunnableStackMachine$PushButton.(RunnableStackMachine.java:300)
at examples.stackmachine.RunnableStackMachine.createStackButtonPanel(RunnableStackMachine.java:131)
at examples.stackmachine.RunnableStackMachine.createStackPanel(RunnableStackMachine.java:117)
at examples.stackmachine.RunnableStackMachine.(RunnableStackMachine.java:41)
at examples.stackmachine.RunnableStackMachine.main(RunnableStackMachine.java:392)

The problem is that the images from src/main/resources/examples/stackmachine/img were not copied to target/classes

The problem DOES NOT occur on 2022-09.

If you remove "Excluded" filter from project "Java Build Path" everything works fine, see the image below.
image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions