如何从maven pom插件配置中读取枚举?

时间:2011-08-31 15:53:17

标签: maven maven-plugin

我有一个maven插件,我希望有以下配置:

<ObjectName>
  <ObjectType>
    <Param1>12</Param1>
    <EnumTypeParam>4</EnumTypeParam>
  </ObjectType>
</objectName>

其中EnumTypeParam是java枚举。我将如何在pom文件中执行此操作?

1 个答案:

答案 0 :(得分:-2)

我最终使用了这样的东西:

<plugin>
    <groupId>com.google.protobuf.tools</groupId>
    <artifactId>maven-protoc-plugin</artifactId>
    <version>0.1.11-SNAPSHOT</version>
    <configuration>
        <protocExecutable>protoc</protocExecutable>
        <protoSourceRoot>${project.basedir}/target/protobuff/speed</protoSourceRoot>
                <languageSpecifications>
                    <LanguageSpecification>
                        <language>JAVA</language>
                        <outputDirectory>${project.basedir}/target/generated-sources/java</outputDirectory>
                    </LanguageSpecification>
                    <LanguageSpecification>
                        <language>CPP</language>
                        <outputDirectory>${project.basedir}/target/generated-sources/cpp</outputDirectory>
                    </LanguageSpecification>
                </languageSpecifications>
            </configuration>
            <executions>
                <execution>
                    <goals>
                        <goal>compile</goal>
                        <goal>testCompile</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>