Skip to content

Commit ea631d0

Browse files
authored
Merge pull request hub4j#633 from bitwiseman/task/shade
Add shading of dependencies
2 parents b9c8bf0 + 5b7829c commit ea631d0

2 files changed

Lines changed: 148 additions & 22 deletions

File tree

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,3 +7,5 @@ target
77
.project
88
.settings/
99
.DS_Store
10+
11+
dependency-reduced-pom.xml

pom.xml

Lines changed: 146 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,6 @@
11
<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/maven-v4_0_0.xsd">
22
<modelVersion>4.0.0</modelVersion>
3-
<parent>
4-
<groupId>org.kohsuke</groupId>
5-
<artifactId>pom</artifactId>
6-
<version>21</version>
7-
<relativePath />
8-
</parent>
9-
3+
<groupId>org.kohsuke</groupId>
104
<artifactId>github-api</artifactId>
115
<version>1.102-SNAPSHOT</version>
126
<name>GitHub API for Java</name>
@@ -21,6 +15,16 @@
2115
</scm>
2216

2317
<distributionManagement>
18+
<snapshotRepository>
19+
<id>sonatype-nexus-snapshots</id>
20+
<name>Sonatype Nexus Snapshots</name>
21+
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
22+
</snapshotRepository>
23+
<repository>
24+
<id>sonatype-nexus-staging</id>
25+
<name>Nexus Release Repository</name>
26+
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
27+
</repository>
2428
<site>
2529
<id>github-pages</id>
2630
<url>gitsite:git@github.com/github-api/${project.artifactId}.git</url>
@@ -56,6 +60,14 @@
5660
<artifactId>maven-scm-manager-plexus</artifactId>
5761
<version>1.11.2</version>
5862
</extension>
63+
<!-- Doing site publishing manually for now -->
64+
<!--
65+
<extension>
66+
<groupId>org.kohsuke</groupId>
67+
<artifactId>wagon-gitsite</artifactId>
68+
<version>0.3.5</version>
69+
</extension>
70+
-->
5971
</extensions>
6072
<testResources>
6173
<testResource>
@@ -67,7 +79,16 @@
6779
</testResources>
6880
<pluginManagement>
6981
<plugins>
70-
<!-- adds jacoco coverage -->
82+
<plugin>
83+
<groupId>org.apache.maven.plugins</groupId>
84+
<artifactId>maven-source-plugin</artifactId>
85+
<version>3.2.1</version>
86+
</plugin>
87+
<plugin>
88+
<groupId>org.apache.maven.plugins</groupId>
89+
<artifactId>maven-gpg-plugin</artifactId>
90+
<version>1.6</version>
91+
</plugin>
7192
<plugin>
7293
<groupId>org.jacoco</groupId>
7394
<artifactId>jacoco-maven-plugin</artifactId>
@@ -80,6 +101,18 @@
80101
<configuration>
81102
<source>8</source>
82103
<failOnWarnings>true</failOnWarnings>
104+
<doclint>all</doclint>
105+
</configuration>
106+
</plugin>
107+
<plugin>
108+
<groupId>org.sonatype.plugins</groupId>
109+
<artifactId>nexus-staging-maven-plugin</artifactId>
110+
<version>1.6.8</version>
111+
<extensions>true</extensions>
112+
<configuration>
113+
<serverId>sonatype-nexus-staging</serverId>
114+
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
115+
<autoReleaseAfterClose>true</autoReleaseAfterClose>
83116
</configuration>
84117
</plugin>
85118
</plugins>
@@ -101,6 +134,10 @@
101134
<goals>deploy</goals>
102135
</configuration>
103136
</plugin>
137+
<plugin>
138+
<groupId>org.sonatype.plugins</groupId>
139+
<artifactId>nexus-staging-maven-plugin</artifactId>
140+
</plugin>
104141
<plugin>
105142
<groupId>org.apache.maven.plugins</groupId>
106143
<artifactId>maven-project-info-reports-plugin</artifactId>
@@ -224,17 +261,6 @@
224261
</dependency>
225262
</dependencies>
226263
</plugin>
227-
<!-- Do not use gmaven plugin -->
228-
<plugin>
229-
<groupId>org.codehaus.gmaven</groupId>
230-
<artifactId>gmaven-plugin</artifactId>
231-
<executions>
232-
<execution>
233-
<goals>
234-
</goals>
235-
</execution>
236-
</executions>
237-
</plugin>
238264
</plugins>
239265
</build>
240266

