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