Skip to content

Commit 50ef9a6

Browse files
committed
Updated maven build to generate fat jar in local build directory and install it into the local repository
1 parent 0db7cea commit 50ef9a6

File tree

2 files changed

+51
-1
lines changed

2 files changed

+51
-1
lines changed

assembly/pom.xml

+27-1
Original file line numberDiff line numberDiff line change
@@ -87,10 +87,36 @@
8787
</execution>
8888
</executions>
8989
<configuration>
90-
<finalName>succinct-${project.version}</finalName>
90+
<finalName>${project.parent.artifactId}-${project.version}</finalName>
91+
<outputDirectory>${project.basedir}/../target</outputDirectory>
9192
<appendAssemblyId>false</appendAssemblyId>
9293
</configuration>
9394
</plugin>
95+
<plugin>
96+
<groupId>org.apache.maven.plugins</groupId>
97+
<artifactId>maven-dependency-plugin</artifactId>
98+
<executions>
99+
<execution>
100+
<id>install-assembly-jar</id>
101+
<phase>install</phase>
102+
<goals>
103+
<goal>copy</goal>
104+
</goals>
105+
<configuration>
106+
<artifactItems>
107+
<artifactItem>
108+
<groupId>${project.groupId}</groupId>
109+
<artifactId>${project.artifactId}</artifactId>
110+
<version>${project.version}</version>
111+
<type>jar</type>
112+
<destFileName>${project.parent.artifactId}-${project.parent.version}.jar</destFileName>
113+
</artifactItem>
114+
</artifactItems>
115+
<outputDirectory>${settings.localRepository}/${project.parent.groupId}/${project.parent.artifactId}/${project.parent.version}</outputDirectory>
116+
</configuration>
117+
</execution>
118+
</executions>
119+
</plugin>
94120
</plugins>
95121
</build>
96122

pom.xml

+24
Original file line numberDiff line numberDiff line change
@@ -77,6 +77,30 @@
7777
</execution>
7878
</executions>
7979
</plugin>
80+
<plugin>
81+
<groupId>org.apache.maven.plugins</groupId>
82+
<artifactId>maven-dependency-plugin</artifactId>
83+
<executions>
84+
<execution>
85+
<id>copy-artifact</id>
86+
<phase>package</phase>
87+
<goals>
88+
<goal>copy</goal>
89+
</goals>
90+
<configuration>
91+
<artifactItems>
92+
<artifactItem>
93+
<groupId>${project.groupId}</groupId>
94+
<artifactId>${project.artifactId}</artifactId>
95+
<version>${project.version}</version>
96+
<type>${project.packaging}</type>
97+
</artifactItem>
98+
</artifactItems>
99+
<outputDirectory>${project.build.directory}</outputDirectory>
100+
</configuration>
101+
</execution>
102+
</executions>
103+
</plugin>
80104
</plugins>
81105
</build>
82106

0 commit comments

Comments
 (0)