maven-site-plugin
maven-site-plugin copied to clipboard
[MSITE-1033] Improve heuristics to detect inheritance for SCM site URLs
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
[MSITE-XXX] - Fixes bug in ApproximateQuantiles, where you replaceMSITE-XXXwith 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 verifyto make sure basic checks pass. A more thorough check will be performed on your pull request automatically. - [ ] You have run the integration tests successfully (
mvn -Prun-its clean verify).
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.
I still need to look into the failing IT:
Running post-build script: /home/runner/work/maven-site-plugin/maven-site-plugin/target/it/site-inheritance/verify.bsh
staged moduleDirectory index.html has wrong links!
staged subModuleDirectory is missing or not a directory.
incorrect index file in staged subModuleDirectory!
java.nio.file.NoSuchFileException: /home/runner/work/maven-site-plugin/maven-site-plugin/target/it/site-inheritance/webhost.company.com/stage/www/website/sub_module/index.html
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:92)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
at java.base/sun.nio.fs.UnixFileSystemProvider.newByteChannel(UnixFileSystemProvider.java:218)
at java.base/java.nio.file.Files.newByteChannel(Files.java:380)
at java.base/java.nio.file.Files.newByteChannel(Files.java:432)
at java.base/java.nio.file.Files.readAllBytes(Files.java:3288)
at java.base/java.nio.file.Files.readString(Files.java:3366)
at org.codehaus.plexus.util.BaseFileUtils.fileRead(BaseFileUtils.java:17)
at org.codehaus.plexus.util.FileUtils.fileRead(FileUtils.java:322)
at jdk.internal.reflect.GeneratedMethodAccessor46.invoke(Unknown Source)
at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.base/java.lang.reflect.Method.invoke(Method.java:569)
at bsh.Reflect.invokeMethod(Reflect.java:131)
at bsh.Reflect.invokeStaticMethod(Reflect.java:95)
at bsh.Name.invokeMethod(Name.java:793)
at bsh.BSHMethodInvocation.eval(BSHMethodInvocation.java:69)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:96)
at bsh.BSHPrimaryExpression.eval(BSHPrimaryExpression.java:41)
at bsh.BSHAssignment.eval(BSHAssignment.java:71)
at bsh.BSHBlock.evalBlock(BSHBlock.java:125)
at bsh.BSHBlock.eval(BSHBlock.java:75)
at bsh.BSHBlock.eval(BSHBlock.java:41)
at bsh.BSHTryStatement.eval(BSHTryStatement.java:80)
at bsh.Interpreter.eval(Interpreter.java:659)
at bsh.Interpreter.eval(Interpreter.java:750)
at bsh.Interpreter.eval(Interpreter.java:739)
at org.apache.maven.shared.scriptinterpreter.BeanShellScriptInterpreter.evaluateScript(BeanShellScriptInterpreter.java:145)
at org.apache.maven.shared.scriptinterpreter.ScriptRunner.executeRun(ScriptRunner.java:222)
at org.apache.maven.shared.scriptinterpreter.ScriptRunner.run(ScriptRunner.java:158)
at org.apache.maven.plugins.invoker.AbstractInvokerMojo.runPostBuildHook(AbstractInvokerMojo.java:1957)
at org.apache.maven.plugins.invoker.AbstractInvokerMojo.runBuild(AbstractInvokerMojo.java:1914)
at org.apache.maven.plugins.invoker.AbstractInvokerMojo.runBuild(AbstractInvokerMojo.java:1584)
at org.apache.maven.plugins.invoker.AbstractInvokerMojo.lambda$runBuilds$4(AbstractInvokerMojo.java:1346)
at org.apache.maven.plugins.invoker.JobExecutor.lambda$forEach$0(JobExecutor.java:63)
at java.base/java.util.concurrent.FutureTask.run(FutureTask.java:264)
at java.base/java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1136)
at java.base/java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:635)
at java.base/java.lang.Thread.run(Thread.java:840)
Finished post-build script: /home/runner/work/maven-site-plugin/maven-site-plugin/target/it/site-inheritance/verify.bsh
*** end build.log for: site-inheritance/pom.xml ***
Update: Debugging revealed the following distributionMgmt.site.url being used for it/site-inheritance/module and it/site-inheritance-submodule:
target/it/site-inheritance/webhost.company.com/deploy/www/website/moduletarget/it/site-inheritance/webhost.company.com/deploy/www/website/sub_module
So in fact those are siblings not nested, seems that the inheritance works a bit differently than outlined in https://maven.apache.org/ref/3-LATEST/maven-model-builder/ (compare with https://maven.apache.org/ref/3-LATEST/maven-model-builder/xref/org/apache/maven/model/inheritance/DefaultInheritanceAssembler.html#L95).
I would argue the expected behaviour is wrong and submodule should not end up below module but next to it!
Resolve #1159