The final restructured version for automatic build using maven tycho
[Mograsim.git] / releng / net.mograsim.configuration / pom.xml
1 <project xmlns="http://maven.apache.org/POM/4.0.0"
2         xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
3         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4         <modelVersion>4.0.0</modelVersion>
5         <groupId>net.mograsim</groupId>
6         <artifactId>net.mograsim.configuration</artifactId>
7         <version>${revision}${changelist}</version>
8         <packaging>pom</packaging>
9
10         <properties>
11                 <!-- Mograsim variables, see https://maven.apache.org/maven-ci-friendly.html -->
12                 <revision>0.1.0</revision>
13                 <changelist>-SNAPSHOT</changelist>
14                 <!-- Environment -->
15                 <java.version>11</java.version> <!-- currently unused -->
16                 <tycho.version>1.5.0-SNAPSHOT</tycho.version>
17                 <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
18         </properties>
19
20         <pluginRepositories>
21                 <!-- currently necessary because we are using a SNAPSHOT build of tycho -->
22                 <pluginRepository>
23                         <id>tycho-snapshots</id>
24                         <url>https://repo.eclipse.org/content/repositories/tycho-snapshots/</url>
25                         <releases>
26                                 <enabled>true</enabled>
27                         </releases>
28                         <snapshots>
29                                 <enabled>true</enabled>
30                         </snapshots>
31                 </pluginRepository>
32         </pluginRepositories>
33
34         <!-- Not needed, as an explicit target definition is provided by releng/net.mograsim.target/ 
35                 This provides a uniform configuration, and we don't get weird errors. -->
36         <!-- <repositories> <repository> <id>eclipse-release</id> <url>http://download.eclipse.org/releases/2019-06</url> 
37                 <layout>p2</layout> </repository> </repositories> -->
38
39         <build>
40                 <plugins>
41                         <!-- Maven Tycho is our main build plugin for the Eclipse/OSGi environment -->
42                         <plugin>
43                                 <groupId>org.eclipse.tycho</groupId>
44                                 <artifactId>tycho-maven-plugin</artifactId>
45                                 <version>${tycho.version}</version>
46                                 <extensions>true</extensions>
47                         </plugin>
48
49                         <!-- We might use this in future to change versions comfortably -->
50                         <!-- <plugin> <groupId>org.eclipse.tycho</groupId> <artifactId>tycho-versions-plugin</artifactId> 
51                                 <version>${tycho.version}</version> <executions> <execution> <id>set-all-versions</id> 
52                                 <phase>post-clean</phase> <goals> <goal>set-version</goal> <goal>update-eclipse-metadata</goal> 
53                                 </goals> <configuration> <newVersion>0.2.0</newVersion> <properties>revision</properties> 
54                                 </configuration> </execution> </executions> </plugin> -->
55
56                         <!--Enable the replacement of the SNAPSHOT version in the final feature/product 
57                                 configuration -->
58                         <plugin>
59                                 <groupId>org.eclipse.tycho</groupId>
60                                 <artifactId>target-platform-configuration</artifactId>
61                                 <version>${tycho.version}</version>
62                                 <configuration>
63                                         <target>
64                                                 <artifact>
65                                                         <groupId>net.mograsim</groupId>
66                                                         <artifactId>net.mograsim.target</artifactId>
67                                                         <version>${revision}${changelist}</version>
68                                                 </artifact>
69                                         </target>
70                                         <environments>
71                                                 <environment>
72                                                         <os>linux</os>
73                                                         <ws>gtk</ws>
74                                                         <arch>x86_64</arch>
75                                                 </environment>
76                                                 <environment>
77                                                         <os>win32</os>
78                                                         <ws>win32</ws>
79                                                         <arch>x86_64</arch>
80                                                 </environment>
81                                                 <environment>
82                                                         <os>macosx</os>
83                                                         <ws>cocoa</ws>
84                                                         <arch>x86_64</arch>
85                                                 </environment>
86                                         </environments>
87                                 </configuration>
88                         </plugin>
89
90                         <!-- This makes maven generate proper POMs without the revision placeholder, 
91                                 this is related to the ".flattened-pom.xml" mentioned in .gitignore -->
92                         <plugin>
93                                 <groupId>org.codehaus.mojo</groupId>
94                                 <artifactId>flatten-maven-plugin</artifactId>
95                                 <version>1.1.0</version>
96                                 <configuration>
97                                         <updatePomFile>true</updatePomFile>
98                                         <flattenMode>resolveCiFriendliesOnly</flattenMode>
99                                 </configuration>
100                                 <executions>
101                                         <execution>
102                                                 <id>flatten</id>
103                                                 <phase>process-resources</phase>
104                                                 <goals>
105                                                         <goal>flatten</goal>
106                                                 </goals>
107                                         </execution>
108                                         <execution>
109                                                 <id>flatten.clean</id>
110                                                 <phase>clean</phase>
111                                                 <goals>
112                                                         <goal>clean</goal>
113                                                 </goals>
114                                         </execution>
115                                 </executions>
116                         </plugin>
117
118                         <!-- Generate sources for plugins and features automatically -->
119                         <!-- (this includes all three following plugins) -->
120                         <plugin>
121                                 <groupId>org.eclipse.tycho</groupId>
122                                 <artifactId>tycho-source-plugin</artifactId>
123                                 <version>${tycho.version}</version>
124                                 <executions>
125                                         <execution>
126                                                 <id>plugin-source</id>
127                                                 <goals>
128                                                         <goal>plugin-source</goal>
129                                                 </goals>
130                                         </execution>
131                                 </executions>
132                         </plugin>
133                         <plugin>
134                                 <groupId>org.eclipse.tycho.extras</groupId>
135                                 <artifactId>tycho-source-feature-plugin</artifactId>
136                                 <version>${tycho.version}</version>
137                                 <executions>
138                                         <execution>
139                                                 <id>source-feature</id>
140                                                 <phase>package</phase>
141                                                 <goals>
142                                                         <goal>source-feature</goal>
143                                                 </goals>
144                                         </execution>
145                                 </executions>
146                                 <configuration>
147                                         <excludes>
148                                                 <!-- IMPORTANT: List of plugins without any sources to avoid errors -->
149                                                 <plugin id="net.mograsim.plugin.branding" />
150                                                 <plugin id="net.mograsim.plugin.docs" />
151                                         </excludes>
152                                 </configuration>
153                         </plugin>
154                         <plugin>
155                                 <groupId>org.eclipse.tycho</groupId>
156                                 <artifactId>tycho-p2-plugin</artifactId>
157                                 <version>${tycho.version}</version>
158                                 <executions>
159                                         <execution>
160                                                 <id>attach-p2-metadata</id>
161                                                 <phase>package</phase>
162                                                 <goals>
163                                                         <goal>p2-metadata</goal>
164                                                 </goals>
165                                         </execution>
166                                 </executions>
167                         </plugin>
168                 </plugins>
169         </build>
170 </project>