有 Java 编程相关的问题?

你可以在下面搜索框中键入要查询的问题!

java如何从maven构建中删除staxapi

我有一个maven EAR项目,有五个模块(EAR、JPA、WSVC、WSVCRouter、Properties)。 当我触发构建时,我想阻止staxapi作为EAR的一部分进行构建。 我在谷歌上搜索并找到了exceptions标记,我在所有我有依赖项标记的地方都使用了它,但这个jar仍然没有被排除在外。谁能帮我一下吗。谢谢

<dependencies>
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>


      <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
    </dependency>

</dependencies>  

<dependencyManagement>
    <dependencies>
        <dependency>
            <groupId>com.cnasurety.framework</groupId>
            <artifactId>framework-common</artifactId>
            <version>1.0.0.2</version>
           <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>   
        </dependency>


        <dependency>
            <groupId>com.cnasurety.framework</groupId>
            <artifactId>framework-jpa</artifactId>
            <version>1.0.0.4</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.cnasurety.testutils</groupId>
            <artifactId>test-utilities</artifactId>
            <version>1.0.0.5</version>
            <scope>test</scope>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.cna.tech.framework</groupId>
            <artifactId>service-invocation</artifactId>
            <version>1.1.0.0</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>com.cna.tech.framework</groupId>
            <artifactId>service-invocation-cxf</artifactId>
            <version>1.0.3.0</version>
            <exclusions>
                <exclusion>
                    <groupId>org.apache.cxf</groupId>
                    <artifactId>cxf-common-utilities</artifactId>
                </exclusion>
                 <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-javamail_1.4_spec</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_3.0_spec</artifactId>
            </exclusion>


            <exclusion>
                        <groupId>stax</groupId>
                        <artifactId>stax-api</artifactId>
            </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-tools-common</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-javamail_1.4_spec</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_3.0_spec</artifactId>
            </exclusion>


            <exclusion>
                        <groupId>stax</groupId>
                        <artifactId>stax-api</artifactId>
            </exclusion>
        </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-frontend-jaxws</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-javamail_1.4_spec</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_3.0_spec</artifactId>
            </exclusion>


            <exclusion>
                        <groupId>stax</groupId>
                        <artifactId>stax-api</artifactId>
            </exclusion>
        </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-transports-http</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-javamail_1.4_spec</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_3.0_spec</artifactId>
            </exclusion>


            <exclusion>
                        <groupId>stax</groupId>
                        <artifactId>stax-api</artifactId>
            </exclusion>
        </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.cxf</groupId>
            <artifactId>cxf-rt-databinding-jaxb</artifactId>
            <version>${cxf.version}</version>
            <exclusions>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-javamail_1.4_spec</artifactId>
            </exclusion>
            <exclusion>
                <groupId>org.apache.geronimo.specs</groupId>
                <artifactId>geronimo-servlet_3.0_spec</artifactId>
            </exclusion>


            <exclusion>
                        <groupId>stax</groupId>
                        <artifactId>stax-api</artifactId>
            </exclusion>
        </exclusions>
        </dependency>
        <dependency>
            <groupId>org.apache.commons</groupId>
            <artifactId>commons-lang3</artifactId>
            <version>3.5</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>javax</groupId>
            <artifactId>javaee-api</artifactId>
            <version>5.0</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>

        </dependency>

        <!-- SLF4J logging API and implementation -->
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-api</artifactId>
            <version>1.7.25</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>org.slf4j</groupId>
            <artifactId>slf4j-log4j12</artifactId>
            <version>1.7.25</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.12</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>javax.transaction</groupId>
            <artifactId>jta</artifactId>
            <version>1.1</version>

        <exclusions>
                         <exclusion>
                                <groupId>stax</groupId>
                                <artifactId>stax-api</artifactId>
                    </exclusion>
            </exclusions>
        </dependency>
    </dependencies>

enter code here

共 (1) 个答案

  1. # 1 楼答案

    您是否尝试了^{}以查看是否有其他库不使用staxapi

    在本例中,{a2}显示了348个其他lib使用staxapi

    你还可以试试它的用法

    致意