diff options
-rw-r--r-- | pom.xml | 34 | ||||
-rw-r--r-- | scripts/get-latest-xsd-version.sh | 6 |
2 files changed, 33 insertions, 7 deletions
@@ -48,6 +48,8 @@ <project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding> <java.version>1.8</java.version> <docker.location>${basedir}/target</docker.location> + <aai.schema.source.folder>onap/aai_schema</aai.schema.source.folder> + <aai.schema.target.folder>${project.build.directory}/aai-schema</aai.schema.target.folder> <!-- Dependency Versions --> <common.logging.version>1.2.2</common.logging.version> @@ -63,6 +65,7 @@ <xmlunit.version>1.6</xmlunit.version> <logback.version>1.2.3</logback.version> <guava.version>25.1-jre</guava.version> + <antrun.version>1.8</antrun.version> </properties> <dependencyManagement> @@ -204,8 +207,8 @@ <artifactId>aai-schema</artifactId> <version>${aai-schema.version}</version> <type>jar</type> - <includes>aai_schema/aai_schema_v**.xsd</includes> - <outputDirectory>target/tmp</outputDirectory> + <includes>${aai.schema.source.folder}/aai_schema_v**.xsd</includes> + <outputDirectory>${project.build.directory}/tmp</outputDirectory> </artifactItem> </artifactItems> </configuration> @@ -213,6 +216,29 @@ </executions> </plugin> <plugin> + <groupId>org.apache.maven.plugins</groupId> + <artifactId>maven-antrun-plugin</artifactId> + <version>${antrun.version}</version> + <executions> + <execution> + <id>Flatten XSDs</id> + <phase>initialize</phase> + <goals> + <goal>run</goal> + </goals> + <configuration> + <target> + <copy todir="${aai.schema.target.folder}" flatten="true"> + <fileset dir="${project.build.directory}/tmp"> + <include name="**/*.xsd" /> + </fileset> + </copy> + </target> + </configuration> + </execution> + </executions> + </plugin> + <plugin> <groupId>org.jvnet.jaxb2.maven2</groupId> <artifactId>maven-jaxb2-plugin</artifactId> <version>${mvn.jaxb2.version}</version> @@ -225,9 +251,9 @@ </execution> </executions> <configuration> - <schemaDirectory>target/tmp/aai_schema</schemaDirectory> + <schemaDirectory>${aai.schema.target.folder}</schemaDirectory> <generatePackage>org.onap.aai.babel.xml.generator.xsd</generatePackage> - <generateDirectory>target/generated-sources</generateDirectory> + <generateDirectory>${project.build.directory}/generated-sources</generateDirectory> <schemaIncludes> <include>aai_schema_latest.xsd</include> </schemaIncludes> diff --git a/scripts/get-latest-xsd-version.sh b/scripts/get-latest-xsd-version.sh index 0529821..0bc6df4 100644 --- a/scripts/get-latest-xsd-version.sh +++ b/scripts/get-latest-xsd-version.sh @@ -1,7 +1,7 @@ basedir=$1 -cd ${basedir}/target/tmp/aai_schema -cp `ls -v | tail -1` ${basedir}/target/tmp/aai_schema/aai_schema_latest.xsd || exit 1 -echo "get-latest-xsd-version.sh has successfully copied aai_schema_latest.xsd to ${basedir}/target/tmp/aai_schema/latest_aai_schema" +cd ${basedir}/target/aai-schema +cp `ls -v | tail -1` ${basedir}/target/aai-schema/aai_schema_latest.xsd || exit 1 +echo "get-latest-xsd-version.sh has successfully copied aai_schema_latest.xsd to ${basedir}/target/aai-schema" exit 0 |