Seb*_*ian 5 java eclipse protocol-buffers maven
在我的pom.xml中,我配置了一个插件,将某些Protobuf文件转换为Java类文件.它看起来像这样:
<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>
Run Code Online (Sandbox Code Playgroud)
在这个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>
Run Code Online (Sandbox Code Playgroud)
我现在想要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>
Run Code Online (Sandbox Code Playgroud)
就像那样,我不会从代码的那一部分得到警告.
目前我只是不知道该怎么做.我必须编辑哪些文件或其他设置?在Eclipse中我可以这样做吗?
但这或多或少是关于如何修改Maven以包含自定义条目的一般性问题,因为我们还有一些我们想要添加自定义内容的位置.
| 归档时间: |
|
| 查看次数: |
466 次 |
| 最近记录: |