|
| 1 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 2 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> |
| 3 | + <modelVersion>4.0.0</modelVersion> |
| 4 | + |
| 5 | + <groupId>software.amazon.lambda.examples</groupId> |
| 6 | + <version>1.16.1</version> |
| 7 | + <artifactId>powertools-examples-core-cdk</artifactId> |
| 8 | + <packaging>jar</packaging> |
| 9 | + |
| 10 | + <name>Powertools for AWS Lambda (Java) library Examples - Core</name> |
| 11 | + |
| 12 | + <properties> |
| 13 | + <log4j.version>2.20.0</log4j.version> |
| 14 | + <maven.compiler.source>1.8</maven.compiler.source> |
| 15 | + <maven.compiler.target>1.8</maven.compiler.target> |
| 16 | + <maven.deploy.skip>true</maven.deploy.skip> |
| 17 | + </properties> |
| 18 | + |
| 19 | + <dependencies> |
| 20 | + <dependency> |
| 21 | + <groupId>software.amazon.lambda</groupId> |
| 22 | + <artifactId>powertools-tracing</artifactId> |
| 23 | + <version>${project.version}</version> |
| 24 | + </dependency> |
| 25 | + <dependency> |
| 26 | + <groupId>software.amazon.lambda</groupId> |
| 27 | + <artifactId>powertools-logging</artifactId> |
| 28 | + <version>${project.version}</version> |
| 29 | + </dependency> |
| 30 | + <dependency> |
| 31 | + <groupId>software.amazon.lambda</groupId> |
| 32 | + <artifactId>powertools-metrics</artifactId> |
| 33 | + <version>${project.version}</version> |
| 34 | + </dependency> |
| 35 | + <dependency> |
| 36 | + <groupId>com.amazonaws</groupId> |
| 37 | + <artifactId>aws-lambda-java-core</artifactId> |
| 38 | + <version>1.2.2</version> |
| 39 | + </dependency> |
| 40 | + <dependency> |
| 41 | + <groupId>com.amazonaws</groupId> |
| 42 | + <artifactId>aws-lambda-java-events</artifactId> |
| 43 | + <version>3.11.2</version> |
| 44 | + </dependency> |
| 45 | + <dependency> |
| 46 | + <groupId>org.apache.logging.log4j</groupId> |
| 47 | + <artifactId>log4j-core</artifactId> |
| 48 | + <version>${log4j.version}</version> |
| 49 | + </dependency> |
| 50 | + <dependency> |
| 51 | + <groupId>org.apache.logging.log4j</groupId> |
| 52 | + <artifactId>log4j-api</artifactId> |
| 53 | + <version>${log4j.version}</version> |
| 54 | + </dependency> |
| 55 | + |
| 56 | + <dependency> |
| 57 | + <groupId>junit</groupId> |
| 58 | + <artifactId>junit</artifactId> |
| 59 | + <version>4.13.2</version> |
| 60 | + <scope>test</scope> |
| 61 | + </dependency> |
| 62 | + </dependencies> |
| 63 | + |
| 64 | + <build> |
| 65 | + <finalName>helloworld-lambda</finalName> |
| 66 | + <plugins> |
| 67 | + <plugin> |
| 68 | + <groupId>dev.aspectj</groupId> |
| 69 | + <artifactId>aspectj-maven-plugin</artifactId> |
| 70 | + <version>1.13.1</version> |
| 71 | + <configuration> |
| 72 | + <source>${maven.compiler.source}</source> |
| 73 | + <target>${maven.compiler.target}</target> |
| 74 | + <complianceLevel>${maven.compiler.target}</complianceLevel> |
| 75 | + <aspectLibraries> |
| 76 | + <aspectLibrary> |
| 77 | + <groupId>software.amazon.lambda</groupId> |
| 78 | + <artifactId>powertools-tracing</artifactId> |
| 79 | + </aspectLibrary> |
| 80 | + <aspectLibrary> |
| 81 | + <groupId>software.amazon.lambda</groupId> |
| 82 | + <artifactId>powertools-logging</artifactId> |
| 83 | + </aspectLibrary> |
| 84 | + <aspectLibrary> |
| 85 | + <groupId>software.amazon.lambda</groupId> |
| 86 | + <artifactId>powertools-metrics</artifactId> |
| 87 | + </aspectLibrary> |
| 88 | + </aspectLibraries> |
| 89 | + </configuration> |
| 90 | + <executions> |
| 91 | + <execution> |
| 92 | + <goals> |
| 93 | + <goal>compile</goal> |
| 94 | + </goals> |
| 95 | + </execution> |
| 96 | + </executions> |
| 97 | + </plugin> |
| 98 | + <plugin> |
| 99 | + <groupId>org.apache.maven.plugins</groupId> |
| 100 | + <artifactId>maven-shade-plugin</artifactId> |
| 101 | + <version>3.5.0</version> |
| 102 | + <executions> |
| 103 | + <execution> |
| 104 | + <phase>package</phase> |
| 105 | + <goals> |
| 106 | + <goal>shade</goal> |
| 107 | + </goals> |
| 108 | + <configuration> |
| 109 | + <transformers> |
| 110 | + <transformer |
| 111 | + implementation="com.github.edwgiz.maven_shade_plugin.log4j2_cache_transformer.PluginsCacheFileTransformer"> |
| 112 | + </transformer> |
| 113 | + </transformers> |
| 114 | + </configuration> |
| 115 | + </execution> |
| 116 | + </executions> |
| 117 | + <dependencies> |
| 118 | + <dependency> |
| 119 | + <groupId>com.github.edwgiz</groupId> |
| 120 | + <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId> |
| 121 | + <version>2.15</version> |
| 122 | + </dependency> |
| 123 | + </dependencies> |
| 124 | + </plugin> |
| 125 | + </plugins> |
| 126 | + </build> |
| 127 | + <profiles> |
| 128 | + <!-- Use a profile to enforce AspectJ version 1.9.7 if we are Java 1.8 otherwise we'll get class |
| 129 | + version mismatch issues. All subsequent Java releases build with the default AspectJ configuration |
| 130 | + on the project. |
| 131 | + |
| 132 | + Note: |
| 133 | + - if you are running Java > 1.8, you can remove this profile altogether |
| 134 | + - If you are running on Java 1.8, you should apply the aspectJ version here to the project, and remove |
| 135 | + the profile. |
| 136 | + --> |
| 137 | + <profile> |
| 138 | + <id>jdk8</id> |
| 139 | + <activation> |
| 140 | + <jdk>(,11)</jdk> <!-- 8 --> |
| 141 | + </activation> |
| 142 | + <properties> |
| 143 | + <aspectj.version>1.9.7</aspectj.version> |
| 144 | + </properties> |
| 145 | + <dependencyManagement> |
| 146 | + <dependencies> |
| 147 | + <dependency> |
| 148 | + <groupId>org.aspectj</groupId> |
| 149 | + <artifactId>aspectjtools</artifactId> |
| 150 | + <version>${aspectj.version}</version> |
| 151 | + </dependency> |
| 152 | + </dependencies> |
| 153 | + </dependencyManagement> |
| 154 | + <build> |
| 155 | + <pluginManagement> |
| 156 | + <plugins> |
| 157 | + <plugin> |
| 158 | + <groupId>dev.aspectj</groupId> |
| 159 | + <artifactId>aspectj-maven-plugin</artifactId> |
| 160 | + <version>${aspectj.plugin.version}</version> |
| 161 | + <configuration> |
| 162 | + <source>${maven.compiler.source}</source> |
| 163 | + <target>${maven.compiler.target}</target> |
| 164 | + <complianceLevel>${maven.compiler.target}</complianceLevel> |
| 165 | + <aspectLibraries> |
| 166 | + <aspectLibrary> |
| 167 | + <groupId>software.amazon.lambda</groupId> |
| 168 | + <artifactId>powertools-tracing</artifactId> |
| 169 | + </aspectLibrary> |
| 170 | + <aspectLibrary> |
| 171 | + <groupId>software.amazon.lambda</groupId> |
| 172 | + <artifactId>powertools-logging</artifactId> |
| 173 | + </aspectLibrary> |
| 174 | + <aspectLibrary> |
| 175 | + <groupId>software.amazon.lambda</groupId> |
| 176 | + <artifactId>powertools-metrics</artifactId> |
| 177 | + </aspectLibrary> |
| 178 | + </aspectLibraries> |
| 179 | + </configuration> |
| 180 | + <executions> |
| 181 | + <execution> |
| 182 | + <goals> |
| 183 | + <goal>compile</goal> |
| 184 | + <goal>test-compile</goal> |
| 185 | + </goals> |
| 186 | + </execution> |
| 187 | + </executions> |
| 188 | + <!-- Enforce aspectJ 1.9.7 --> |
| 189 | + <dependencies> |
| 190 | + <dependency> |
| 191 | + <groupId>org.aspectj</groupId> |
| 192 | + <artifactId>aspectjtools</artifactId> |
| 193 | + <version>${aspectj.version}</version> |
| 194 | + </dependency> |
| 195 | + </dependencies> |
| 196 | + </plugin> |
| 197 | + </plugins> |
| 198 | + </pluginManagement> |
| 199 | + </build> |
| 200 | + </profile> |
| 201 | + </profiles> |
| 202 | +</project> |
0 commit comments