os.detected maven properties not detected by eclipse

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"




Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: