在我的pom.xml中,我配置了一個插件來將某些Protobuf文件轉換爲Java類文件。它看起來像這樣:如何將特定配置添加到Maven插件
<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>
出於這種的Maven生成.classpath
文件,輸入以下內容:
<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>
我現在想的Maven做的是一個額外的「屬性」項添加到該類路徑條目,以便該條目看起來像這樣:
<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>
像這樣,我不會從該代碼部分得到警告。
目前我只是不知道該怎麼做。我必須編輯哪些文件或其他設置?在Eclipse中我可以做到這一點?
但是這或多或少是一個普遍性的問題作爲Maven可以如何被修改爲包括定製的項目,因爲我們有一些更多的斑點,我們將要添加自定義的東西英寸
幾乎總結了這個功能尚不存在。謝謝! – Sebastian