Skip to content

Conversation

@Marcono1234
Copy link

Depends on #496

Adds an integration test which uses a custom plugin repository.

def buildLogText = buildLog.getText()
// Should have downloaded artifact from custom repository, not from Central
// (requires running `mvn clean ...`)
assert buildLogText.contains('Downloaded from google: https://maven.google.com/com/android/tools/r8/2.0.98/r8-2.0.98.jar')
Copy link
Author

Choose a reason for hiding this comment

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

Is testing for the "Downloaded from ..." message here ok, or is that too brittle (e.g. when users don't run mvn clean ... or when this Maven message changes)?

Copy link
Member

Choose a reason for hiding this comment

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

It can occurs not every time ... when artifact will be cached in local repository we will not have such message

Next issue when we have a version in assertions, we will need update test when artifact will update

Copy link
Author

Choose a reason for hiding this comment

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

But for the integration tests it uses a separate local Maven repository (under target), right? And that is cleaned when running mvn clean ....

Copy link
Author

Choose a reason for hiding this comment

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

Have removed the check now. You are right, caching seems to be an issue with the current CI setup here.

@slawekjaranowski
Copy link
Member

I will try steps as:

  • new module in IT with simple class with Main method and with deploy to local directory - file protocol
  • in invoker.properties we can have many invocation so we can do like:
invoker.goals.1 = deploy
invoker.project.1 = test-module
  • next use remotePlugin point to local directory used in first step
  • do test
invoker.goals.2 = .... 

as idea to check

@slawekjaranowski
Copy link
Member

I will go with release a fix version, we can work on test later

@Marcono1234 Marcono1234 force-pushed the custom-plugin-repo-test branch from 7262c0d to f1417d3 Compare October 7, 2025 15:54
@Marcono1234
Copy link
Author

Have changed this IT now to use a custom local repository as you suggested. I hope that is what you had in mind. If not, please let me know, or feel free to close this PR.

To demonstrate that the bug fix on master makes a difference, I have kept it as separate merge commit here (though when merging this PR, feel free to squash of course).

Comment on lines +20 to +23
<id>custom-repo</id>
<!-- Note: On Windows using `project.basedir` includes backslashes in this URI, which is not ideal
but seems to work -->
<url>file:///${project.basedir}/custom-repo</url>
Copy link
Author

@Marcono1234 Marcono1234 Oct 7, 2025

Choose a reason for hiding this comment

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

For example, this leads to something like (note the \ in the path):

[INFO] Downloading from custom-repo: file:///C:\Users\...

I think technically this is not a valid file: URI, but it seems Maven / Java seems to accept it nonetheless.
Not sure how this can be easily solved. Using file:///./custom-repo did not seem to work, maybe because the working directory is actually in one of its parent dirs (or something was wrong with my test setup)?

@Marcono1234
Copy link
Author

@slawekjaranowski, what do you think about these changes?

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.

2 participants