Maven不包括jar中的依赖性

时间:2017-12-14 02:42:47

标签: java maven

我已经尝试了一段时间来解决为什么我的maven / pom配置不包括jar包中的依赖性。我把pom包括在下面。我正在使用" mvn package"。我似乎甚至无法建立" chartscan2 ......"命名包。可能是由于对Maven缺乏了解 - 或者是大脑褪色 - 任何指导都赞赏!

这似乎与未执行的目标有关 - 请参阅下面的答案

<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>

    <groupId>foo.bar.onpremise</groupId>
    <artifactId>onpremise-3m-plugin</artifactId>
    <version>1.0.12-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>onpremise 3M plugin</name>


    <properties>
        <jdk.version>1.8</jdk.version>
        <mvn.compiler.version>3.6.1</mvn.compiler.version>
    </properties>

    <repositories>
        <repository>
            <id>com.springsource.repository.bundles.external</id>
            <name>SpringSource Enterprise Bundle Repository - External Bundle Releases</name>
            <url>http://repository.springsource.com/maven/bundles/external</url>
        </repository>
    </repositories>
    <dependencies>

        <dependency>
            <groupId>foo.bar.onpremise</groupId>
            <artifactId>onpremise-plugin</artifactId>
            <version>0.0.1-SNAPSHOT</version>
        </dependency>
        <dependency>
            <groupId>com.github.jai-imageio</groupId>
            <artifactId>jai-imageio-core</artifactId>
            <version>1.2.1</version>
        </dependency>
        <dependency>
            <groupId>javax.media.jai</groupId>
            <artifactId>com.springsource.javax.media.jai.core</artifactId>
            <version>1.1.3</version>
        </dependency>

        <!-- https://mvnrepository.com/artifact/net.coobird/thumbnailator -->
        <dependency>
            <groupId>net.coobird</groupId>
            <artifactId>thumbnailator</artifactId>
            <version>0.4.8</version>
        </dependency>

        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.2</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <version>${mvn.compiler.version}</version>
                    <configuration>
                        <source>${jdk.version}</source>
                        <target>${jdk.version}</target>
                    </configuration>
                </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <finalName>chartscan2-${project.artifactId}-${project.version}</finalName>
                    <archive>
                        <manifest>
                            <addClasspath>true</addClasspath>
                        </manifest>
                    </archive>
                </configuration>
            </plugin>
            </plugins>
        </pluginManagement>
    </build>
</project>

0 个答案:

没有答案