I recently hit this weird error with one of my Java projects using maven. It would build perfectly fine from command line but fail in eclipse. It was due to eclipse not being able to recognize this property, os.detected.classifier
, that we had added to one of our pom files. This property is handled by the os maven plugin and is pretty useful for managing dependencies with os specific artifacts. Using this property enables us to use the same pom on different os’s which is important when you want to support people using Windows, OSX, and linux. The plugin works properly from command line but trips up eclipse.
I googled around for how different folks have solved this problem and in my opinion, the simplest solution is to update your ~/.m2/settings.xml
to hard code values for os.detected
properties. For example, I use a mac so my settings.xml
looks like the following:
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
https://maven.apache.org/xsd/settings-1.0.0.xsd">
<profiles>
<profile>
<id>os-properties</id>
<properties>
<os.detected.name>osx</os.detected.name>
<os.detected.arch>x86_64</os.detected.arch>
<os.detected.classifier>osx-x86_64</os.detected.classifier>
</properties>
</profile>
</profiles>
<activeProfiles>
<activeProfile>os-properties</activeProfile>
</activeProfiles>
</settings>