@@ -285,6 +311,27 @@
285311
<version>1.18</version>
286312
<optional>true</optional>
287313
</dependency>
314+
<!-- for stapler-jetty -->
315+
<dependency>
316+
<groupId>commons-fileupload</groupId>
317+
<artifactId>commons-fileupload</artifactId>
318+
<version>1.4</version>
319+
<scope>test</scope>
320+
</dependency>
321+
<!-- for stapler-jetty -->
322+
<dependency>
323+
<groupId>commons-discovery</groupId>
324+
<artifactId>commons-discovery</artifactId>
325+
<version>0.5</version>
326+
<scope>test</scope>
327+
</dependency>
328+
<!-- for stapler-jetty -->
329+
<dependency>
330+
<groupId>org.kohsuke.stapler</groupId>
331+
<artifactId>stapler</artifactId>
332+
<version>1.258</version>
333+
<scope>test</scope>
334+
</dependency>
288335
<dependency>
289336
<groupId>org.kohsuke.stapler</groupId>
290337
<artifactId>stapler-jetty</artifactId>
@@ -367,12 +414,60 @@
367414
</pluginRepository>
368415
</pluginRepositories>
369416
<profiles>
417+
<profile>
418+
<id>enable-shade</id>
419+
<activation>
420+
<property>
421+
<name>enable-shade</name>
422+
</property>
423+
</activation>
424+
<build>
425+
<plugins>
426+
<plugin>
427+
<groupId>org.apache.maven.plugins</groupId>
428+
<artifactId>maven-shade-plugin</artifactId>
429+
<executions>
430+
<execution>
431+
<phase>package</phase>
432+
<goals>
433+
<goal>shade</goal>
434+
</goals>
435+
<configuration>
436+
<artifactSet>
437+
<excludes>
438+
<exclude>com.infradna.tool:bridge-method-annotation</exclude>
439+
<exclude>org.jenkins-ci:annotation-indexer</exclude>
440+
<exclude>com.squareup.*:*</exclude>
441+
<exclude>org.jetbrains*:*</exclude>
442+
<exclude>com.github.spotbugs:*</exclude>
443+
<exclude>com.google.code.findbugs:*</exclude>
444+
</excludes>
445+
</artifactSet>
446+
<filters>
447+
<filter>
448+
<artifact>*:*</artifact>
449+
<excludes>
450+
<exclude>module-info.class</exclude>
451+
<exclude>META-INF/*.SF</exclude>
452+
<exclude>META-INF/*.DSA</exclude>
453+
<exclude>META-INF/*.RSA</exclude>
454+
</excludes>
455+
</filter>
456+
</filters>
457+
</configuration>
458+
</execution>
459+
</executions>
460+
</plugin>
461+
</plugins>
462+
</build>
463+
</profile>
370464
<profile>
371465
<id>ci</id>
372466
<properties>
373467
<formatter-maven-plugin.goal>validate</formatter-maven-plugin.goal>
374468
<impsort-maven-plugin.goal>check</impsort-maven-plugin.goal>
375469
<enable-jacoco>true</enable-jacoco>
470+
<enable-shade>true</enable-shade>
376471
<jacoco.haltOnFailure>true</jacoco.haltOnFailure>
377472
</properties>
378473
<build>
@@ -390,7 +485,6 @@
390485
<plugin>
391486
<groupId>org.jacoco</groupId>
392487
<artifactId>jacoco-maven-plugin</artifactId>
393-
<version>0.8.5</version>
394488
<executions>
395489
<execution>
396490
<goals>
@@ -512,12 +606,14 @@
512606
</profile>
513607
<profile>
514608
<id>release</id>
609+
<properties>
610+
<enable-shade>true</enable-shade>
611+
</properties>
515612
<build>
516613
<plugins>
517614
<plugin>
518615
<groupId>org.apache.maven.plugins</groupId>
519616
<artifactId>maven-gpg-plugin</artifactId>
520-
<version>1.6</version>
521617
<executions>
522618
<execution>
523619
<id>sign-artifacts</id>
@@ -537,7 +633,26 @@
537633
<plugin>
538634
<groupId>org.apache.maven.plugins</groupId>
539635
<artifactId>maven-source-plugin</artifactId>
540-
<version>3.2.1</version>
636+
<executions>
637+
<execution>
638+
<id>attach-sources</id>
639+
<goals>
640+
<goal>jar-no-fork</goal>
641+
</goals>
642+
</execution>
643+
</executions>
644+
</plugin>
645+
<plugin>
646+
<groupId>org.apache.maven.plugins</groupId>
647+
<artifactId>maven-javadoc-plugin</artifactId>
648+
<executions>
649+
<execution>
650+
<id>attach-javadocs</id>
651+
<goals>
652+
<goal>jar</goal>
653+
</goals>
654+
</execution>
655+
</executions>
541656
</plugin>
542657
</plugins>
543658
</build>
@@ -571,4 +686,13 @@
571686
<archive>https://groups.google.com/forum/#!forum/github-api</archive>
572687
</mailingList>
573688
</mailingLists>
689+
690+
<developers>
691+
<developer>
692+
<name>Kohsuke Kawaguchi</name>
693+
<id>kohsuke</id>
694+
<email>kk@kohsuke.org</email>
695+
</developer>
696+
</developers>
697+
574698
</project>

0 commit comments

Comments
 (0)