GeezerVison is showing github.com — [MRELEASE-1144] Upgrade to Parent 42 by michael-o · Pull Request #216 · apache/maven-release
Conversation
This closes #216
Following this checklist to help us incorporate your
contribution quickly and easily:
- Make sure there is a JIRA issue filed
for the change (usually before you start working on it). Trivial changes like typos do not
require a JIRA issue. Your pull request should address just this issue, without
pulling in other changes.
- Each commit in the pull request should have a meaningful subject line and body.
- Format the pull request title like
[MRELEASE-XXX] - Fixes bug in ApproximateQuantiles,
where you replace MRELEASE-XXX with the appropriate JIRA issue. Best practice
is to use the JIRA issue title in the pull request title and in the first line of the
commit message.
- Write a pull request description that is detailed enough to understand what the pull request does, how, and why.
- Run
mvn clean verify -Prun-its to make sure basic checks pass. A more thorough check will
be performed on your pull request automatically.
If your pull request is about ~20 lines of code you don't need to sign an
Individual Contributor License Agreement if you are unsure
please ask on the developers list.
To make clear that you license your contribution under
the Apache License Version 2.0, January 2004
you have to acknowledge this by using the following check-box.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
@cstamas Can you help and have a look at the failure? subproject2 depends on subproject1 (in compile scope) which has junit in test scope, but some some reason that is dragged into subproject1 as test as well.
The code which builds is:
protected List<MavenProject> createReactorProjects(String sourcePath, String targetPath, String executionRoot)
throws Exception {
final Path testCaseRootFrom =
Paths.get(getBasedir(), "src/test/resources").resolve(Paths.get("projects", sourcePath));
final Path testCaseRootTo = getWorkingDirectory(targetPath);
// Recopy the test resources since they are modified in some tests
Files.walkFileTree(testCaseRootFrom, new SimpleFileVisitor<Path>() {
@Override
public FileVisitResult visitFile(Path file, BasicFileAttributes attrs) throws IOException {
Path relPath = testCaseRootFrom.relativize(file);
if (!relPath.toFile().getName().startsWith("expected-")) {
Files.createDirectories(testCaseRootTo.resolve(relPath).getParent());
Files.copy(file, testCaseRootTo.resolve(relPath), StandardCopyOption.REPLACE_EXISTING);
}
return FileVisitResult.CONTINUE;
}
});
Path projectFile;
if (executionRoot == null) {
projectFile = testCaseRootTo.resolve("pom.xml");
} else {
projectFile = testCaseRootTo.resolve(Paths.get(executionRoot, "pom.xml"));
}
List<ArtifactRepository> repos = Collections.singletonList(
new DefaultArtifactRepository("central", getRemoteRepositoryURL(), new DefaultRepositoryLayout()));
Repository repository = new Repository();
repository.setId("central");
repository.setUrl(getRemoteRepositoryURL());
Profile profile = new Profile();
profile.setId("profile");
profile.addRepository(repository);
ProjectBuildingRequest buildingRequest = new DefaultProjectBuildingRequest();
buildingRequest.setLocalRepository(localRepository);
buildingRequest.setRemoteRepositories(repos);
buildingRequest.setPluginArtifactRepositories(repos);
buildingRequest.setRepositoryMerging(RepositoryMerging.REQUEST_DOMINANT);
DefaultRepositorySystemSession repositorySession = new DefaultRepositorySystemSession();
repositorySession.setLocalRepositoryManager(new SimpleLocalRepositoryManagerFactory()
.newInstance(repositorySession, new LocalRepository(localRepository.getBasedir())));
buildingRequest.setRepositorySession(repositorySession);
buildingRequest.addProfile(profile);
buildingRequest.setActiveProfileIds(Collections.singletonList(profile.getId()));
buildingRequest.setResolveDependencies(true);
List<ProjectBuildingResult> buildingResults =
projectBuilder.build(Collections.singletonList(projectFile.toFile()), true, buildingRequest);
List<MavenProject> reactorProjects = new ArrayList<>();
for (ProjectBuildingResult buildingResult : buildingResults) {
reactorProjects.add(buildingResult.getProject());
}
WorkspaceReader simpleReactorReader = new SimpleReactorWorkspaceReader(reactorProjects);
repositorySession.setWorkspaceReader(simpleReactorReader);
ProjectSorter sorter = new ProjectSorter(reactorProjects);
reactorProjects = sorter.getSortedProjects();
List<MavenProject> resolvedProjects = new ArrayList<>(reactorProjects.size());
for (MavenProject project : reactorProjects) {
MavenProject resolvedProject =
projectBuilder.build(project.getFile(), buildingRequest).getProject();
// from LifecycleDependencyResolver
if (resolvedProject.getDependencyArtifacts() == null) {
try {
resolvedProject.setDependencyArtifacts(
resolvedProject.createArtifacts(artifactFactory, null, null));
} catch (InvalidDependencyVersionException e) {
throw new LifecycleExecutionException(e);
}
}
// TODO .... understand why this is working ... :-)
// why projectBuilder doesn't resolve and set in proper way DependencyArtifacts and Artifacts
if (resolvedProject.getDependencyArtifacts().size()
>= resolvedProject.getArtifacts().size()
&& resolvedProject.getDependencyArtifacts().stream().noneMatch(a -> a.getVersion() == null)) {
resolvedProject.setArtifacts(resolvedProject.getDependencyArtifacts());
}
resolvedProjects.add(resolvedProject);
}
return resolvedProjects;
}
from org.apache.maven.shared.release.phase.AbstractReleaseTestCase.
I am down to

|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
I think I have found it, stay put...
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
|
Resolution problem is gone, but still for some reason junit is added as a test dep to subproject2 which does not make sense...
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
michael-o
changed the title
[MRELEASE-1144] Upgrade to Parent 42 and Maven 3.6.3
[MRELEASE-1144] Upgrade to Parent 42
Jun 9, 2024
|
Maven upgrade will be handled separately
|
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Sorry, something went wrong.
Uh oh!
There was an error while loading. Please reload this page.
Reviewers
cstamas
Awaiting requested review from cstamas
Uh oh!
There was an error while loading. Please reload this page.
Assignees
No one assigned
Milestone
No milestone
Development
Successfully merging this pull request may close these issues.
Uh oh!
There was an error while loading. Please reload this page.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
|