Question

We would like to bundle library dependencies from (Alfresco or Jackrabbit or ...) based on the customer choice. The number of dependencies actually varies based on the chosen vendor. How do we provide hooks at the maven level, so that the final product just includes the dependent jars as per customer selection.

Was it helpful?

Solution

You could achieve this by putting the needed dependencies into vendor-specific profiles in your pom:

<profiles>
    <profile>
        <id>Alfresco</id>
        <dependencies>
            ...
        </dependencies>
    </profile>
    <profile>
        <id>Jackrabbit</id>
        <dependencies>
            ...
        </dependencies>
    </profile>
</profiles>

Then you can activate the desired profile for your build like:

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