forked from mojohaus/versions
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Resolves mojohaus#359: XML Property Updates Report
- Loading branch information
Showing
17 changed files
with
531 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,171 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
|
||
<!-- | ||
Licensed to the Apache Software Foundation (ASF) under one | ||
or more contributor license agreements. See the NOTICE file | ||
distributed with this work for additional information | ||
regarding copyright ownership. The ASF licenses this file | ||
to you under the Apache License, Version 2.0 (the | ||
"License"); you may not use this file except in compliance | ||
with the License. You may obtain a copy of the License at | ||
http://www.apache.org/licenses/LICENSE-2.0 | ||
Unless required by applicable law or agreed to in writing, | ||
software distributed under the License is distributed on an | ||
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY | ||
KIND, either express or implied. See the License for the | ||
specific language governing permissions and limitations | ||
under the License. | ||
--> | ||
|
||
<model xmlns="http://codehaus-plexus.github.io/MODELLO/2.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" | ||
xsi:schemaLocation="http://codehaus-plexus.github.io/MODELLO/2.0.0 https://codehaus-plexus.github.io/modello/xsd/modello-2.0.0.xsd" | ||
xml.namespace="https://www.mojohaus.org/VERSIONS/PROPERTY-UPDATES-REPORT/${version}" | ||
xml.schemaLocation="https://www.mojohaus.org/versions-maven-plugin/xsd/property-updates-report-${version}.xsd"> | ||
<id>property-updates-report</id> | ||
<name>PropertyUpdatesReport</name> | ||
<description> | ||
XML version of the Property Updates Report | ||
</description> | ||
|
||
<defaults> | ||
<default> | ||
<key>package</key> | ||
<value>org.codehaus.mojo.versions.reporting.model</value> | ||
</default> | ||
</defaults> | ||
|
||
<versionDefinition> | ||
<type>namespace</type> | ||
</versionDefinition> | ||
|
||
<classes> | ||
|
||
<class rootElement="true" xml.tagName="PropertyUpdatesReport"> | ||
<name>PropertyUpdatesReport</name> | ||
<fields> | ||
<field> | ||
<name>summary</name> | ||
<required>true</required> | ||
<association> | ||
<type>PropertyReportSummary</type> | ||
<multiplicity>1</multiplicity> | ||
</association> | ||
</field> | ||
<field> | ||
<name>properties</name> | ||
<association xml.itemsStyle="wrapped" xml.tagName="property"> | ||
<type>PropertyInfo</type> | ||
<multiplicity>*</multiplicity> | ||
</association> | ||
</field> | ||
</fields> | ||
</class> | ||
|
||
<class> | ||
<name>PropertyReportSummary</name> | ||
<fields> | ||
<field> | ||
<name>usingLastVersion</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>nextVersionAvailable</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>nextIncrementalAvailable</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>nextMinorAvailable</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>nextMajorAvailable</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
</fields> | ||
</class> | ||
|
||
<class> | ||
<name>PropertyInfo</name> | ||
<fields> | ||
<field> | ||
<name>propertyName</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>propertyAssociations</name> | ||
<association xml.itemsStyle="wrapped" xml.tagName="propertyAssociation"> | ||
<type>PropertyAssociation</type> | ||
<multiplicity>*</multiplicity> | ||
</association> | ||
</field> | ||
<field> | ||
<name>currentVersion</name> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>lastVersion</name> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>any</name> | ||
<association xml.itemsStyle="wrapped" xml.tagName="any"> | ||
<type>String</type> | ||
<multiplicity>*</multiplicity> | ||
</association> | ||
</field> | ||
<field> | ||
<name>incrementals</name> | ||
<association xml.itemsStyle="wrapped" xml.tagName="incremental"> | ||
<type>String</type> | ||
<multiplicity>*</multiplicity> | ||
</association> | ||
</field> | ||
<field> | ||
<name>minors</name> | ||
<association xml.itemsStyle="wrapped" xml.tagName="minor"> | ||
<type>String</type> | ||
<multiplicity>*</multiplicity> | ||
</association> | ||
</field> | ||
<field> | ||
<name>majors</name> | ||
<association xml.itemsStyle="wrapped" xml.tagName="major"> | ||
<type>String</type> | ||
<multiplicity>*</multiplicity> | ||
</association> | ||
</field> | ||
<field> | ||
<name>status</name> | ||
<required>true</required> | ||
<type>String</type> | ||
</field> | ||
</fields> | ||
</class> | ||
|
||
<class> | ||
<name>PropertyAssociation</name> | ||
<fields> | ||
<field> | ||
<name>groupId</name> | ||
<type>String</type> | ||
</field> | ||
<field> | ||
<name>artifactId</name> | ||
<type>String</type> | ||
</field> | ||
</fields> | ||
</class> | ||
|
||
</classes> | ||
</model> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
invoker.goals = ${project.groupId}:${project.artifactId}:${project.version}:property-updates-report | ||
invoker.mavenOpts = -DpropertyUpdatesReportFormats=xml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<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/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<groupId>localhost</groupId> | ||
<artifactId>it-xml-property-updates-report-001</artifactId> | ||
<version>1.0</version> | ||
|
||
<properties> | ||
<api-version>1.0</api-version> | ||
<impl-version>2.0</impl-version> | ||
<plugin-version>3.0</plugin-version> | ||
</properties> | ||
|
||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>[${api-version},2.1-!)</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-impl</artifactId> | ||
<version>${impl-version}</version> | ||
</dependency> | ||
</dependencies> | ||
<build> | ||
<pluginManagement> | ||
<plugins> | ||
<plugin> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-maven-plugin</artifactId> | ||
<version>${plugin-version}</version> | ||
<dependencies> | ||
<dependency> | ||
<groupId>localhost</groupId> | ||
<artifactId>dummy-api</artifactId> | ||
<version>${plugin-version}</version> | ||
</dependency> | ||
</dependencies> | ||
</plugin> | ||
</plugins> | ||
</pluginManagement> | ||
</build> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,42 @@ | ||
class Fragment | ||
{ | ||
private fragment | ||
|
||
Fragment( output, beginString, endString ) | ||
{ | ||
def startIndex = output.indexOf( beginString ) | ||
def endIndex = output.indexOf( endString, startIndex ) | ||
assert startIndex != -1 | ||
assert endIndex != -1 | ||
fragment = output.substring( startIndex, endIndex + endString.length() ) | ||
} | ||
|
||
def contains( String searchString ) | ||
{ | ||
return fragment.contains( searchString ) | ||
} | ||
|
||
String toString() | ||
{ | ||
return fragment | ||
} | ||
} | ||
|
||
def output = new File( basedir, 'target/property-updates-report.xml' ).text | ||
.replaceAll( '\\n', '' ) | ||
.replaceAll( '\\r', '' ) | ||
|
||
summary = new Fragment( output, '<summary>', '</summary>' ) | ||
|
||
assert summary.contains( '<usingLastVersion>1</usingLastVersion>' ) | ||
assert summary.contains( '<nextIncrementalAvailable>1</nextIncrementalAvailable>' ) | ||
assert summary.contains( '<nextMinorAvailable>1</nextMinorAvailable>' ) | ||
|
||
assert new Fragment( output, '<propertyName>api-version</propertyName>', | ||
'</property>' ).contains( '<status>incremental available</status>' ) | ||
|
||
assert new Fragment( output, '<propertyName>impl-version</propertyName>', | ||
'</property>' ).contains( '<status>minor available</status>' ) | ||
|
||
assert new Fragment( output, '<propertyName>plugin-version</propertyName>', | ||
'</property>' ).contains( '<status>no new available</status>' ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
title: XML schemas | ||
author: Slawomir Jaranowski | ||
date: 2022-10-17 | ||
|
||
<!-- GitHub pages doesn't generate index page ... we need prepare one --> | ||
|
||
# Versions - XML schemas | ||
|
||
## dependency-updates-report.xsd | ||
|
||
- [dependency-updates-report-2.1.0.xsd](dependency-updates-report-2.1.0.xsd) | ||
|
||
## plugin-updates-report.xsd | ||
|
||
- [plugin-updates-report-2.1.0.xsd](plugin-updates-report-2.1.0.xsd) | ||
|
||
## property-updates-report.xsd | ||
|
||
- [property-updates-report-2.1.0.xsd](property-updates-report-2.1.0.xsd) | ||
|
||
## rule.xsd | ||
|
||
- [rule-2.0.0.xsd](rule-2.0.0.xsd) | ||
- [rule-2.1.0.xsd](rule-2.1.0.xsd) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.