• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1<?xml version="1.0" encoding="UTF-8"?>
2<!--
3  ~ Copyright 2010-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  ~
5  ~ Licensed under the Apache License, Version 2.0 (the "License").
6  ~ You may not use this file except in compliance with the License.
7  ~ A copy of the License is located at
8  ~
9  ~  http://aws.amazon.com/apache2.0
10  ~
11  ~ or in the "license" file accompanying this file. This file is distributed
12  ~ on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  ~ express or implied. See the License for the specific language governing
14  ~ permissions and limitations under the License.
15  -->
16
17<project xmlns="http://maven.apache.org/POM/4.0.0"
18         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
19         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
20    <parent>
21        <artifactId>archetypes</artifactId>
22        <groupId>software.amazon.awssdk</groupId>
23        <version>2.24.3</version>
24    </parent>
25    <modelVersion>4.0.0</modelVersion>
26    <artifactId>archetype-lambda</artifactId>
27    <packaging>maven-archetype</packaging>
28    <name>AWS Java SDK :: Archetype Lambda</name>
29    <description>
30        The AWS SDK for Java - Maven archetype for Java lambda function using AWS Java SDK 2.x
31    </description>
32
33    <properties>
34        <maven.archetype.version>3.2.0</maven.archetype.version>
35        <maven.resource.plugin.version>3.2.0</maven.resource.plugin.version>
36        <exec-maven-plugin.version>1.6.0</exec-maven-plugin.version>
37    </properties>
38
39    <dependencies>
40        <dependency>
41            <groupId>software.amazon.awssdk</groupId>
42            <artifactId>archetype-tools</artifactId>
43            <version>${awsjavasdk.version}</version>
44            <scope>provided</scope>
45        </dependency>
46    </dependencies>
47    <build>
48        <!-- Filtering the resource properties to get ${project.version} from archetype metadata.
49        See https://stackoverflow.com/a/22300149 -->
50        <resources>
51            <resource>
52                <directory>src/main/resources</directory>
53                <filtering>true</filtering>
54                <includes>
55                    <include>META-INF/maven/archetype-metadata.xml</include>
56                </includes>
57            </resource>
58            <resource>
59                <directory>src/main/resources</directory>
60                <filtering>false</filtering>
61                <excludes>
62                    <exclude>META-INF/maven/archetype-metadata.xml</exclude>
63                </excludes>
64            </resource>
65        </resources>
66        <extensions>
67            <extension>
68                <groupId>org.apache.maven.archetype</groupId>
69                <artifactId>archetype-packaging</artifactId>
70                <version>${maven.archetype.version}</version>
71            </extension>
72        </extensions>
73
74        <plugins>
75            <plugin>
76                <artifactId>maven-archetype-plugin</artifactId>
77                <version>${maven.archetype.version}</version>
78                <configuration>
79                    <noLog>true</noLog>
80                    <ignoreEOLStyle>true</ignoreEOLStyle>
81                    <skip>${skip.unit.tests}</skip>
82                </configuration>
83                <executions>
84                    <execution>
85                        <id>integration-test</id>
86                        <phase>verify</phase>
87                        <goals>
88                            <goal>integration-test</goal>
89                        </goals>
90                    </execution>
91                </executions>
92            </plugin>
93
94            <!-- Copy the global.vm and serviceMapping.vm from archetype-tools -->
95            <plugin>
96                <groupId>org.apache.maven.plugins</groupId>
97                <artifactId>maven-dependency-plugin</artifactId>
98                <version>${maven-dependency-plugin.version}</version>
99                <executions>
100                    <execution>
101                        <id>unpack-archetype-tools</id>
102                        <phase>process-classes</phase>
103                        <goals>
104                            <goal>unpack</goal>
105                        </goals>
106                        <configuration>
107                            <artifactItems>
108                                <artifactItem>
109                                    <groupId>software.amazon.awssdk</groupId>
110                                    <artifactId>archetype-tools</artifactId>
111                                    <version>${project.version}</version>
112                                    <outputDirectory>${basedir}/target/classes/archetype-resources</outputDirectory>
113                                    <includes>**/*.vm</includes>
114                                </artifactItem>
115                            </artifactItems>
116                        </configuration>
117                    </execution>
118                </executions>
119            </plugin>
120
121            <!-- workaround to copy the global.vm and serviceMapping.vm to the sub folders
122                 because global.vm is not so global any more
123                 see https://github.com/aws/aws-sdk-java-v2/issues/1981 -->
124            <plugin>
125                <artifactId>maven-resources-plugin</artifactId>
126                <version>${maven.resource.plugin.version}</version>
127                <executions>
128                    <execution>
129                        <id>copy-resources-to-sub-folder</id>
130                        <phase>process-classes</phase>
131                        <goals>
132                            <goal>copy-resources</goal>
133                        </goals>
134                        <configuration>
135                            <outputDirectory>${basedir}/target/classes/archetype-resources/src/main/java</outputDirectory>
136                            <encoding>UTF-8</encoding>
137                            <resources>
138                                <resource>
139                                    <directory>${basedir}/target/classes/archetype-resources</directory>
140                                    <includes>
141                                        <include>global.vm</include>
142                                        <include>serviceMapping.vm</include>
143                                    </includes>
144                                </resource>
145                            </resources>
146                        </configuration>
147                    </execution>
148                    <execution>
149                        <id>copy-resources-to-sub-folder-2</id>
150                        <phase>process-classes</phase>
151                        <goals>
152                            <goal>copy-resources</goal>
153                        </goals>
154                        <configuration>
155                            <outputDirectory>${basedir}/target/classes</outputDirectory>
156                            <encoding>UTF-8</encoding>
157                            <resources>
158                                <resource>
159                                    <directory>${basedir}/target/classes/archetype-resources</directory>
160                                    <includes>
161                                        <include>global.vm</include>
162                                        <include>serviceMapping.vm</include>
163                                    </includes>
164                                </resource>
165                            </resources>
166                        </configuration>
167                    </execution>
168                </executions>
169            </plugin>
170        </plugins>
171    </build>
172</project>
173