#840 - Conditionally deploy schema files.
Do not fail if the project has no schema files.
This commit is contained in:
@@ -619,6 +619,7 @@
|
||||
<!--
|
||||
Copies all namespaces schemas to target/schemas flatten the directory structure.
|
||||
Depended on by the site.xml assembly descriptor.
|
||||
Conditional execution if schemas are present.
|
||||
-->
|
||||
|
||||
<plugin>
|
||||
@@ -632,8 +633,10 @@
|
||||
<configuration>
|
||||
<target>
|
||||
<copy todir="${project.build.directory}/schemas">
|
||||
<fileset dir="${basedir}" erroronmissingdir="false">
|
||||
<include name="**/src/main/resources/**/config/spring-*.xsd"/>
|
||||
<fileset dir="${basedir}"
|
||||
erroronmissingdir="false">
|
||||
<include
|
||||
name="**/src/main/resources/**/config/spring-*.xsd"/>
|
||||
</fileset>
|
||||
<flattenmapper/>
|
||||
</copy>
|
||||
@@ -644,6 +647,39 @@
|
||||
</goals>
|
||||
</execution>
|
||||
|
||||
<execution>
|
||||
<id>check-schema-files</id>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<target>
|
||||
<available
|
||||
file="${project.build.directory}/schemas"
|
||||
property="schema.present"/>
|
||||
</target>
|
||||
<exportAntProperties>true</exportAntProperties>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
<execution>
|
||||
<id>zip-schema-files</id>
|
||||
<phase>prepare-package</phase>
|
||||
<configuration>
|
||||
<target if="schema.present">
|
||||
<zip destfile="${project.build.directory}/${dist.id}-${project.version}-schema.zip"
|
||||
basedir="${project.build.directory}/schemas"
|
||||
whenempty="skip"/>
|
||||
<attachartifact
|
||||
file="${project.build.directory}/${dist.id}-${project.version}-schema.zip"
|
||||
classifier="schema" type="zip"/>
|
||||
</target>
|
||||
</configuration>
|
||||
<goals>
|
||||
<goal>run</goal>
|
||||
</goals>
|
||||
</execution>
|
||||
|
||||
</executions>
|
||||
|
||||
</plugin>
|
||||
@@ -658,30 +694,6 @@
|
||||
<pluginManagement>
|
||||
<plugins>
|
||||
|
||||
<!--
|
||||
Creates schema zip.
|
||||
-->
|
||||
<plugin>
|
||||
<groupId>org.apache.maven.plugins</groupId>
|
||||
<artifactId>maven-assembly-plugin</artifactId>
|
||||
<executions>
|
||||
<execution>
|
||||
<id>schema</id>
|
||||
<goals>
|
||||
<goal>single</goal>
|
||||
</goals>
|
||||
<phase>package</phase>
|
||||
<configuration>
|
||||
<descriptors>
|
||||
<descriptor>${shared.resources}/assemblies/schema.xml</descriptor>
|
||||
</descriptors>
|
||||
<finalName>${dist.id}</finalName>
|
||||
<appendAssemblyId>true</appendAssemblyId>
|
||||
</configuration>
|
||||
</execution>
|
||||
</executions>
|
||||
</plugin>
|
||||
|
||||
<!-- Deploy to Artifactory -->
|
||||
|
||||
<plugin>
|
||||
@@ -701,7 +713,7 @@
|
||||
<deployProperties>
|
||||
<zip.name>${dist.id}</zip.name>
|
||||
<zip.displayname>${dist.id}</zip.displayname>
|
||||
<zip.deployed>true</zip.deployed>
|
||||
<zip.deployed>false</zip.deployed>
|
||||
<zip.type>schema</zip.type>
|
||||
</deployProperties>
|
||||
<buildInfo>
|
||||
|
||||
Reference in New Issue
Block a user