title: Is it possible to setup a Maven profile that uses a modified module-info.java for an otherwise unchanged project?
body: <p>I am trying to setup a Maven profile that uses a modified module-info.java for an otherwise unchanged project.</p>
  
  <p>What I can do is:</p>
  
  <ul>
  <li>create an alternative module-info.java in an alternative src directory.</li>
  <li>add that source directory depending on a profile via the <code>build-helper-maven-plugin</code> in phase <code>generate-sources</code></li>
  </ul>
  
  <p>However I did not yet manage to let him ignore the other (default) module-info.java file and he will report a conflict (module already exists, etc.).</p>
  
  <p>My question is: How can I add a <code>requires</code>to a module-info.java file depending on a Maven profile?</p>
  
  <p>To explain the need for this - maybe strange - request: my build process uses Clover to perform an analysis of test coverage. Clover needs to instrument the library. The clover build steps appears to require the clover.jar to be visible. The clover step works if clover is added to the module-info.java, but I do not like to have it there in the release step. So I would like to move the clover step to a profile.</p>