Correct, only protobuf which is scope compile will get packaged.

Scope provided and scope test are normally excluded scopes.

However, it depends on your build plugins and how they are configured. The 
normal maven-jar-plugin will only include resources, dependencies can be 
included with shade, bundle or assembly plugins.

Gruss
Bernd
--
http://bernd.eckenfels.net
________________________________
From: mingleizhang <18717838...@163.com>
Sent: Thursday, August 31, 2017 4:26:39 AM
To: users@maven.apache.org
Subject: What kind of dependency will package to a jar file by means of maven ?

Hello, friends here

        Recently, I use mvn clean package or something like that to my project, 
then, I found the jar file is about more than 100MB size. But I dont want some 
dependency to exist in my finally jar file. there are three dependency file in 
pom like the following. The first one is a junit dependency. the second one is 
a google.protobuf-java-format. The last is a flink with provided. My question 
is, when I use mvn clean package, which will package to my final jar file ? I 
think google.protobuf-java-format will go to my jar file. Correct ? I am not 
sure whether junit package to my jar file. Does anyone improve my mind ?


   <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>${junit.version}</version>
            <scope>test</scope>
     </dependency>


     <dependency>
            <groupId>com.googlecode.protobuf-java-format</groupId>
            <artifactId>protobuf-java-format</artifactId>
            <version>1.2</version>
        </dependency>


       <dependency>
            <groupId>org.apache.flink</groupId>
            <artifactId>flink-scala_2.10</artifactId>
            <version>${flink.version}</version>
            <scope>provided</scope>
        </dependency>


Thanks
Minglei.

Reply via email to