mvn install jar-with-dependencies

后端 未结 5 1673
情歌与酒
情歌与酒 2021-02-04 10:28

Is there a way to do an install on a jar-with-dependencies created using maven-assembly-plugin?

相关标签:
5条回答
  • 2021-02-04 11:06

    Is mvn install not doing this?

    0 讨论(0)
  • 2021-02-04 11:15

    mvn assembly:assembly -DdescriptorId=jar-with-dependencies

    :)

    0 讨论(0)
  • 2021-02-04 11:18

    Look under the heading "Executing: Building an Assembly" here.

    0 讨论(0)
  • 2021-02-04 11:24

    One way would be to create a project where you use the assembly-plugin. In the assembly-plugin configuration you can specify what output you want (jar, zip, ...)

    In this projects pom you can put your dependencies and build it. Every time you execute the install command all your dependencies will be in your packaged file.

    0 讨论(0)
  • 2021-02-04 11:26

    If you bind the assembly to the packaging phase, it will install in your repository both the "regular" jar and the with-dependencies jar when you do a build:

            <plugin>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.3</version>
                <configuration>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id> <!-- this is used for inheritance merges -->
                        <phase>package</phase> <!--  bind to the packaging phase -->
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
    
    0 讨论(0)
提交回复
热议问题