I have a Maven project that builds great on the command line. I want to edit project files in Eclipse Luna 4.4.1, but when I load the project, it reports the following errors in my pom.xml file:
cvc-datatype-valid.1.2.1: '$ {MYVAR}' is not a valid value for 'boolean'
cvc-type.3.1.3: The value '$ {MYVAR}' of the element 'enabled' is not valid.
This problem is similar to Validating Maven pom.xml when boolean is a property that has no answers yet. Although I can compile Maven on the command line, it is annoying that Eclipse constantly reports this as an error. Is there a way to get rid of these errors without disabling checking the rest of the pom.xml file?
According to http://maven.apache.org/pom.html#Properties I am referencing the property correctly MYVAR.
Here is the relevant contents of my pom.xml file:
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<artifactId>myproject</artifactId>
<groupId>org.mydomain</groupId>
<packaging>jar</packaging>
<version>1.0-SNAPSHOT</version>
<properties>
<spring-version>3.0.2.RELEASE</spring-version>
<MYVAR>false</MYVAR>
</properties>
<repositories>
<repository>
<id>internal_repo</id>
<name>my internal repository for offline use</name>
<url>file://${INT_REPO_HOME}/java/maven_repo</url>
<layout>default</layout>
</repository>
<repository>
<id>central</id>
<url>http://repo1.maven.org/maven2</url>
<releases>
<enabled>${MYVAR}</enabled>
</releases>
<snapshots>
<enabled>${MYVAR}</enabled>
</snapshots>
</repository>
</repositories>
</project>
source
share