aboutsummaryrefslogtreecommitdiffstats
path: root/sonar/ooxml-full/pom.xml
blob: 3b10eff0082ca1255c5f4c5bfb514d3fa2479327 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
<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">
    <modelVersion>4.0.0</modelVersion>
    <parent>
        <groupId>org.apache.poi</groupId>
        <artifactId>poi-parent</artifactId>
        <version>5.0.1-SNAPSHOT</version>
        <relativePath>..</relativePath>
    </parent>
    <artifactId>poi-ooxml-lite</artifactId>
    <packaging>jar</packaging>

    <name>Apache POI - Openxmlformats Schema package</name>

    <properties>
        <!-- see http://docs.codehaus.org/display/SONAR/Narrowing+the+Focus for details of this property -->
        <sonar.exclusions>target/generated-sources/*</sonar.exclusions>
        <maven.compiler.fork>true</maven.compiler.fork>
    </properties>

    <build>
        <plugins>
            <plugin>
                <artifactId>maven-antrun-plugin</artifactId>
                <version>${maven.plugin.antrun.version}</version>
                <executions>
                    <execution>
                        <id>copy-xmltype-and-xsdconfig</id>
                        <phase>generate-sources</phase>
                        <goals>
                            <goal>run</goal>
                        </goals>
                        <configuration>
                            <target>
                                <property name="xsdir" value="${basedir}/../../poi-ooxml-full/src/main/xmlschema/org/apache/poi"/>
                                <copy todir="${basedir}/target/schemas">
                                    <zipfileset src="${xsdir}/schemas/OfficeOpenXML-XMLSchema-Transitional.zip"/>
                                    <zipfileset src="${xsdir}/schemas/OpenPackagingConventions-XMLSchema.zip" includes="opc-digSig.xsd,opc-relationships.xsd"/>
                                    <fileset dir="${xsdir}/xdgf" includes="*.xsd,*.xsdconfig"/>
                                    <fileset dir="${xsdir}/schemas" includes="*.xsd,*.xsdconfig"/>
                                    <fileset dir="${xsdir}/poifs/crypt" includes="signatureInfo.xsd"/>
                                </copy>
                            </target>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>exec-maven-plugin</artifactId>
                <version>3.0.0</version>
                <executions>
                    <execution>
                        <phase>process-sources</phase>
                        <goals>
                            <!-- need to use exec instead of java, because SchemaCompiler calls System.exit() -->
                            <goal>exec</goal>
                        </goals>
                    </execution>
                </executions>
                <configuration>
                    <executable>java</executable>
                    <arguments>
                        <argument>-classpath</argument>
                        <!-- automatically creates the classpath using all project dependencies,
                             also adding the project build directory -->
                        <classpath/>
                        <argument>org.apache.xmlbeans.impl.tool.SchemaCompiler</argument>
                        <argument>-srconly</argument>
                        <argument>-name</argument>
                        <argument>ooxml</argument>
                        <argument>-repackage</argument>
                        <argument>org.apache.xmlbeans.metadata:org.apache.poi.schemas.ooxml</argument>
                        <argument>-d</argument>
                        <argument>${basedir}/target/generated-resources</argument>
                        <argument>-src</argument>
                        <argument>${basedir}/target/generated-sources</argument>
                        <argument>${basedir}/target/schemas</argument>
                    </arguments>
                </configuration>
            </plugin>

            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>build-helper-maven-plugin</artifactId>
                <version>3.2.0</version>
                <executions>
                    <execution>
                        <id>add-source</id>
                        <goals>
                            <goal>add-source</goal>
                            <goal>add-resource</goal>
                        </goals>
                        <configuration>
                            <resources>
                                <resource>
                                    <directory>${basedir}/target/generated-resources</directory>
                                </resource>
                                <resource>
                                    <directory>${basedir}/../../poi-ooxml-full/src/main/java9</directory>
                                    <targetPath>META-INF/versions/9</targetPath>
                                    <includes>
                                        <include>*.class</include>
                                    </includes>
                                </resource>
                            </resources>
                            <sources>
                                <source>${basedir}/target/generated-sources</source>
                            </sources>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-jar-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <archive>
                        <manifestEntries>
                            <Multi-Release>true</Multi-Release>
                            <Automatic-Module-Name>org.apache.poi.ooxml.schemas</Automatic-Module-Name>
                        </manifestEntries>
                    </archive>
                </configuration>
            </plugin>
        </plugins>
    </build>

    <dependencies>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>poi-main</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
            <groupId>${project.groupId}</groupId>
            <artifactId>poi-scratchpad</artifactId>
            <version>${project.version}</version>
        </dependency>
        <dependency>
          <groupId>org.apache.xmlbeans</groupId>
          <artifactId>xmlbeans</artifactId>
          <version>${xmlbeans.version}</version>
        </dependency>
    </dependencies>
</project>