Skip to content

Commit

Permalink
#548 provide xsd schemas on GitHub pages (#549)
Browse files Browse the repository at this point in the history
* #548 added upload pages for schema

* #548 disabled upload pages from the master branch

* #548 moved test code from Ci to release for better testing
Disabled assets + pages to upload for testing

* #548 moved test code from Ci to release for better testing
Disabled assets + pages to upload for testing

* #548 testing new method

* #548 Added assembly
added unzip in manual

* #548 cleaned code

* #548 adjusted the branch back to the master branch and for the true release
  • Loading branch information
yaseno2186 authored Jul 28, 2024
1 parent 515f433 commit ad5012d
Show file tree
Hide file tree
Showing 23 changed files with 78 additions and 44 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
import static java.util.Collections.emptySet;

class JsonSchemaValidator {
private static final String JSON_SCHEMA = "/META-INF/rule/jsonschema/jqassistant-rule-v2.2.schema.json";
private static final String JSON_SCHEMA = "/META-INF/schema/jqassistant-rule-v2.2.schema.json";
private final ObjectMapper mapper;
private final JsonSchema schema;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@
public class XmlRuleParserPlugin extends AbstractRuleParserPlugin {

private static final String NAMESPACE_RULE = "http://schema.jqassistant.org/rule/v2.2";
private static final String RULES_SCHEMA_LOCATION = "/META-INF/rule/xsd/jqassistant-rule-v2.2.xsd";
private static final String RULES_SCHEMA_LOCATION = "/META-INF/schema/jqassistant-rule-v2.2.xsd";

private static final Schema SCHEMA = XmlHelper.getSchema(RULES_SCHEMA_LOCATION);

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ public interface PluginConfigurationReader {

String NAMESPACE = "http://schema.jqassistant.org/plugin/v2.2";
String PLUGIN_RESOURCE = "META-INF/jqassistant-plugin.xml";
String PLUGIN_SCHEMA_RESOURCE = "/META-INF/plugin/xsd/jqassistant-plugin-v2.2.xsd";
String PLUGIN_SCHEMA_RESOURCE = "/META-INF/schema/jqassistant-plugin-v2.2.xsd";

/**
* Return the class loader used to resolve plugins.
Expand Down
42 changes: 20 additions & 22 deletions core/schemata/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,25 @@

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-assembly-plugin</artifactId>
<executions>
<execution>
<id>package-schema</id>
<goals>
<goal>single</goal>
</goals>
<phase>package</phase>
<configuration>
<attach>true</attach>
<descriptors>
<descriptor>${project.basedir}/src/main/assembly/schema.xml</descriptor>
</descriptors>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.jvnet.jaxb2.maven2</groupId>
<artifactId>maven-jaxb2-plugin</artifactId>
Expand All @@ -36,32 +55,11 @@
<schemas>
<schema>
<fileset>
<directory>${project.basedir}/src/main/resources/META-INF/plugin/xsd</directory>
<directory>${project.basedir}/src/main/resources/META-INF/schema</directory>
<includes>
<include>jqassistant-plugin-v2.2.xsd</include>
</includes>
</fileset>
</schema>
<schema>
<fileset>
<directory>${project.basedir}/src/main/resources/META-INF/report/xsd</directory>
<includes>
<include>jqassistant-report-v2.3.xsd</include>
</includes>
</fileset>
</schema>
<schema>
<fileset>
<directory>${project.basedir}/src/main/resources/META-INF/rule/xsd</directory>
<includes>
<include>jqassistant-rule-v2.2.xsd</include>
</includes>
</fileset>
</schema>
<schema>
<fileset>
<directory>${project.basedir}/src/main/resources/META-INF/baseline/xsd</directory>
<includes>
<include>jqassistant-baseline-v2.4.xsd</include>
</includes>
</fileset>
Expand Down
18 changes: 18 additions & 0 deletions core/schemata/src/main/assembly/schema.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
<assembly xmlns="http://maven.apache.org/ASSEMBLY/2.2.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/ASSEMBLY/2.2.0 http://maven.apache.org/xsd/assembly-2.2.0.xsd">
<id>schema</id>
<formats>
<format>zip</format>
</formats>
<includeBaseDirectory>false</includeBaseDirectory>
<fileSets>
<fileSet>
<directory>${project.basedir}/src/main/resources/META-INF/schema</directory>
<includes>
<include>**/*</include>
</includes>
<outputDirectory>schema</outputDirectory>
</fileSet>
</fileSets>
</assembly>

This file was deleted.

37 changes: 37 additions & 0 deletions manual/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,19 @@
<stripVersion>true</stripVersion>
</configuration>
</execution>
<execution>
<id>unpack-schema</id>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<phase>generate-resources</phase>
<configuration>
<outputDirectory>${project.build.directory}/generated-docs</outputDirectory>
<includeTypes>zip</includeTypes>
<includeClassifiers>schema</includeClassifiers>
<stripVersion>true</stripVersion>
</configuration>
</execution>
</executions>
</plugin>
</plugins>
Expand Down Expand Up @@ -285,6 +298,20 @@
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.buschmais.jqassistant.core</groupId>
<artifactId>schemata</artifactId>
<version>${project.version}</version>
<type>zip</type>
<classifier>schema</classifier>
<scope>provided</scope>
<exclusions>
<exclusion>
<artifactId>*</artifactId>
<groupId>*</groupId>
</exclusion>
</exclusions>
</dependency>
</dependencies>
</dependencyManagement>
<dependencies>
Expand Down Expand Up @@ -374,6 +401,16 @@
<scope>provided</scope>
</dependency>

<!--
! The XML and JSON schemata provided by the core framework
!-->
<dependency>
<groupId>com.buschmais.jqassistant.core</groupId>
<artifactId>schemata</artifactId>
<type>zip</type>
<classifier>schema</classifier>
<scope>provided</scope>
</dependency>
</dependencies>

</project>

0 comments on commit ad5012d

Please sign in to comment.