WAR Spring JAVA文件太小

时间:2017-07-07 18:54:15

标签: java spring spring-mvc tomcat war

我已经将spring java导出为war并且战争大小大约是20 mb当我把依赖启动弹簧然后我再次导出战争时,大小战争大约20 kb,当我删除spring boot依赖并且我导出再次,仍然只有大约20 kb。所以,当我部署到tomcat时,找不到该方法。

如何解决这个问题?

我的pom.xml

public zitPrintClient(RestTemplateBuilder restTemplateBuilder, 
     @Value("${app.service.url}") rootUri) {
         this.rootUri = rootUri; // if you are only using this once, 
                                 // no need to keep this member variable around
         restTemplate = restTemplateBuilder
                .rootUri(rootUri)
                .build();
    }

1 个答案:

答案 0 :(得分:0)

将代码添加到您的pom中

<build>
    <plugins>
        <plugin>
            <groupId>org.springframework.boot</groupId>
            <artifactId>spring-boot-maven-plugin</artifactId>
        </plugin>
    </plugins>
</build>

<repositories>
    <repository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>http://repo.springsource.org/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </repository>
    <repository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>http://repo.springsource.org/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </repository>
</repositories>
<pluginRepositories>
    <pluginRepository>
        <id>spring-snapshots</id>
        <name>Spring Snapshots</name>
        <url>http://repo.springsource.org/snapshot</url>
        <snapshots>
            <enabled>true</enabled>
        </snapshots>
    </pluginRepository>
    <pluginRepository>
        <id>spring-milestones</id>
        <name>Spring Milestones</name>
        <url>http://repo.springsource.org/milestone</url>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
    </pluginRepository>
</pluginRepositories>