最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Overwriteignore excluded-artifacts from quarkus-undertow - Stack Overflow

programmeradmin1浏览0评论

A Maven project uses Quarkus 3/Untertow which uses the jakarta.servlet namespace. There also exists a separate library that still uses the old javax.servlet namespace, without an update to the jakarta namespace.

Using the .apache.felix.http.wrappers artifact there could be a conversion between the jakarta namespace into the javax namespace, but the interface javax.servlet.http.HttpServletRequest is needed at runtime.

Adding javax.servlet:javax.servlet-api:4.0.1 as runtime dependency doesn't work as the pom.xml for quarkus-undertow uses the following plugin to exclude some artifacts:

            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-extension-maven-plugin</artifactId>
                <configuration>
                    <capabilities>
                        <provides>io.quarkus.servlet</provides>
                    </capabilities>
                    <excludedArtifacts>
                        <excludedArtifact>.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec</excludedArtifact>
                        <excludedArtifact>.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec</excludedArtifact>
                        <excludedArtifact>.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec</excludedArtifact>
                        <excludedArtifact>javax.servlet:servlet-api</excludedArtifact>
                        <excludedArtifact>javax.servlet:javax.servlet-api</excludedArtifact>
                    </excludedArtifacts>
                    <parentFirstArtifacts>
                        <!--
                        Sentry logging has a dependency on the Servlet API, so we load its parent first to
                        prevent class loading problems.

                        see 
                        -->
                        <parentFirstArtifact>jakarta.servlet:jakarta.servlet-api</parentFirstArtifact>
                    </parentFirstArtifacts>
                </configuration>
            </plugin>

See excluded-artifacts on from

What is the recommended way to overcome this issue (without updating the library to the Jakarta namespace)?

A Maven project uses Quarkus 3/Untertow which uses the jakarta.servlet namespace. There also exists a separate library that still uses the old javax.servlet namespace, without an update to the jakarta namespace.

Using the .apache.felix.http.wrappers artifact there could be a conversion between the jakarta namespace into the javax namespace, but the interface javax.servlet.http.HttpServletRequest is needed at runtime.

Adding javax.servlet:javax.servlet-api:4.0.1 as runtime dependency doesn't work as the pom.xml for quarkus-undertow uses the following plugin to exclude some artifacts:

            <plugin>
                <groupId>io.quarkus</groupId>
                <artifactId>quarkus-extension-maven-plugin</artifactId>
                <configuration>
                    <capabilities>
                        <provides>io.quarkus.servlet</provides>
                    </capabilities>
                    <excludedArtifacts>
                        <excludedArtifact>.jboss.spec.javax.servlet:jboss-servlet-api_4.0_spec</excludedArtifact>
                        <excludedArtifact>.jboss.spec.javax.servlet:jboss-servlet-api_3.1_spec</excludedArtifact>
                        <excludedArtifact>.jboss.spec.javax.servlet:jboss-servlet-api_3.0_spec</excludedArtifact>
                        <excludedArtifact>javax.servlet:servlet-api</excludedArtifact>
                        <excludedArtifact>javax.servlet:javax.servlet-api</excludedArtifact>
                    </excludedArtifacts>
                    <parentFirstArtifacts>
                        <!--
                        Sentry logging has a dependency on the Servlet API, so we load its parent first to
                        prevent class loading problems.

                        see https://github/quarkusio/quarkus/issues/7407
                        -->
                        <parentFirstArtifact>jakarta.servlet:jakarta.servlet-api</parentFirstArtifact>
                    </parentFirstArtifacts>
                </configuration>
            </plugin>

See excluded-artifacts on https://quarkus.io/guides/extension-metadata#quarkus-extension-properties from

What is the recommended way to overcome this issue (without updating the library to the Jakarta namespace)?

Share Improve this question asked Feb 2 at 12:41 Andrei Damian-FeketeAndrei Damian-Fekete 1,98024 silver badges28 bronze badges 2
  • Nto sure if this is about quarkus or maven (I suspect the later). – Turing85 Commented Feb 2 at 13:02
  • Could you explain a bit more clearly what you're trying to achieve with .apache.felix.http.wrappers? – Guillaume Smet Commented Feb 2 at 13:55
Add a comment  | 

1 Answer 1

Reset to default 0

Could you explain a bit more clearly what you're trying to achieve with .apache.felix.http.wrappers?

Because if you want to use it completely independently from Quarkus Undertow, then I could be convinced to drop these exclusions. Indeed you cannot override them yourself. I did that when we transitioned to be cautious but we could probably relax it now.

But if you are trying to use .apache.felix.http.wrappers as part of the Undertow infrastructure then it won't work as you would need a version using the Jakarta namespace.

Let me know and if it's the former, we can relax things in the next version.

发布评论

评论列表(0)

  1. 暂无评论