You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@maven.apache.org by jglick <gi...@git.apache.org> on 2017/11/28 23:43:27 UTC

[GitHub] maven-integration-testing pull request #25: Importing a BOM works even when ...

GitHub user jglick opened a pull request:

    https://github.com/apache/maven-integration-testing/pull/25

    Importing a BOM works even when it has the same components in dep mgmt

    Does not correspond to any known bug, but it seems like a potentially unusual practice deserving of test coverage.
    
    @reviewbybees esp. @stephenc who wondered whether this actually works

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/jglick/maven-integration-testing cyclic-import-scope

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/maven-integration-testing/pull/25.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #25
    
----
commit 8b0ba74bf5c355713ca3727fc792e0b6d86c2a40
Author: Jesse Glick <jg...@cloudbees.com>
Date:   2017-11-28T23:39:16Z

    Demonstrating that importing a BOM works even when it declares those same components in dependency management.

----


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-integration-testing pull request #25: Importing a BOM works even when ...

Posted by jglick <gi...@git.apache.org>.
Github user jglick commented on a diff in the pull request:

    https://github.com/apache/maven-integration-testing/pull/25#discussion_r153657505
  
    --- Diff: core-it-suite/src/test/java/org/apache/maven/it/IntegrationTestSuite.java ---
    @@ -654,6 +654,7 @@ public static Test suite()
             suite.addTestSuite( MavenITmng0249ResolveDepsFromReactorTest.class );
             suite.addTestSuite( MavenITmng0187CollectedProjectsTest.class );
             suite.addTestSuite( MavenITmng0095ReactorFailureBehaviorTest.class );
    +        suite.addTestSuite( MavenIT0199CyclicImportScopeTest.class );
    --- End diff --
    
    Was unclear what the naming scheme was here, so I just made something up.


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-integration-testing issue #25: Importing a BOM works even when it has ...

Posted by reviewbybees <gi...@git.apache.org>.
Github user reviewbybees commented on the issue:

    https://github.com/apache/maven-integration-testing/pull/25
  
    This pull request originates from a [CloudBees](https://www.cloudbees.com/) employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see [this explanation](https://github.com/reviewbybees/about#about-reviewbybees).



---

[GitHub] maven-integration-testing pull request #25: Importing a BOM works even when ...

Posted by jglick <gi...@git.apache.org>.
Github user jglick commented on a diff in the pull request:

    https://github.com/apache/maven-integration-testing/pull/25#discussion_r153657657
  
    --- Diff: core-it-suite/src/test/java/org/apache/maven/it/MavenIT0199CyclicImportScopeTest.java ---
    @@ -0,0 +1,56 @@
    +package org.apache.maven.it;
    +
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +import java.io.File;
    +import org.apache.maven.it.util.ResourceExtractor;
    +
    +public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTestCase {
    +
    +    public MavenIT0199CyclicImportScopeTest() {
    +        super(ALL_MAVEN_VERSIONS);
    +    }
    +
    +    public void testit0199() throws Exception {
    +        // v1: parent not using BOM; explicit dep from componentB → componentA
    +        // v2: BOM introduced; componentB → componentA picks up implicit version 1 from main@v1
    +        // v3: components now inheriting indirectly from an older version of the BOM that includes them; componentB → componentA version overridden
    +        for (int i = 1; i <= 3; i++) {
    +            build("v" + i + "/parent", null);
    +            build("v" + i + "/componentA", "target/componentA-" + i + ".jar");
    +            build("v" + i + "/componentB", "target/componentB-" + i + ".jar");
    +            build("v" + i + "/main", "bundle/target/bundle-" + i + ".jar");
    +        }
    +    }
    +
    +    private void build(String module, String expectedArtifact) throws Exception {
    +        File testDir = ResourceExtractor.simpleExtractResources(getClass(), "/cyclic-import-scope");
    +        Verifier verifier = newVerifier(new File(testDir.getAbsolutePath(), module).getAbsolutePath());
    +        verifier.setAutoclean(false);
    +        verifier.deleteDirectory("target");
    +        verifier.executeGoal("install");
    --- End diff --
    
    Tested iteratively using
    
    ```sh
    rm -rfv repo/test
    mvn clean test -f core-it-suite -Prun-its -Dmaven.repo.local=`pwd`/repo -Dtest=org.apache.maven.it.MavenIT0199CyclicImportScopeTest
    ```


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org


[GitHub] maven-integration-testing pull request #25: Importing a BOM works even when ...

Posted by jglick <gi...@git.apache.org>.
Github user jglick commented on a diff in the pull request:

    https://github.com/apache/maven-integration-testing/pull/25#discussion_r153657727
  
    --- Diff: core-it-suite/src/test/java/org/apache/maven/it/MavenIT0199CyclicImportScopeTest.java ---
    @@ -0,0 +1,56 @@
    +package org.apache.maven.it;
    +
    +/*
    + * Licensed to the Apache Software Foundation (ASF) under one
    + * or more contributor license agreements.  See the NOTICE file
    + * distributed with this work for additional information
    + * regarding copyright ownership.  The ASF licenses this file
    + * to you 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.
    + */
    +
    +import java.io.File;
    +import org.apache.maven.it.util.ResourceExtractor;
    +
    +public class MavenIT0199CyclicImportScopeTest extends AbstractMavenIntegrationTestCase {
    +
    +    public MavenIT0199CyclicImportScopeTest() {
    +        super(ALL_MAVEN_VERSIONS);
    --- End diff --
    
    Well, tested against 3.5.2. Did not try running against, say, 2.x. Is there some automated process which does this?


---

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@maven.apache.org
For additional commands, e-mail: dev-help@maven.apache.org