Test that profile metadata is retained.

Breaks tests, as meta isn't retained yet.
Test that :java-opts are converted to :jvm-opts.

Inside profiles. Ensures #1445 is fixed, thus closes #1445.
Retain metadata after profile setup. Fixes #1414.
Merge branch 'retain-profile-metadata'