X Tutup
Skip to content

Commit a2c2eb9

Browse files
committed
Packaging into a shaded jar for distribution
1 parent d9d58b0 commit a2c2eb9

File tree

2 files changed

+102
-2
lines changed

2 files changed

+102
-2
lines changed

pom.xml

Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,17 @@
3030
</snapshots>
3131
</repository>
3232
</repositories>
33+
34+
<scm>
35+
<connection>scm:git:git@github.com:biojava/biojava-http.git</connection>
36+
<developerConnection>scm:git:git@github.com:biojava/biojava-http.git</developerConnection>
37+
<url>https://github.com/biojava/biojava-http</url>
38+
<tag>HEAD</tag>
39+
</scm>
40+
<issueManagement>
41+
<url>https://github.com/biojava/biojava-http/issues</url>
42+
<system>Github</system>
43+
</issueManagement>
3344

3445
<dependencies>
3546
<dependency>
@@ -109,6 +120,95 @@
109120
<maxmem>2000m</maxmem>
110121
</configuration>
111122
</plugin>
123+
124+
<plugin>
125+
<groupId>org.apache.maven.plugins</groupId>
126+
<artifactId>maven-shade-plugin</artifactId>
127+
<executions>
128+
<execution>
129+
<phase>package</phase>
130+
<goals>
131+
<goal>shade</goal>
132+
</goals>
133+
<configuration>
134+
<!-- Minimizing removes log4j -->
135+
<minimizeJar>false</minimizeJar>
136+
<outputFile>target/${project.artifactId}-full-${project.version}.jar</outputFile>
137+
<artifactSet>
138+
<excludes>
139+
<exclude>junit:junit</exclude>
140+
</excludes>
141+
</artifactSet>
142+
<filters>
143+
<filter>
144+
<!-- Exclude signature files -->
145+
<artifact>*:*</artifact>
146+
<excludes>
147+
<exclude>META-INF/*.SF</exclude>
148+
<exclude>META-INF/*.DSA</exclude>
149+
<exclude>META-INF/*.RSA</exclude>
150+
</excludes>
151+
</filter>
152+
</filters>
153+
<transformers>
154+
<transformer
155+
implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
156+
<manifestEntries>
157+
<Specification-Vendor>BioJava</Specification-Vendor>
158+
<Implementation-Vendor>BioJava</Implementation-Vendor>
159+
<Specification-Version>${project.version}</Specification-Version>
160+
<Implementation-Version>${project.version}</Implementation-Version>
161+
<Specification-Title>${project.name}</Specification-Title>
162+
<Implementation-Title>${project.name}</Implementation-Title>
163+
<Main-Class>org.biojava.http.ServerMain</Main-Class>
164+
<Build-Date>${build.date}</Build-Date>
165+
<Build-Number>${buildNumber}</Build-Number>
166+
</manifestEntries>
167+
</transformer>
168+
<!-- This bit merges the various META-INF/services files -->
169+
<transformer
170+
implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer" />
171+
</transformers>
172+
</configuration>
173+
</execution>
174+
</executions>
175+
</plugin>
176+
177+
<!-- Include git commit -->
178+
<plugin>
179+
<groupId>org.codehaus.mojo</groupId>
180+
<artifactId>buildnumber-maven-plugin</artifactId>
181+
<version>1.4</version>
182+
<executions>
183+
<execution>
184+
<id>createbuildnum</id>
185+
<phase>validate</phase>
186+
<goals>
187+
<goal>create</goal>
188+
</goals>
189+
</execution>
190+
<execution>
191+
<id>createdate</id>
192+
<phase>validate</phase>
193+
<goals>
194+
<goal>create</goal>
195+
</goals>
196+
<configuration>
197+
<format>{0,date,yyyy-MM-dd}</format>
198+
<items>
199+
<item>timestamp</item>
200+
</items>
201+
<buildNumberPropertyName>build.date</buildNumberPropertyName>
202+
</configuration>
203+
</execution>
204+
</executions>
205+
<configuration>
206+
<!-- Allow building with local modifications -->
207+
<doCheck>false</doCheck>
208+
<!-- No need to fetch with git -->
209+
<doUpdate>false</doUpdate>
210+
</configuration>
211+
</plugin>
112212
</plugins>
113213
</build>
114214
</project>

src/main/java/org/biojava/http/ServerMain.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
package org.biojava.http;
2626

27-
import static spark.Spark.get;
27+
import static spark.Spark.*;
2828

2929
import org.biojava.http.compute.CeSymmPDBTransformer;
3030
import org.biojava.http.compute.JsonTransformer;
@@ -42,7 +42,7 @@ public class ServerMain {
4242
public static Logger logger = LoggerFactory.getLogger(ServerMain.class);
4343

4444
public static void main(String[] args) {
45-
// port(4567);
45+
port(8080);
4646

4747
get("/", (r,r2) -> "BioJava HTTP");
4848

0 commit comments

Comments
 (0)
X Tutup