从springboot中排除maven依赖项

时间:2016-03-03 10:11:15

标签: java maven spring-boot

我有一个springboot项目,它将所有相关的jar添加到 lib 文件夹中。 我怎么能避免这个?

我尝试了这个并且它无法正常工作

<plugin>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-maven-plugin</artifactId>
    <configuration>
        <!-- <excludeScope>compile</excludeScope>
                        <excludeArtifactIds>*</excludeArtifactIds>
                        <excludeGroupIds>*.*</excludeGroupIds> -->
        <exclude>
            <groupId>*.*</groupId>
            <artifactId>*</artifactId>
        </exclude>
    </configuration>
</plugin>

我不想将依赖项作为提供

还有其他解决方案吗?

1 个答案:

答案 0 :(得分:5)

您可以通过指定pom中不需要的依赖项来排除。 像下面的东西。

这里我不需要通过boot提供的嵌入式tomcat。因此,我们可以使用以下代码排除它:

preg_match_all('/td class=\"bbb\">(.*?)<\/td><td>(\d+)<\/td>/',$html,$out);
for ($i = 1; $i < count($out) - 1; $i += 2) {
    echo "$out[$i]:";
    echo $out[$i+1];
    echo "\n";
}

相关问题