In my pom.xml I configure a plugin to convert certain Protobuf files to Java class files. It looks like this:
<plugin>
<groupId>com.github.igor-petruk.protobuf</groupId>
<artifactId>protobuf-maven-plugin</artifactId>
<version>0.5.3-SNAPSHOT</version>
<executions>
<execution>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
<configuration>
<protocCommand>${basedir}/protoc/bin/protoc</protocCommand>
<inputDirectories>
<inputDirectory>proto</inputDirectory>
</inputDirectories>
</configuration>
</plugin>
Out of this Maven generates the .classpath
file with the following entry:
<classpathentry kind="src" output="target/classes" path="target/generated-sources/protobuf">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
</attributes>
</classpathentry>
What I would now like Maven to do is to add an additional "attribute" entry to that classpath entry so that the entry looks like this:
<classpathentry kind="src" output="target/classes" path="target/generated-sources/protobuf">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
<attribute name="ignore_optional_problems" value="true"/>
</attributes>
</classpathentry>
Like that I won't get warnings from that part of the code.
At the moment I just don't know how to do that. Which files or other settings do I have to edit? Where in Eclipse can I do that?
But this is more or less a general question as to how Maven can be modified to include customized entries, because we have some more spots where we would want to add custom things in.
Login and vote for this Feature-Request:
There already is a patch, improve it.
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