-
Notifications
You must be signed in to change notification settings - Fork 15
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
plugins not fetched #23
Comments
Thanks for the report. I was able to reproduce the issue. I will look into at as soon as I have time. |
I have the same issue, with a different plugin. I reference it in the pom under
<properties>
<maven-clean-plugin.version>3.1.0</maven-clean-plugin.version>
<go-offline-maven-plugin.version>1.2.5</go-offline-maven-plugin.version>
</properties>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
</plugin>
<plugin>
<groupId>de.qaware.maven</groupId>
<artifactId>go-offline-maven-plugin</artifactId>
<version>${go-offline-maven-plugin.version}</version>
<configuration>
<dynamicDependencies>
<dynamicDependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-clean-plugin</artifactId>
<version>${maven-clean-plugin.version}</version>
<repositoryType>PLUGIN</repositoryType>
</dynamicDependency>
</dynamicDependencies>
</configuration>
</plugin>
</plugins>
</build> mvn de.qaware.maven:go-offline-maven-plugin:resolve-dependencies -Dmaven.repo.local=./binaries For some reason it downloaded the version Edit: My actual usecase is a quite complex multi-module setup including parent pom's defining the go-offline-maven-plugin and all other plugins. So each of the sub-modules is "going offline" one by one, all into the same repository. The child poms are very sparse compared to the shared parent pom. |
As a workaround I "went offline" by deleting my local repository, building my project and saving the resulting local repository. The issue was that empty aggregator poms, not defining anything beside child modules, still required some plugins that were not downloaded. Ensuring that even aggregator poms define all the same plugins resolved this issue for me. I have yet to try the |
I have identified the issue: The plugin filters duplicate Plugins before fetching. Unfortunately, if a plugin was defined multiple times with different versions, all but the first version was filtered. Different sections of the same plugin where also ignored. |
After building and running the current SNAPSHOT version for winery with [INFO] --- go-offline-maven-plugin:1.2.8-SNAPSHOT:resolve-dependencies (default-cli) @ winery --- Don't know is that bad or not. Investigating in the dependency tree built with |
When executing winery build after that with [ERROR] Failed to execute goal org.web3j:web3j-maven-plugin:4.2.0:generate-sources (generate-sources) on project org.eclipse.winery.accountability: Execution generate-sources of goal org.web3j:web3j-maven-plugin:4.2.0:generate-sources failed: Plugin org.web3j:web3j-maven-plugin:4.2.0 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.ethereum:solcJ-all:jar:0.4.25 has not been downloaded from it before. -> [Help 1]
|
When repeating the experiment with fresh maven repo specified through -Dmaven.repo.local=/some/dir//winery-m2-repo, the resolve-dependencies succeeds with the same ERROR and WARNING, but the offline build fails earlier: [ERROR] Failed to execute goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test (default-test) on project org.eclipse.winery.model.tosca: Execution default-test of goal org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4:test failed: Plugin org.apache.maven.plugins:maven-surefire-plugin:3.0.0-M4 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.codehaus.plexus:plexus-utils:jar:1.1 has not been downloaded from it before. -> [Help 1]
|
@Theoderich , thank you for addressing the issue, some problem seems to remain, sorry. How do you think, why it is so difficult to fetch exactly those dependencies as used during real build? Is it some unfortunate maven architecture? Ideally the go-offline would execute exactly the same procedure normal maven build uses, instead of replicating the logic. |
Unfortunately I know of no way to dry-run the maven build. In the end there will never be a "perfect" solution to this problem unless the maven core team addresses it. As it is now, plugins can just dynamicaly load other plugins in their code without ever declaring it in their pom. I see no way to solve that with a plugin |
Yes, I faced several problems with the official dependency plugin go-offline functionality, and when wanted to report it to the plugin jira found many similar tickets already reported, one of them suggesting to use the go-offline plugin instead. |
It seems this issue is not limited to Plugins, but to all dependencies - I have a multimodule project with dependencyManagement defined in root POM and one of the modules overrides some dependency versions. After running |
Plugins seem to be not fetched at all.
I've tried on two projects: https://github.com/redisson/redisson and https://github.com/eclipse/winery.
After successfully completing the resolve-dependencies, their build in offline mode fails.
For redisson:
[ERROR] Plugin org.apache.maven.plugins:maven-surefire-plugin:2.12.4 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-surefire-plugin:jar:2.12.4 has not been downloaded from it before. -> [Help 1]
For winery:
[ERROR] Plugin org.apache.maven.plugins:maven-jar-plugin:3.0.0 or one of its dependencies could not be resolved: Cannot access central (https://repo.maven.apache.org/maven2) in offline mode and the artifact org.apache.maven.plugins:maven-jar-plugin:jar:3.0.0 has not been downloaded from it before. -> [Help 1]
These plugins are not dynamic dependencies, they are directly mentioned in the build -> plugins sections of the corresponding projects.
The text was updated successfully, but these errors were encountered: