maven <exclusions>之缺少 <exclusion> 直接 <groupId> 引发的惨案

在使用maven 时,为了排除不需要的依赖包时忘记写父标签,代码如下:

<dependencies>

        <dependency>

            <groupId>com.simpledt.inject</groupId>

            <artifactId>mes-injection-jdk8</artifactId>

            <version>3.0.0</version>

        </dependency>

        

        <!-- mes-mould-jdk8 模具部分 -->

        <dependency>

            <groupId>com.simpledt.mould</groupId>

            <artifactId>mes-mould-jdk8</artifactId>

            <version>3.0.0</version>

            <exclusions>

                <exclusion>

                         <groupId>com.simpledt.base</groupId>

                         <artifactId>mes-base-jdk8</artifactId>

                </exclusion>

            </exclusions>

        </dependency>

        

 

目的是:需要 

                        <groupId>com.simpledt.mould</groupId> 

                        <artifactId>mes-mould-jdk8</artifactId>

                        <version>3.0.0</version>

 

                        的jar 包依赖,但不需要 :

                                                            <groupId>com.simpledt.base</groupId>

                                                             <artifactId>mes-base-jdk8</artifactId>

 

所以使用 <exclusion>  ....  </exclusion>  将不需要依赖的jar包排除在外,当初忘记写 <exclusion> 的 父标签,也就是 <exclusions>,故maven报出以下错误:

 

[INFO] Scanning for projects...

[ERROR] [ERROR] Some problems were encountered while processing the POMs:

[ERROR] Malformed POM D:\eclipse-workspace\MES-SQ\pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<exclusions>\r\n            \t<groupId>... @36:23)  @ D:\eclipse-workspace\MES-SQ\pom.xml, line 36, column 23

[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. @ line 94, column 21

@

[ERROR] The build could not read 1 project -> [Help 1]

[ERROR]   

[ERROR]   The project com.tomo.mes:mes-sq:1.0.0 (D:\eclipse-workspace\MES-SQ\pom.xml) has 1 error

[ERROR]     Malformed POM D:\eclipse-workspace\MES-SQ\pom.xml: Unrecognised tag: 'groupId' (position: START_TAG seen ...<exclusions>\r\n            \t<groupId>... @36:23)  @ D:\eclipse-workspace\MES-SQ\pom.xml, line 36, column 23 -> [Help 2]

[ERROR]

[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.

[ERROR] Re-run Maven using the -X switch to enable full debug logging.

 

 

 

加上 <exclusions></exclusions>后顺利打包成功!

 

特此记一下这个错误,方便日后查阅。         

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值