【问题标题】:IntelliJ IDEA says that <systemProperties/> element is not allowed inside <configuration/>IntelliJ IDEA 说 <systemProperties/> 元素不允许在 <configuration/>
【发布时间】:2017-06-23 16:40:21
【问题描述】:

我在 maven 中使用了一个使用 Jetty 的插件。

在这个插件中,我需要做一个配置来设置maxFormContentSize

<plugin>
    <groupId>com.organization.example</groupId>
    <artifactId>maven-example-plugin</artifactId>
    <version>${example.version}</version>
    <dependencies>
        <!-- -->
    </dependencies>
    <configuration>
        <systemProperties>
            <systemProperty>
            <name>org.mortbay.jetty.Request.maxFormContentSize</name>
                <value>500000</value>
            </systemProperty>
        </systemProperties>
        <script>${example.script}</script>
    </configuration>
</plugin>

问题是 Intellij IDEA 说这里不允许使用 systemProperties 元素:

Element systemProperties is not allowed here

什么是 IntelliJ IDEA 的正确配置不显示此错误?我已经做了一个research about this subject,但似乎这是唯一可能的配置。

我正在使用 maven 2.2.1 和 IntelliJ IDEA 2017.1.4。 Jetty 版本是 7.6.8.v20121106。

【问题讨论】:

    标签: maven intellij-idea jetty


    【解决方案1】:

    maven 插件的&lt;configuration&gt; 部分只能包含该特定插件在其各种目标中支持的内容。

    并非所有 maven 插件都支持&lt;systemProperties&gt;,只有某些插件支持。

    由于您删除了您正在努力使用的实际插件,因此我无法将您链接到特定插件的文档页面以了解其目标和配置。

    寻找类似的东西......

    http://maven.apache.org/plugins/maven-javadoc-plugin/javadoc-mojo.html

    ...但是对于您的特定插件

    问 Maven

    您也可以在命令行上询问 maven 来描述插件,甚至是插件中的特定目标。

    注意:以下示例命令行适用于 maven-help-plugin v2.2 或更高版本。

    描述所有目标:

    $ mvn help:describe -DgroupId=org.eclipse.jetty \
                        -DartifactId=jetty-maven-plugin \
                        -Dversion=9.4.6.v20170531
    

    详细描述具体目标(带参数):

    $ mvn help:describe -DgroupId=org.eclipse.jetty \
                        -DartifactId=jetty-maven-plugin \
                        -Dversion=9.4.6.v20170531 \
                        -Dgoal=start \
                        -Ddetail=true
    

    【讨论】:

    • 我认为这个设置是 maven 模式,而不是插件本身。这解释了很多。谢谢!该插件是 MyContainer (github.com/murer/mycontainer),但没有很好的文档记录。
    猜你喜欢
    • 1970-01-01
    • 2016-07-31
    • 2019-06-10
    • 1970-01-01
    • 2016-10-23
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-18
    相关资源
    最近更新 更多