9aa31fea33175afd82d768531da3d52877b9ca1a
[yaz4j-moved-to-github.git] / unix / pom.xml
1 <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/maven-v4_0_0.xsd">
2   <modelVersion>4.0.0</modelVersion>
3   <parent>
4     <groupId>org.yaz4j</groupId>
5     <artifactId>yaz4j-lib</artifactId>
6     <version>1.6-SNAPSHOT</version>
7   </parent>
8   <groupId>org.yaz4j</groupId>
9   <artifactId>libyaz4j</artifactId>
10   <name>libyaz4j</name>
11   <packaging>${packaging}</packaging>
12
13   <build>
14     <finalName>${project.artifactId}</finalName>
15     <testSourceDirectory>../src/test</testSourceDirectory>
16
17     <plugins>
18       <plugin>
19         <artifactId>maven-antrun-plugin</artifactId>
20         <version>1.8</version>
21         <executions>
22           <execution>
23             <id>write-yaz-config</id>
24             <phase>initialize</phase>
25             <goals>
26               <goal>run</goal>
27             </goals>
28             <configuration>
29               <target>
30                 <exec executable="${yaz.config}" outputproperty="yaz.cflags">
31                   <arg value="--cflags" />
32                 </exec>
33                 <echo message="YAZ CFLAGS: ${yaz.cflags}" />
34                 <exec executable="${yaz.config}" outputproperty="yaz.libs">
35                   <arg value="--libs" />
36                 </exec>
37                 <echo message="YAZ LIBS: ${yaz.libs}" />
38                 <!-- this does not work on debian/ubuntu
39                 <propertyfile file="${basedir}/target/yaz-config.properties" comment="YAZ COMPILER/LINKER FLAGS">
40                   <entry key="yaz.cflags" value="${yaz.cflags}" />
41                   <entry key="yaz.libs" value="${yaz.libs}" />
42                 </propertyfile>
43                 -->
44                 <echo file="${basedir}/target/yaz-config.properties" message="yaz.cflags=${yaz.cflags}${line.separator}yaz.libs=${yaz.libs}" />
45               </target>
46             </configuration>
47           </execution>
48         </executions>
49       </plugin>
50       <plugin>
51         <groupId>org.codehaus.mojo</groupId>
52         <artifactId>properties-maven-plugin</artifactId>
53         <version>1.0-alpha-1</version>
54         <executions>
55           <execution>
56             <id>read-yaz-config</id>
57             <phase>initialize</phase>
58             <goals>
59               <goal>read-project-properties</goal>
60             </goals>
61             <configuration>
62               <files>
63                 <file>${basedir}/target/yaz-config.properties</file>
64               </files>
65             </configuration>
66           </execution>
67         </executions>
68       </plugin>
69       <plugin>
70         <groupId>org.codehaus.mojo</groupId>
71         <artifactId>native-maven-plugin</artifactId>
72         <version>1.0-alpha-8</version>
73         <extensions>true</extensions>       
74         <configuration>         
75           <javahOS>${javahOS}</javahOS>
76           <jdkIncludePath>${jdkIncludePath}</jdkIncludePath>
77           <compilerProvider>generic</compilerProvider>
78           <compilerExecutable>g++</compilerExecutable>
79           <compilerStartOptions>
80             <compilerStartOption>-fPIC -Wno-deprecated-declarations</compilerStartOption>
81           </compilerStartOptions>
82           <compilerEndOptions>
83             <compilerEndOption>${yaz.cflags}</compilerEndOption>
84           </compilerEndOptions>
85           <sources>
86             <source>
87               <includes>
88                 <include>**/*.cpp</include>
89               </includes>
90               <directory>../src/main/native</directory>
91             </source>
92             <source>
93               <includes>
94                 <include>**/*.cpp</include>
95               </includes>
96               <directory>../target/generated-sources/native</directory>
97             </source>
98           </sources>
99           <linkerExecutable>g++</linkerExecutable>
100           <linkerStartOptions>
101             <linkerStartOption>-shared</linkerStartOption>
102           </linkerStartOptions>
103           <linkerEndOptions>
104             <linkerEndOption>${yaz.libs}</linkerEndOption>
105           </linkerEndOptions>
106         </configuration>
107       </plugin>
108
109       <!-- this is to compile and execute tests, that are arch-dependent
110        because they need to load so/dll -->
111       <plugin>
112         <groupId>org.apache.maven.plugins</groupId>
113         <artifactId>maven-compiler-plugin</artifactId>
114         <version>3.3</version>
115         <configuration>
116           <encoding>UTF-8</encoding>
117           <source>1.6</source>
118           <target>1.6</target>
119           <showDeprecation>true</showDeprecation>
120           <showWarnings>true</showWarnings>
121         </configuration>
122       </plugin>
123
124       <plugin>
125         <groupId>org.codehaus.mojo</groupId>
126         <artifactId>build-helper-maven-plugin</artifactId>
127         <version>1.9.1</version>
128         <executions>
129           <execution>
130             <id>include-generated-test-sources</id>
131             <phase>generate-test-sources</phase>
132             <goals><goal>add-test-source</goal></goals>
133             <configuration>
134               <sources>
135                 <source>../src/main/java</source>
136                 <source>../target/generated-sources/java</source>
137               </sources>
138             </configuration>
139           </execution>
140         </executions>
141       </plugin>
142
143       <plugin>
144         <artifactId>maven-surefire-plugin</artifactId>
145         <version>2.18.1</version>
146         <configuration>
147           <forkMode>once</forkMode>
148           <workingDirectory>target</workingDirectory>
149           <argLine>-Djava.library.path=${project.build.directory}</argLine>
150         </configuration>
151       </plugin>
152     </plugins>    
153   </build>
154
155   <repositories>
156     <repository>
157       <id>Codehaus Snapshots</id>
158       <url>http://snapshots.repository.codehaus.org/</url>
159       <snapshots>
160         <enabled>true</enabled>
161       </snapshots>
162       <releases>
163         <enabled>false</enabled>
164       </releases>
165     </repository>
166   </repositories>
167   <pluginRepositories>
168     <pluginRepository>
169       <id>Codehaus Snapshots</id>
170       <url>http://snapshots.repository.codehaus.org/</url>
171       <snapshots>
172         <enabled>true</enabled>
173       </snapshots>
174       <releases>
175         <enabled>true</enabled>  <!-- Workaround for MNG-2974, see note below -->
176       </releases>
177     </pluginRepository>
178   </pluginRepositories>
179 </project>