GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — [MRELEASE-1144] Upgrade to Parent 42 by michael-o · Pull Request #216 · apache/maven-release

Conversation

@michael-o

@michael-o michael-o commented Jun 8, 2024

Copy link
Copy Markdown
Member

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.

  • I hereby declare this contribution to be licenced under the Apache License Version 2.0, January 2004

  • In any other case, please file an Apache Individual Contributor License Agreement.

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

All reactions
@michael-o
michael-o requested review from slachiewicz and slawekjaranowski June 8, 2024 21:51
asfgit pushed a commit that referenced this pull request Jun 8, 2024
@michael-o
[MRELEASE-1144] Upgrade to Parent 42 and Maven 3.6.3
79cdda1
This closes #216
@asfgit
asfgit force-pushed the MRELEASE-1144 branch from 05a44d8 to 79cdda1 Compare June 8, 2024 22:08
@michael-o

michael-o commented Jun 8, 2024

Copy link
Copy Markdown
Member Author

@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
grafik

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michael-o

michael-o commented Jun 8, 2024

Copy link
Copy Markdown
Member Author

I think I have found it, stay put...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michael-o
michael-o requested a review from cstamas June 9, 2024 00:58
@michael-o

michael-o commented Jun 9, 2024

Copy link
Copy Markdown
Member Author

Resolution problem is gone, but still for some reason junit is added as a test dep to subproject2 which does not make sense...

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asfgit
asfgit force-pushed the MRELEASE-1144 branch from f48e1c1 to 9df1b7a Compare June 9, 2024 01:01
asfgit pushed a commit that referenced this pull request Jun 9, 2024
@michael-o
[MRELEASE-1144] Upgrade to Parent 42
e5cf344
This closes #216
@asfgit
asfgit force-pushed the MRELEASE-1144 branch from 9df1b7a to e5cf344 Compare June 9, 2024 12:51
@michael-o 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
@michael-o

michael-o commented Jun 9, 2024

Copy link
Copy Markdown
Member Author

Maven upgrade will be handled separately

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@michael-o
[MRELEASE-1144] Upgrade to Parent 42
2142c9e
This closes #216
@asfgit
asfgit force-pushed the MRELEASE-1144 branch from e5cf344 to 2142c9e Compare June 9, 2024 19:02
@michael-o

michael-o commented Jun 9, 2024

Copy link
Copy Markdown
Member Author

Moved partially to #217.

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

@asfgit
asfgit merged commit 2142c9e into master Jun 9, 2024
@michael-o
michael-o deleted the MRELEASE-1144 branch June 9, 2024 19:29
@slawekjaranowski slawekjaranowski added the dependencies Pull requests that update a dependency file label Jun 16, 2024
@jira-importer

jira-importer commented Jun 20, 2025

Copy link
Copy Markdown

Resolve #1320

All reactions

Sorry, something went wrong.

Uh oh!

There was an error while loading. Please reload this page.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@slawekjaranowski slawekjaranowski Awaiting requested review from slawekjaranowski
@slachiewicz slachiewicz Awaiting requested review from slachiewicz
@cstamas cstamas Awaiting requested review from cstamas

Uh oh!

There was an error while loading. Please reload this page.

Assignees

No one assigned

Labels

dependencies Pull requests that update a dependency file

Projects

None yet

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.

4 participants

@michael-o @jira-importer @asfgit @slawekjaranowski
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.
You are visitor 01402775 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.