Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/java/396.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何配置maven和intellij以包含groovy和java的参数编译器标志_Java_Maven_Intellij Idea_Groovy_Jackson - Fatal编程技术网

如何配置maven和intellij以包含groovy和java的参数编译器标志

如何配置maven和intellij以包含groovy和java的参数编译器标志,java,maven,intellij-idea,groovy,jackson,Java,Maven,Intellij Idea,Groovy,Jackson,嘿,我之所以写这篇文章,是因为我花了一些时间试图配置Jackson的ObjectMapper,使其在DTO上没有@JsonCreator和@JsonProperty注释的情况下工作。我想要实现的结果是能够在intellij和maven控制台中运行Spock的测试(groovy)。因为这个问题已经解决:intellij在maven配置下自动拾取: <plugin> <groupId>org.apache.maven.plugins</groupId>

嘿,我之所以写这篇文章,是因为我花了一些时间试图配置Jackson的ObjectMapper,使其在DTO上没有
@JsonCreator
@JsonProperty
注释的情况下工作。我想要实现的结果是能够在intellij和maven控制台中运行Spock的测试(groovy)。

因为这个问题已经解决:intellij在maven配置下自动拾取:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <configuration>
      <compilerArgument>-parameters</compilerArgument>
      <testCompilerArgument>-parameters</testCompilerArgument>
   </configuration>
</plugin>
<plugin>
    <groupId>org.codehaus.gmavenplus</groupId>
    <artifactId>gmavenplus-plugin</artifactId>
    <version>${gmavenplus-plugin.version}</version>
    <configuration>
        <parameters>true</parameters>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>compileTests</goal>
            </goals>
        </execution>
    </executions>
</plugin>

org.apache.maven.plugins
maven编译器插件
-参数
-参数
另外,如果您想在groovy中使用Spock进行测试,则需要以下插件配置:

<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-compiler-plugin</artifactId>
   <configuration>
      <compilerArgument>-parameters</compilerArgument>
      <testCompilerArgument>-parameters</testCompilerArgument>
   </configuration>
</plugin>
<plugin>
    <groupId>org.codehaus.gmavenplus</groupId>
    <artifactId>gmavenplus-plugin</artifactId>
    <version>${gmavenplus-plugin.version}</version>
    <configuration>
        <parameters>true</parameters>
    </configuration>
    <executions>
        <execution>
            <goals>
                <goal>compile</goal>
                <goal>compileTests</goal>
            </goals>
        </execution>
    </executions>
</plugin>

org.codehaus.gmavenplus
gmavenplus插件
${gmavenplus plugin.version}
真的
编译
编译测试
附加信息:

  • 在我写这篇文章的时候,只有一个版本的groovy编译器适合我:2.5.0-alpha-1
  • 我使用的maven编译器插件版本是3.7.0。3.1版根本不起作用。我没有试过其他人
  • 我希望这能节省一些时间:)