Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 358075

Summary: Opening built resource file in output folder re-generates it (removing profile activated content)
Product: z_Archived Reporter: Anders Hammar <anders.g.hammar>
Component: m2eAssignee: Project Inbox <m2e.core-inbox>
Status: CLOSED INVALID QA Contact:
Severity: normal    
Priority: P3 CC: igor
Version: unspecified   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS X - Carbon (unsup.)   
Whiteboard:
Attachments:
Description Flags
Test project to reproduce none

Description Anders Hammar CLA 2011-09-19 05:04:17 EDT
Build Identifier: 20110615-0604

In a project where a resource file is filtered, the generated file from a build with active profiles seems to be replaced when I open it through the Project Explorer. The result is that filtered values use the default values instead of the ones defined by a profile used in the original build.

Reproducible: Always

Steps to Reproduce:
1. Import the attached project (lab-r3)
2. Build the project with the "production" profile
3. From the CLI, check the target/classes/log4j.properties file content. E.g., the rootCategory should have "ERROR" level.
4. In Eclipse, using the Project Explorer, open the same file. You'll see that the content has now changed and the rootCategory is "DEBUG".
Comment 1 Anders Hammar CLA 2011-09-19 05:06:24 EDT
Created attachment 203574 [details]
Test project to reproduce
Comment 2 Igor Fedorenko CLA 2011-09-19 11:27:30 EDT
This behaviour is expected. m2e keeps filtered resources up-to-date with resources in their source location and regenerates filtered resources whenever it detects the two got out of sync. In your case this happens when filtered resources is opened in the editor and auto-refreshed from local filesystem as a result. Enabled desire profiles in project properties to make m2e produce expected filtered resources.
Comment 3 Anders Hammar CLA 2011-09-19 14:30:18 EDT
Ok. Thanks for clarifying.
Comment 4 Denis Roy CLA 2021-04-19 13:23:47 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/