Question

My multi module project is made of public (open source) and private (undisclosed) modules. I need to create a master-all pom file referencing master-public and master-private, so that some plugins & commands are aware of all projects (e.g. cobertura). master-all has thus to be private as it references master-private.

The problem is that master-public should reference its parent master-all which is private, so users of public modules only won't be able to build them:

<groupId>group</groupId>
<artifactId>master-public</artifactId>
<parent>
    <groupId>group</groupId>
    <artifactId>master-all</artifactId>
    <version>1.0-SNAPSHOT</version>
</parent>

Nesting master-public in master-private could be a solution for maven, but will be a mess for git.

Is there a clean way to do this?

Was it helpful?

Solution

You can have your master-private reference your master-public. But in my experience, it is best to keep them completely separate. Eventually, the master-public will be tuned more to open source, possibly deploying to Maven Central, while the master-private will deploy to your internal repository and possible have some special settings that only make sense in your enterprise environment. Copy whatever you absolutely need from your master-private to your master-public and disconnect the two.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top