I started noticing these attributes in my .classpath file after running Maven -> Update Project...
tool with Update project configuration from pom.xml
option checked:
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/classes" path="src">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
...
</classpathentry>
The attribute that made me raise my eyebrows the most was this: <attribute name="optional" value="true"/>
.
What does it do? It looks mighty suspicious as I find nothing optional about my java source files in a project.
This is added because the src
folder is an optional folder for maven. The project should not complain if src
is missing. (Actually by default, this should be src/main/java
and src/test/java
). This means that adding or removing src
as a source file should not require updating your maven configuration.
This attribute doesn't need to be there in your case, but it makes it plain that maven doesn't care if the source folder exists as long as everything can be compiled (so Eclipse shouldn't care either).
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With