Skip to content

Commit

Permalink
fix: trim profile id element to match profile ids
Browse files Browse the repository at this point in the history
  • Loading branch information
qoomon committed Feb 15, 2023
1 parent 68565c5 commit d45c1f0
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 3 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,12 @@

# Changelog

## 9.6.3

##### Fixes
- fix null pointer exception if profile id has leading or trailing whitespaces #239


## 9.6.2

##### Fixes
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ create or update `${rootProjectDir}/.mvn/extensions.xml` file
<extension>
<groupId>me.qoomon</groupId>
<artifactId>maven-git-versioning-extension</artifactId>
<version>9.6.2</version>
<version>9.6.3</version>
</extension>

</extensions>
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

<groupId>me.qoomon</groupId>
<artifactId>maven-git-versioning-extension</artifactId>
<version>9.6.2</version>
<version>9.6.3</version>
<packaging>maven-plugin</packaging>

<name>Maven Git Versioning Extension</name>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1309,7 +1309,8 @@ private void updateProfiles(Element projectElement, List<Profile> profiles) {
Map<String, Profile> profileMap = profiles.stream()
.collect(toMap(Profile::getId, it -> it));
for (Element profileElement : profilesElement.getChildren("profile")) {
Profile profile = profileMap.get(profileElement.getChild("id").getText());
String profileId = profileElement.getChild("id").getText().trim();
Profile profile = profileMap.get(profileId);
updatePropertyValues(profileElement, profile);
updateDependencyVersions(profileElement, profile);
updatePluginVersions(profileElement, profile.getBuild(), profile.getReporting());
Expand Down
6 changes: 6 additions & 0 deletions src/test/resources/testProjects/standardProject/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,8 +94,14 @@
</plugin>
</plugins>
</pluginManagement>

</build>

<profiles>
<profile>
<id>foo </id>
</profile>
</profiles>
</project>

<!--mvn install -Dmaven.repo.local=$PWD/.m2/repository-->

0 comments on commit d45c1f0

Please sign in to comment.