January 14, 2012 at 4:34 am #322340
In MyEclipse 8.6, when I provide a profile in the Maven run configuration, it works correctly based off of the profiles in my POM. in MyEclipse 10, I am unable to apply the profile using the exact same configuration. It uses the default profile no matter what value I have in the ‘profiles’ text box. Any idea why this would be happening?January 17, 2012 at 1:14 am #322392
Sorry you’re seeing this issue.
I couldn’t replicate the problem. I added a profile to the POM and then activated it in two ways. Firstly, in the run configuration, I added the ID of the profile to the configuration and ran it. No problem. Then, as an alternative, I added the profile to the project properties, in the Maven4MyEclipse section. Again, it picked up the active profile.
There was a change to profiles support in maven 3 (which is what MyEclipse 10 uses), though I don’t think it applies to you.
Could you describe the exact steps you’re taking, in MyEclipse 10, to activate the profile, including where you define the profiles, and see if there are any relevant error messages in the log file? This probably has no effect but could you also mention the OS you’re using?
It would help if you could create a minimal test case that has this problem and send it to us (you can attach it here, using the fields that appear below the message entry text box when posting).January 25, 2012 at 5:11 pm #322697
I found a little more out today.
In my .settings folder, there is a file called org.eclipse.m2e.core.prefs. This file has a property “activeProfile” that is set to blank. If I manually change that to ‘test’, then run maven install, the ‘test’ profile is correctly applied
However, the profile still DOES NOT get applied when I run from the Run window, as I explained in my first post. See the screenshot. The default profile gets applied no matter what value I have in the Profiles input.
Attachments:You must be logged in to view attached files.January 25, 2012 at 10:04 pm #322702
I see you are using a Mac. I tried on a Mac Lion system and couldn’t replicate the problem. I created a simple Maven project (no archetype selection), added a profile to change the final name, then activated that profile in a run configuration that has a goal of “package” set. When I ran the configuration, it produced the overridden jar file name. Could you just try these steps to make sure this simple case is also failing?
In your run configuration, select the debug option and run it again. Check the debug output line that lists the properties used. There should be a “-Ptest” in the properties, indicating an active profile of “test”. Is that string there?
Please also attach your installation details (MyEclipse->Installation Summary->Installation Details) in your response and the .log file in the .metadata folder of your workspace (but please clear the log first, then recreate the problem so the log file contains the minimum amount of messages).