Skip to content

[MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport#158

Merged
cstamas merged 14 commits intomasterfrom
mng-7470-resolver-transport
May 11, 2022
Merged

[MNG-7470] mvn 3.9+ IT that uses wagon (default) and native transport#158
cstamas merged 14 commits intomasterfrom
mng-7470-resolver-transport

Conversation

@cstamas
Copy link
Copy Markdown
Member

@cstamas cstamas commented May 11, 2022

An IT for Maven 3.9+ that "exercise" both resolver transport: wagon and native (so we have 2 tests both forcing transport with -Dmaven.resolver.transport one wagon (which is default, but setting is there to be explicit) and once native.

It builds a project that needs a plugin (to pull it will use set transport), and that plugin will use resolver as well to resolve set artifact. If any of these fails, maven project fails.

Current maven 3.9.x build will FAIL due NoSuchMethod error, as expected.

With PR apache/maven#732

Bootstrap.Bootstrap()........................................ OK (3.1 s)
mng7470 ResolverTransport.ResolverTransportNative().......... 3332 [main] INFO org.eclipse.jetty.server.Server - jetty-9.0.4.v20130625
3397 [main] INFO org.eclipse.jetty.server.ServerConnector - Started ServerConnector@6032d904{HTTP/1.1}{0.0.0.0:34895}
OK (1.7 s)
mng7470 ResolverTransport.ResolverTransportWagon()........... OK (1.6 s)

@cstamas cstamas requested review from gnodet and michael-o May 11, 2022 08:31
@cstamas cstamas self-assigned this May 11, 2022
Copy link
Copy Markdown
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Where is the verification that the transport actually works, i.e., the right one is picked?

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

Where is the verification that the transport actually works, i.e., the right one is picked?

Maven build fails if project deps cannot be resolved... is that what you asking?

@michael-o
Copy link
Copy Markdown
Member

Where is the verification that the transport actually works, i.e., the right one is picked?

Maven build fails if project deps cannot be resolved... is that what you asking?

Yes, this is what I will look for. Can you add this as a comment to the tests. It is not obvious from the code itself.

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

Yes, this is what I will look for. Can you add this as a comment to the tests. It is not obvious from the code itself.

Done.

@michael-o michael-o self-requested a review May 11, 2022 08:45
@michael-o
Copy link
Copy Markdown
Member

Testing...

@slawekjaranowski slawekjaranowski self-requested a review May 11, 2022 08:50
@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

Do not merge pls, I'll do myself once done

@michael-o
Copy link
Copy Markdown
Member

[INFO] Downloading from maven-core-it: http://localhost:53770/org/apache/maven/its/resolver-transport/wagon/dependency/1.0/dependency-1.0.pom
[WARNING] Checksum validation failed, expected '97641443fee307b6c3593080be865df89ace3d86' (REMOTE_EXTERNAL) but is actually 'cd16a85341375c7f9dda5edd75dedb83e213e425' from maven-core-it for http://localhost:53770/org/apache/maven/its/resolver-transport/wagon/dependency/1.0/dependency-1.0.pom

@michael-o
Copy link
Copy Markdown
Member

On

Java version: 1.8.0_322, vendor: OpenJDK BSD Porting Team, runtime: /usr/local/openjdk8/jre
Default locale: de_DE, platform encoding: UTF-8
OS name: "freebsd", version: "12.3-stable", arch: "amd64", family: "unix"

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

@michael-o @slawekjaranowski so pushed all I wanted, and locally tested, updated description.

@michael-o
Copy link
Copy Markdown
Member

Will test again...

Copy link
Copy Markdown
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In both tests I see in logs ..

[DEBUG] Using transporter WagonTransporter ...

Is it ok?

@slawekjaranowski
Copy link
Copy Markdown
Member

We should also check what happens if wrong transport will be provided, like maven.resolver.transport=xxx
We will be sure that property is used at all

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

Is it ok?

That should not happen, especially as now assertion to debug log is added. Did you return the removed line?

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

We should also check what happens if wrong transport will be provided, like maven.resolver.transport=xxx We will be sure that property is used at all

IMHO, this is not a UT, this IT merely ensures that selected transport IS used and WORKS.

@slawekjaranowski
Copy link
Copy Markdown
Member

Now i have ...

Caused by: java.lang.NoSuchMethodError: org.eclipse.aether.spi.connector.layout.RepositoryLayout.getChecksums(Lorg/eclipse/aether/artifact/Artifact;ZLjava/net/URI;)Ljava/util/List;
    at org.eclipse.aether.connector.basic.BasicRepositoryConnector.get (BasicRepositoryConnector.java:257)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.performDownloads (DefaultArtifactResolver.java:520)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolve (DefaultArtifactResolver.java:408)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifacts (DefaultArtifactResolver.java:235)
    at org.eclipse.aether.internal.impl.DefaultArtifactResolver.resolveArtifact (DefaultArtifactResolver.java:212)
    at org.eclipse.aether.internal.impl.DefaultRepositorySystem.resolveArtifact (DefaultRepositorySystem.java:272)
    at org.apache.maven.resolver.examples.maven.ResolveArtifactMojo.execute (ResolveArtifactMojo.java:98)

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

@slawekjaranowski cool, that's expected with latest maven 3.9.x build, as it uses resolver 1.8.0 but has no fix in apache/maven#732 Now, to verify, build locally that PR and run ITs with it, and they should all pass OK

@slawekjaranowski
Copy link
Copy Markdown
Member

Both tests use the same project directory .... pleas add

verifier.setLogFileName( ... );

without it we have logs in file log.txt which content logs from last executed test

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

Both tests use the same project directory .... pleas add

verifier.setLogFileName( ... );

without it we have logs in file log.txt which content logs from last executed test

fixed

@cstamas cstamas mentioned this pull request May 11, 2022
Copy link
Copy Markdown
Member

@slawekjaranowski slawekjaranowski left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  • build pass
  • assertions works

Copy link
Copy Markdown
Member

@michael-o michael-o left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I am quite surprised that Jetty output is visible, MNG-5771 has a Jetty-based test as well, but no output is seen. Any idea? I do not see any diff in the source code.

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

Fix merged, so the IT can be as well....

@cstamas cstamas requested a review from michael-o May 11, 2022 17:19
@michael-o
Copy link
Copy Markdown
Member

Still testing...

@michael-o
Copy link
Copy Markdown
Member

Works for me now except for the JEtty log output which I don't understand....

@cstamas
Copy link
Copy Markdown
Member Author

cstamas commented May 11, 2022

apache/maven#732 is merged, so am merging this one as well (ongoing branches not having merged PR will fail here)

@cstamas cstamas merged commit 8c9cb88 into master May 11, 2022
@cstamas cstamas deleted the mng-7470-resolver-transport branch May 11, 2022 20:59
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants