|
4 | 4 |
|
5 | 5 | <groupId>org.scijava</groupId> |
6 | 6 | <artifactId>pom-scijava-base</artifactId> |
7 | | - <version>9.0.1-SNAPSHOT</version> |
| 7 | + <version>9.1.0-SNAPSHOT</version> |
8 | 8 | <packaging>pom</packaging> |
9 | 9 |
|
10 | 10 | <name>SciJava Base POM</name> |
|
139 | 139 | --> |
140 | 140 | <automatic-module-name>${package-name}</automatic-module-name> |
141 | 141 |
|
| 142 | + <!-- |
| 143 | + Name of the uberjar generated by the uberjar profile. |
| 144 | + --> |
| 145 | + <uberjar-classifier>all</uberjar-classifier> |
| 146 | + |
142 | 147 | <!-- |
143 | 148 | The License which license-maven-plugin will use to populate. |
144 | 149 | See: license:update-file-header, license:update-project-license |
|
227 | 232 | <maven-plugin-plugin.version>3.6.0</maven-plugin-plugin.version> |
228 | 233 | <maven-release-plugin.version>2.5.3</maven-release-plugin.version> |
229 | 234 | <maven-resources-plugin.version>3.1.0</maven-resources-plugin.version> |
| 235 | + <maven-shade-plugin.version>3.2.1</maven-shade-plugin.version> |
230 | 236 | <maven-site-plugin.version>3.7.1</maven-site-plugin.version> |
231 | 237 | <maven-source-plugin.version>3.1.0</maven-source-plugin.version> |
232 | 238 | <maven-surefire-plugin.version>2.22.2</maven-surefire-plugin.version> |
|
458 | 464 | <version>${maven-resources-plugin.version}</version> |
459 | 465 | </plugin> |
460 | 466 |
|
| 467 | + <plugin> |
| 468 | + <artifactId>maven-shade-plugin</artifactId> |
| 469 | + <version>${maven-shade-plugin.version}</version> |
| 470 | + </plugin> |
| 471 | + |
461 | 472 | <plugin> |
462 | 473 | <artifactId>maven-site-plugin</artifactId> |
463 | 474 | <version>${maven-site-plugin.version}</version> |
|
1436 | 1447 | </build> |
1437 | 1448 | </profile> |
1438 | 1449 |
|
| 1450 | + <!-- |
| 1451 | + The uberjar profile augments the package phase to build an unshaded uber-JAR |
| 1452 | + or "fat JAR" using the maven-shade-plugin. The default classifier is "all"; |
| 1453 | + override the ${uberjar-classifier} property to change it. |
| 1454 | + |
| 1455 | + Uber-JARs are convenient for all-in-one distribution of a Java program, |
| 1456 | + freeing users from the burden of juggling multiple files and dependencies. |
| 1457 | + However, unshaded uberjars are not appropriate for use as dependencies |
| 1458 | + themselves, because the uber-JAR's embedded version of each dependency may |
| 1459 | + clash with other classpath components relying on those same dependencies. |
| 1460 | + It is advised to publish the standard (non-uber) JAR of your component with |
| 1461 | + proper dependency declarations as the main artifact, and deploy the uber-JAR |
| 1462 | + as a separate classifier. |
| 1463 | + --> |
| 1464 | + <profile> |
| 1465 | + <id>uberjar</id> |
| 1466 | + <build> |
| 1467 | + <plugins> |
| 1468 | + <plugin> |
| 1469 | + <groupId>org.apache.maven.plugins</groupId> |
| 1470 | + <artifactId>maven-shade-plugin</artifactId> |
| 1471 | + <executions> |
| 1472 | + <execution> |
| 1473 | + <phase>package</phase> |
| 1474 | + <goals> |
| 1475 | + <goal>shade</goal> |
| 1476 | + </goals> |
| 1477 | + <configuration> |
| 1478 | + <shadedClassifierName>${uberjar-classifier}</shadedClassifierName> |
| 1479 | + <createDependencyReducedPom>false</createDependencyReducedPom> |
| 1480 | + <shadedArtifactAttached>true</shadedArtifactAttached> |
| 1481 | + <transformers> |
| 1482 | + <transformer implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer"> |
| 1483 | + <resource>META-INF/json/org.scijava.plugin.Plugin</resource> |
| 1484 | + </transformer> |
| 1485 | + </transformers> |
| 1486 | + <filters> |
| 1487 | + <filter> |
| 1488 | + <!-- |
| 1489 | + Shading signed JARs will fail without this. |
| 1490 | + http://stackoverflow.com/questions/999489/invalid-signature-file-when-attempting-to-run-a-jar |
| 1491 | + --> |
| 1492 | + <artifact>*:*</artifact> |
| 1493 | + <excludes> |
| 1494 | + <exclude>META-INF/*.SF</exclude> |
| 1495 | + <exclude>META-INF/*.DSA</exclude> |
| 1496 | + <exclude>META-INF/*.RSA</exclude> |
| 1497 | + </excludes> |
| 1498 | + </filter> |
| 1499 | + </filters> |
| 1500 | + </configuration> |
| 1501 | + </execution> |
| 1502 | + </executions> |
| 1503 | + </plugin> |
| 1504 | + </plugins> |
| 1505 | + </build> |
| 1506 | + </profile> |
| 1507 | + |
1439 | 1508 | <!-- |
1440 | 1509 | The jdb profile launches the defined ${main-class} in the jdb debugger. |
1441 | 1510 | Launch it using: mvn -Pjdb exec:exec |
|
0 commit comments