2

On my pom.xml I have created some profiles. On my Eclipse project I have selected the profiles I must use to run with TestNG. The test must doing different things depends on the profile. I try use ${project.activeProfiles[0].id}, but does not work for me.

The Eclipse selected profiles:

Selected profiles

The TestNG execution error:

TestNG error

MVN commands:

When I run the mvn help:active-profiles command the result is:

The following profiles are active:
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

And the mvn help:all-profiles command result is:

[INFO] Listing Profiles for Project: com.myproject:project:jar:1.0
  Profile Id: UAT-Dev-Mt (Active: false , Source: pom)
  Profile Id: UAT-Dev-Bg (Active: false , Source: pom)
  Profile Id: PROD-Dev-Mt (Active: false , Source: pom)
  Profile Id: PROD-Dev-Bg (Active: false , Source: pom)
  Profile Id: Acceptance (Active: false , Source: pom)
  Profile Id: Regression (Active: false , Source: pom)
  Profile Id: CriticalPath (Active: false , Source: pom)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------

Why TestNG on Eclipse does not work, for me, with this selected profiles and with the maven pom variable?

Thank you in advance.

j.barrio
  • 1,006
  • 1
  • 13
  • 37

1 Answers1

0

TestNG eclipse plugin does not have well integration with Maven, the limited feature provided by TestNG Eclipse plugin is just ready the system properties (and/or environment variables) defined in the pom.xml of current active profile. anything else, like profile specific goals won't be executed at all.

so back to your case, if you just want to the profile managed system properties, you can select one active profile then simple run the testng tests, the properties will be injected to the runtime testng process. for anything else, not supported yet.

XuQing Tan
  • 362
  • 1
  • 4
  • 11