Make it easier to enable non-default Elasticsearch profiles

Description

The default elasticsearch profile is enabled automatically when the testElasticsearchVersion is not defined. I had to do this, because just making this a "default" profile means the profile will only be enabled when no other profile is... So, as soon as another profile is enabled, such as "docs", you lose the configuration of any "default" profile.

Unfortunately, "a property is not defined" for Maven means "not defined explicitly", and definitions in explicitly enabled profiles do not count. So if you just enable the elasticsearch-2.0 profle, in fact you end up with both this profile and the default one enabled. Which won't work for several reasons.

So, if one wants to run tests against a different version than the default one, one must either:

  • Stick to the instructions in README.md and provide the testElasticsearchVersion explicitly: mvn clean install -Pelasticsearch-2.0 -DtestElasticsearchVersion=2.1.0

  • Or disable the default profile (elasticsearch-5.0) explicitly: mvn clean install -P'!elasticsearch-5.0,elasticsearch-2.0'

This is not very practical, and we should try to improve the situation.

See https://github.com/hibernate/hibernate-search/pull/1329#issuecomment-288990676 and https://github.com/hibernate/hibernate-search/pull/1329#issuecomment-288993965

Environment

None

Activity

Show:
Sanne Grinovero
March 24, 2017, 11:27 AM

Alternatively, failing failing fast with a reminder message would be great too.

Assignee

Unassigned

Reporter

Yoann Rodière

Labels

None

Suitable for new contributors

None

Pull Request

None

Feedback Requested

None

Components

Fix versions

Affects versions

Priority

Minor
Configure