JoyOfCoding icon indicating copy to clipboard operation
JoyOfCoding copied to clipboard

Define "grader" and "haltOnFailingCoverage" Maven properties

Open DavidWhitlock opened this issue 3 years ago • 2 comments

Several students have been confused by the "errors" reported by IntelliJ related to the undefined grader and haltOnFailingCoverage properties referenced in the grader Maven profile.

I should investigate if I can define the properties in such a way so that the grader profile still behaves as expected without causing these errors.

Perhaps I can move the declaration of the grader profile to a parent POM.

DavidWhitlock avatar Jul 31 '21 12:07 DavidWhitlock

With regards to the use of ${grader} that IntelliJ doesn't like:

      <activation>
        <activeByDefault>${grader}</activeByDefault>
      </activation>

There is a way to activate a profile based on a property being set:

https://maven.apache.org/guides/introduction/introduction-to-profiles.html

However, I have a feeling that it is this way for a reason. I added in 292833814caa262853a84687567d66dfcb2cce87 to get the archetype integration tests to work.

DavidWhitlock avatar Nov 21 '21 16:11 DavidWhitlock

I tried using a custom settings.xml file for the tests: https://maven.apache.org/archetype/maven-archetype-plugin/integration-test-mojo.html#settingsFile

But that didn't seem to activate the grader profile.

I tried changing the profile to be activated by a property. Even though I seta <property> in the pom.xml, the profile still wasn't activated.

I can at least get rid of the "haltOnFailingCoverage" warning by defining a property in the top-level POM. The (valid) complain about activeByDefault is that the value isn't a boolean. I don't know how to get rid of that.

DavidWhitlock avatar Nov 21 '21 19:11 DavidWhitlock