|
| 1 | +<?xml version="1.0" encoding="UTF-8"?> |
| 2 | +<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" |
| 3 | + xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> |
| 4 | + <modelVersion>4.0.0</modelVersion> |
| 5 | + |
| 6 | + <groupId>com.microsoft.azure</groupId> |
| 7 | + <artifactId>applicationinsights-app-services-sample</artifactId> |
| 8 | + <version>1.0-SNAPSHOT</version> |
| 9 | + <packaging>war</packaging> |
| 10 | + |
| 11 | + <properties> |
| 12 | + <java.version>1.8</java.version> |
| 13 | + <appinsights.version>2.5.0-BETA.2</appinsights.version> |
| 14 | + </properties> |
| 15 | + |
| 16 | + <dependencyManagement> |
| 17 | + <dependencies> |
| 18 | + <dependency> |
| 19 | + <groupId>org.jboss.spec</groupId> |
| 20 | + <artifactId>jboss-javaee-8.0</artifactId> |
| 21 | + <version>1.0.0.Final</version> |
| 22 | + <type>pom</type> |
| 23 | + <scope>import</scope> |
| 24 | + </dependency> |
| 25 | + </dependencies> |
| 26 | + </dependencyManagement> |
| 27 | + |
| 28 | + <dependencies> |
| 29 | + <dependency> |
| 30 | + <groupId>org.jboss.spec.javax.servlet</groupId> |
| 31 | + <artifactId>jboss-servlet-api_4.0_spec</artifactId> |
| 32 | + <scope>provided</scope> |
| 33 | + </dependency> |
| 34 | + <dependency> |
| 35 | + <groupId>org.apache.httpcomponents</groupId> |
| 36 | + <artifactId>httpclient</artifactId> |
| 37 | + <version>4.5.9</version> |
| 38 | + </dependency> |
| 39 | + <dependency> |
| 40 | + <groupId>com.microsoft.azure</groupId> |
| 41 | + <artifactId>applicationinsights-web-auto</artifactId> |
| 42 | + <version>${appinsights.version}</version> |
| 43 | + </dependency> |
| 44 | + </dependencies> |
| 45 | + |
| 46 | + <build> |
| 47 | + <finalName>helloworld</finalName> |
| 48 | + <plugins> |
| 49 | + <plugin> |
| 50 | + <!-- download the applicationinsights-agent jar file --> |
| 51 | + <artifactId>maven-dependency-plugin</artifactId> |
| 52 | + <version>3.1.1</version> |
| 53 | + <executions> |
| 54 | + <execution> |
| 55 | + <id>copy</id> |
| 56 | + <phase>generate-resources</phase> |
| 57 | + <goals> |
| 58 | + <goal>copy</goal> |
| 59 | + </goals> |
| 60 | + </execution> |
| 61 | + </executions> |
| 62 | + <configuration> |
| 63 | + <artifactItems> |
| 64 | + <artifactItem> |
| 65 | + <groupId>com.microsoft.azure</groupId> |
| 66 | + <artifactId>applicationinsights-agent</artifactId> |
| 67 | + <version>${appinsights.version}</version> |
| 68 | + </artifactItem> |
| 69 | + </artifactItems> |
| 70 | + </configuration> |
| 71 | + </plugin> |
| 72 | + <plugin> |
| 73 | + <!-- place the applicationinsights-agent jar file in the war file under META-INF --> |
| 74 | + <artifactId>maven-war-plugin</artifactId> |
| 75 | + <version>3.2.3</version> |
| 76 | + <configuration> |
| 77 | + <webResources> |
| 78 | + <resource> |
| 79 | + <directory>${project.build.directory}/dependency</directory> |
| 80 | + <targetPath>META-INF</targetPath> |
| 81 | + </resource> |
| 82 | + </webResources> |
| 83 | + </configuration> |
| 84 | + </plugin> |
| 85 | + <plugin> |
| 86 | + <groupId>com.microsoft.azure</groupId> |
| 87 | + <artifactId>azure-webapp-maven-plugin</artifactId> |
| 88 | + <version>1.7.0</version> |
| 89 | + <configuration> |
| 90 | + <schemaVersion>V2</schemaVersion> |
| 91 | + <!-- Note: you cannot have both windows and linux app services in the same resource group --> |
| 92 | + <resourceGroup>** Your resource group **</resourceGroup> |
| 93 | + <appName>** Your app name **</appName> |
| 94 | + <region>** Your region **</region> |
| 95 | + <runtime> |
| 96 | + <!-- options for os: linux, windows and docker --> |
| 97 | + <os>linux</os> |
| 98 | + <!-- |
| 99 | + options for javaVersion and webContainer: |
| 100 | + see https://docs.microsoft.com/en-us/java/api/overview/azure/maven/azure-webapp-maven-plugin/readme?view=azure-java-stable#configuration-details |
| 101 | + --> |
| 102 | + <javaVersion>jre8</javaVersion> |
| 103 | + <webContainer>tomcat 8.5</webContainer> |
| 104 | + </runtime> |
| 105 | + <appSettings> |
| 106 | + <property> |
| 107 | + <!-- point to the applicationinsights-agent jar inside of the exploded war file --> |
| 108 | + <name>JAVA_OPTS</name> |
| 109 | + <value>-javaagent:/home/site/wwwroot/webapps/ROOT/META-INF/applicationinsights-agent-${appinsights.version}.jar</value> |
| 110 | + </property> |
| 111 | + </appSettings> |
| 112 | + <deployment> |
| 113 | + <resources> |
| 114 | + <resource> |
| 115 | + <directory>${project.basedir}/target</directory> |
| 116 | + <includes> |
| 117 | + <include>*.war</include> |
| 118 | + </includes> |
| 119 | + </resource> |
| 120 | + </resources> |
| 121 | + </deployment> |
| 122 | + </configuration> |
| 123 | + </plugin> |
| 124 | + </plugins> |
| 125 | + </build> |
| 126 | +</project> |
0 commit comments