Maven Dependency with Profiles

Hello all,

I am building my own component using gradle. My component has a dependency to a maven package that in it’s POM file has a dependency that will download 1 of 3 packages based on a profile:

Looks like this:


Windows


windows



<sikulix.libs>sikulixlibswin</sikulix.libs>



Unix


unix



<sikulix.libs>sikulixlibslux</sikulix.libs>



Mac


mac



<sikulix.libs>sikulixlibsmac</sikulix.libs>


and then the dependency:

com.sikulix
${sikulix.libs}
${project.version}

When I had the depency I need and it tries and download its dependencies, I get the following error message:

Could not resolve com.sikulix:${sikulix.libs}:1.1.0.

Do you guys have any suggestion on how to solve this problem?

Thank you so much,
Goncalo

The blog post “Gradle’s Support for Maven POM Profiles” describes a way to implement build-time profiles in Gradle. That should get you started.