Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reading project model should throw exception #1023

Merged
merged 1 commit into from
Nov 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1416,9 +1416,8 @@ public static Map<File, Model> getChildModels(MavenProject project, Log logger)
* @param model The root model
* @param logger The logger for logging.
* @return A map of raw models keyed by path relative to the project's basedir.
* @throws IOException if things go wrong.
*/
private static Map<File, Model> getChildModels(Model model, Log logger) throws IOException {
private static Map<File, Model> getChildModels(Model model, Log logger) {
Map<File, Model> result = new LinkedHashMap<>();
Map<File, Model> childResults = new LinkedHashMap<>();

Expand All @@ -1436,7 +1435,7 @@ private static Map<File, Model> getChildModels(Model model, Log logger) throws I
result.put(pomFile, moduleModel);
childResults.putAll(getChildModels(moduleModel, logger));
} catch (IOException e) {
logger.error("Could not parse " + pomFile.getPath(), e);
throw new UncheckedIOException(e);
}
});

Expand Down
1 change: 1 addition & 0 deletions versions-maven-plugin/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -200,6 +200,7 @@
<pomExclude>it-lock-snapshots-junit/*</pomExclude>
</pomExcludes>
<postBuildHookScript>verify</postBuildHookScript>
<preBuildHookScript>setup</preBuildHookScript>
<filterProperties>
<repository.proxy.url>${repository.proxy.url}</repository.proxy.url>
</filterProperties>
Expand Down
23 changes: 23 additions & 0 deletions versions-maven-plugin/src/it/it-set-017-issue-321/setup.groovy
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
import java.nio.file.Files
/*
* Copyright MojoHaus and Contributors
*
* Licensed 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.
*
*/

// rename file before run test
def module2Path = basedir.toPath().resolve('module-a2')
Files.move(module2Path.resolve('pom.invalid'), module2Path.resolve('pom.xml'))

return true
22 changes: 0 additions & 22 deletions versions-maven-plugin/src/it/it-set-017-issue-321/verify.bsh

This file was deleted.

Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@


def log = new File( basedir, "build.log" ).text
assert log.contains(' Illegal processing instruction target ("xml"); xml (case insensitive) is reserved by the specs.')