Problem:
IDEA ignores options set via Maven Profiles.
For instance, in the example below, if the Project uses JDK 8, xml-apis dependency is added to the classpath:
<...>
<profiles>
<profile>
<id>java8</id>
<activation>
<jdk>1.8</jdk>
</activation>
<dependencies>
<dependency>
<groupId>xml-apis</groupId>
<artifactId>xml-apis</artifactId>
<version>1.4.01</version>
</dependency>
</dependencies>
</profile>
</profiles>
<...>
Cause:
IDEA determines the status of Maven Profiles during Maven Sync and does not re-access it when a Run Configuration starts, since it is a resource-intensive/time-consuming process.
Resolution:
- Run a Maven Sync after making the changes that affect Profiles.
- Use Maven Run Configurations.
- Enable the "Delegate build/run actions to Maven" option.
Comments
0 comments
Please sign in to leave a comment.