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