Skip to content

Commit 8914b84

Browse files
Make implementation of new SemVer policies private for project
1 parent 7e861f0 commit 8914b84

File tree

7 files changed

+92
-5
lines changed

7 files changed

+92
-5
lines changed
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Licensed to the Apache Software Foundation (ASF) under one
4+
or more contributor license agreements. See the NOTICE file
5+
distributed with this work for additional information
6+
regarding copyright ownership. The ASF licenses this file
7+
to you under the Apache License, Version 2.0 (the
8+
"License"); you may not use this file except in compliance
9+
with the License. You may obtain a copy of the License at
10+
11+
http://www.apache.org/licenses/LICENSE-2.0
12+
13+
Unless required by applicable law or agreed to in writing,
14+
software distributed under the License is distributed on an
15+
"AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16+
KIND, either express or implied. See the License for the
17+
specific language governing permissions and limitations
18+
under the License.
19+
-->
20+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
21+
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
22+
<modelVersion>4.0.0</modelVersion>
23+
<groupId>org.apache.maven.plugin.release.it</groupId>
24+
<artifactId>semver-major-release-policy</artifactId>
25+
<version>1.0.1-SNAPSHOT</version>
26+
27+
<description>Make sure that, package visibility policy is working</description>
28+
29+
<scm>
30+
<connection>scm:dummy|nul</connection>
31+
<developerConnection>scm:dummy|nul</developerConnection>
32+
</scm>
33+
<build>
34+
<plugins>
35+
<plugin>
36+
<groupId>org.apache.maven.plugins</groupId>
37+
<artifactId>maven-release-plugin</artifactId>
38+
<version>@project.version@</version>
39+
<configuration>
40+
<projectVersionPolicyId>SemVerMajorRelease</projectVersionPolicyId>
41+
</configuration>
42+
<dependencies>
43+
<dependency>
44+
<groupId>org.apache.maven.its.release</groupId>
45+
<artifactId>maven-scm-provider-dummy</artifactId>
46+
<version>1.0</version>
47+
</dependency>
48+
</dependencies>
49+
</plugin>
50+
</plugins>
51+
</build>
52+
</project>
Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
/*
2+
* Licensed to the Apache Software Foundation (ASF) under one
3+
* or more contributor license agreements. See the NOTICE file
4+
* distributed with this work for additional information
5+
* regarding copyright ownership. The ASF licenses this file
6+
* to you under the Apache License, Version 2.0 (the
7+
* "License"); you may not use this file except in compliance
8+
* with the License. You may obtain a copy of the License at
9+
*
10+
* http://www.apache.org/licenses/LICENSE-2.0
11+
*
12+
* Unless required by applicable law or agreed to in writing,
13+
* software distributed under the License is distributed on an
14+
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
15+
* KIND, either express or implied. See the License for the
16+
* specific language governing permissions and limitations
17+
* under the License.
18+
*/
19+
20+
import groovy.xml.XmlSlurper
21+
22+
// The pom based version is NOT related to what the actual version will be.
23+
File pomXml = new File(basedir, 'pom.xml')
24+
assert pomXml.exists()
25+
assert new XmlSlurper().parse(pomXml).version.text() == "1.0.1-SNAPSHOT"
26+
27+
// The actual version is hard coded
28+
File pomXmlTag = new File(basedir, 'pom.xml.tag')
29+
assert pomXmlTag.exists()
30+
assert new XmlSlurper().parse(pomXmlTag).version.text() == "2.0.0"
31+
32+
// The next development version is hard coded
33+
File pomXmlNext = new File(basedir, 'pom.xml.next')
34+
assert pomXmlNext.exists()
35+
assert new XmlSlurper().parse(pomXmlNext).version.text() == "2.0.1-SNAPSHOT"

maven-release-policies/maven-release-semver-policy/src/main/java/org/apache/maven/shared/release/policy/semver/SemVerMajorDevelopmentVersionPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
@Singleton
3535
@Named("SemVerMajorDevelopment")
36-
public class SemVerMajorDevelopmentVersionPolicy extends AbstractSemVerVersionPolicy {
36+
class SemVerMajorDevelopmentVersionPolicy extends AbstractSemVerVersionPolicy {
3737

3838
@Override
3939
public VersionPolicyResult getReleaseVersion(VersionPolicyRequest request) throws VersionParseException {

maven-release-policies/maven-release-semver-policy/src/main/java/org/apache/maven/shared/release/policy/semver/SemVerMajorReleaseVersionPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
@Singleton
3535
@Named("SemVerMajorRelease")
36-
public class SemVerMajorReleaseVersionPolicy extends AbstractSemVerVersionPolicy {
36+
class SemVerMajorReleaseVersionPolicy extends AbstractSemVerVersionPolicy {
3737

3838
@Override
3939
public VersionPolicyResult getReleaseVersion(VersionPolicyRequest request) throws VersionParseException {

maven-release-policies/maven-release-semver-policy/src/main/java/org/apache/maven/shared/release/policy/semver/SemVerMinorDevelopmentVersionPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
@Singleton
3535
@Named("SemVerMinorDevelopment")
36-
public class SemVerMinorDevelopmentVersionPolicy extends AbstractSemVerVersionPolicy {
36+
class SemVerMinorDevelopmentVersionPolicy extends AbstractSemVerVersionPolicy {
3737

3838
@Override
3939
public VersionPolicyResult getReleaseVersion(VersionPolicyRequest request) throws VersionParseException {

maven-release-policies/maven-release-semver-policy/src/main/java/org/apache/maven/shared/release/policy/semver/SemVerMinorReleaseVersionPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
@Singleton
3535
@Named("SemVerMinorRelease")
36-
public class SemVerMinorReleaseVersionPolicy extends AbstractSemVerVersionPolicy {
36+
class SemVerMinorReleaseVersionPolicy extends AbstractSemVerVersionPolicy {
3737

3838
@Override
3939
public VersionPolicyResult getReleaseVersion(VersionPolicyRequest request) throws VersionParseException {

maven-release-policies/maven-release-semver-policy/src/main/java/org/apache/maven/shared/release/policy/semver/SemVerPatchDevelopmentVersionPolicy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@
3333
*/
3434
@Singleton
3535
@Named("SemVerPatchDevelopment")
36-
public class SemVerPatchDevelopmentVersionPolicy extends AbstractSemVerVersionPolicy {
36+
class SemVerPatchDevelopmentVersionPolicy extends AbstractSemVerVersionPolicy {
3737

3838
@Override
3939
public VersionPolicyResult getReleaseVersion(VersionPolicyRequest request) throws VersionParseException {

0 commit comments

Comments
 (0)