Spring boot application with apache axis

前端 未结 1 1127
灰色年华
灰色年华 2021-02-04 18:18

I am trying to run a spring boot jar which has axis2 dependencies in it. I am using spring boot maven plugin to build the jar (with dependencies). When I try to run my jar, I ge

相关标签:
1条回答
  • 2021-02-04 18:35

    It looks like Axis can't cope with being run from a jar that's nested within another jar. It works fine in Eclipse as the Axis jar is available directly on the filesystem rather than being nested inside your Spring Boot application's jar file.

    You can configure your application's fat jar file so that Spring Boot knows to unpack the Axis jar into a temporary location when it's run. If you're using Maven:

    <build>
        <plugins>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <requiresUnpack>
                        <dependency>
                            <groupId>org.apache.axis2</groupId>
                            <artifactId>axis2</artifactId>
                        </dependency>
                    </requiresUnpack>
                </configuration>
            </plugin>
        </plugins>
    </build>
    

    And if you're using Gradle:

    springBoot  {
        requiresUnpack = ['org.apache.axis2:axis2']
    }
    

    See the Spring Boot documentation for some further details.

    0 讨论(0)
提交回复
热议问题