arjantijms | efe3cd1 | 2021-08-22 00:40:59 +0200 | [diff] [blame] | 1 | <?xml version="1.0" encoding="UTF-8"?> |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 2 | <!-- |
| 3 | |
hussainnm | 5371252 | 2021-02-18 19:46:31 +0530 | [diff] [blame] | 4 | Copyright (c) 2010, 2021 Oracle and/or its affiliates. All rights reserved. |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 5 | |
| 6 | This program and the accompanying materials are made available under the |
| 7 | terms of the Eclipse Public License v. 2.0, which is available at |
| 8 | http://www.eclipse.org/legal/epl-2.0. |
| 9 | |
| 10 | This Source Code may also be made available under the following Secondary |
| 11 | Licenses when the conditions for such availability set forth in the |
| 12 | Eclipse Public License v. 2.0 are satisfied: GNU General Public License, |
| 13 | version 2 with the GNU Classpath Exception, which is available at |
| 14 | https://www.gnu.org/software/classpath/license.html. |
| 15 | |
| 16 | SPDX-License-Identifier: EPL-2.0 OR GPL-2.0 WITH Classpath-exception-2.0 |
| 17 | |
| 18 | --> |
| 19 | |
| 20 | <!-- |
| 21 | This module is meant to serve as the example of how to add additional files to the GlassFish distribution. |
| 22 | --> |
arjantijms | efe3cd1 | 2021-08-22 00:40:59 +0200 | [diff] [blame] | 23 | <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/xsd/maven-4.0.0.xsd"> |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 24 | <modelVersion>4.0.0</modelVersion> |
arjantijms | efe3cd1 | 2021-08-22 00:40:59 +0200 | [diff] [blame] | 25 | |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 26 | <parent> |
| 27 | <groupId>org.glassfish.main.ejb</groupId> |
| 28 | <artifactId>ejb</artifactId> |
Eclipse Glassfish Bot | ad91414 | 2021-08-26 23:17:42 +0000 | [diff] [blame^] | 29 | <version>6.2.1</version> |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 30 | </parent> |
| 31 | |
| 32 | <artifactId>ejb-timer-databases</artifactId> |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 33 | <!-- |
| 34 | This packaging specifies that it's a package that contains files to be added to |
| 35 | the distribution. |
| 36 | |
| 37 | In this packaging mode, the build will produce a jar, like it normally does for |
| 38 | the <packaging>jar</packaging>, but the contents of this jar is then extracted |
| 39 | when the final GlassFish distribution is assembled. (But when this happens, |
| 40 | META-INF/** in the jar will be ignored.) |
| 41 | |
| 42 | For a fragment to be added to the distribution, the distribution POM needs |
| 43 | to directly or indirectly depend on the fragment module. This is normally |
| 44 | done by creating a feature-level grouping POM (which allows you to bundle multiple |
| 45 | modules and treat it as a single dependency - see the webtier-all module for example), |
| 46 | and have that declare a dependency on the fragment, instead of directly |
| 47 | modifying the distribution POM. |
| 48 | |
| 49 | So the idea here is that individual technology area will create their own |
| 50 | fragments that contain pieces that they need, and when the said technology |
| 51 | is bundled in GF, the corresponding fragment will be also added, thanks to |
| 52 | the transitive dependency handling in Maven. |
| 53 | --> |
| 54 | <packaging>distribution-fragment</packaging> |
| 55 | |
arjantijms | efe3cd1 | 2021-08-22 00:40:59 +0200 | [diff] [blame] | 56 | <name>GlassFish EJB timer app database init scripts</name> |
| 57 | |
| 58 | <dependencies> |
| 59 | <dependency> |
| 60 | <groupId>${project.groupId}</groupId> |
| 61 | <artifactId>ejb-timer-service-app</artifactId> |
| 62 | <version>${project.version}</version> |
| 63 | <type>war</type> |
| 64 | </dependency> |
| 65 | </dependencies> |
| 66 | |
| 67 | <build><!-- |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 68 | In this module, all the files are statically stored as-is in the Subversion repository, |
| 69 | so the simple copying from src/main/resources to target/classes that Maven does by default |
| 70 | is suffice. |
| 71 | |
| 72 | But in more complex scenario, one can use maven-antrun-extended-plugin and use a series of Ant tasks |
| 73 | to perform processing on resources, such as token replacement, file generation, pre-processing, etc. |
| 74 | |
| 75 | The following section shows how you can do this. |
| 76 | --> |
| 77 | <plugins> |
| 78 | <plugin> |
| 79 | <groupId>org.jvnet.maven-antrun-extended-plugin</groupId> |
| 80 | <artifactId>maven-antrun-extended-plugin</artifactId> |
| 81 | <executions> |
| 82 | <execution> |
| 83 | <phase>generate-sources</phase> |
| 84 | <configuration> |
| 85 | <tasks> |
| 86 | <!-- place the ejb timer app jar into the location --> |
| 87 | <resolveArtifact artifactId="ejb-timer-service-app" tofile="target/classes/glassfish/lib/install/applications/ejb-timer-service-app.war" /> |
| 88 | </tasks> |
| 89 | </configuration> |
| 90 | <goals> |
| 91 | <goal>run</goal> |
| 92 | </goals> |
| 93 | </execution> |
| 94 | </executions> |
| 95 | </plugin> |
| 96 | </plugins> |
| 97 | </build> |
Vinay Vishal | 5717147 | 2018-09-18 20:22:00 +0530 | [diff] [blame] | 98 | </project> |