Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.
Bug 337353 - [patch] Cannot use ! to disable a profile
Summary: [patch] Cannot use ! to disable a profile
Status: RESOLVED FIXED
Alias: None
Product: z_Archived
Classification: Eclipse Foundation
Component: m2e (show other bugs)
Version: unspecified   Edit
Hardware: PC Mac OS X - Carbon (unsup.)
: P3 normal (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-02-16 15:15 EST by benson margulies CLA
Modified: 2021-04-19 13:22 EDT (History)
2 users (show)

See Also:


Attachments
Test case to reproduce the issue (4.63 KB, application/octet-stream)
2011-11-07 14:30 EST, Fred Bricon CLA
no flags Details
Proposed patch to fix the issue (5.13 KB, patch)
2011-11-07 14:34 EST, Fred Bricon CLA
no flags Details | Diff
Updated Patch fixing the issue (13.50 KB, patch)
2011-12-21 10:26 EST, Fred Bricon CLA
igor: iplog+
Details | Diff
Updated test case (8.42 KB, patch)
2011-12-21 10:27 EST, Fred Bricon CLA
no flags Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description benson margulies CLA 2011-02-16 15:15:25 EST
Build Identifier: 20100917-0705

Under project settings, under maven, under 'Active Maven Profiles', ! does not work to turn OFF a profile which is otherwise activated by default.

The maven console shows that it is actually trying to activate a profile with a ! in its name.

Reproducible: Always
Comment 1 Fred Bricon CLA 2011-11-07 14:30:02 EST
Created attachment 206542 [details]
Test case to reproduce the issue
Comment 2 Fred Bricon CLA 2011-11-07 14:34:51 EST
Created attachment 206543 [details]
Proposed patch to fix the issue

Inactive profiles are ignored when creating Maven requests. ResolverConfiguration treats all profiles as active profiles, instead of splitting them into active / inactive ones.
Proposed patch deprecates getActiveProfiles() in ResolverConfiguration and replaces it with getSelectedProfiles(). getActiveProfileList() and getInctiveProfileList() return the proper profiles wrt their activation state.
Comment 3 Igor Fedorenko CLA 2011-12-04 23:42:13 EST
Although I agree the proposed change is generally useful, the patch needs little more work

1. all references to now deprecated getActiveProfiles/setActiveProfiles should be removed from m2e-core and m2e-core-test

2. the attached test fails due to missing surefire-plugin version when run against current m2e-core 1.1 (hint: use org.eclipse.m2e.test:m2e-test-parent:1.0.0 parent to make sure test projects use available versions of maven core plugins).
Comment 4 Fred Bricon CLA 2011-12-21 10:26:20 EST
Created attachment 208683 [details]
Updated Patch fixing the issue
Comment 5 Fred Bricon CLA 2011-12-21 10:27:04 EST
Created attachment 208684 [details]
Updated test case
Comment 6 Igor Fedorenko CLA 2011-12-21 18:10:44 EST
applied the patches, thank you. (I amended m2e-core-tests patch not to change tycho version, which is unrelated to ! profile change)
Comment 7 Denis Roy CLA 2021-04-19 13:22:39 EDT
Moved to https://github.com/eclipse-m2e/m2e-core/issues/