问题
I am trying to build the demo application explained in https://documentation.magnolia-cms.com/display/DOCS/Travel+Demo+-+for+developers
I am getting following dependency issue.
Downloading: https://repo.maven.apache.org/maven2/info/magnolia/maven/plugins/magnolia-setproperty-maven-plugin/1.2.1/magnolia-setproperty-maven-plugin-1.2.1.pom
[WARNING] The POM for info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:jar:1.2.1 is missing, no dependency information available
Downloading: https://repo.maven.apache.org/maven2/info/magnolia/maven/plugins/magnolia-setproperty-maven-plugin/1.2.1/magnolia-setproperty-maven-plugin-1.2.1.jar
[INFO] ------------------------------------------------------------------------
[INFO] Reactor Summary:
[INFO]
[INFO] Magnolia Travel Demo (parent pom) .................. FAILURE [ 2.141 s]
[INFO] Magnolia Travel Demo Module ........................ SKIPPED
[INFO] Magnolia Travel Tours Module ....................... SKIPPED
[INFO] Magnolia Demo Projects Reactor ..................... SKIPPED
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.366 s
[INFO] Finished at: 2016-03-28T13:02:23+13:00
[INFO] Final Memory: 11M/245M
[INFO] ------------------------------------------------------------------------
[ERROR] Plugin info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1 or one of its dependencies could not be resolved: Could not find artifact info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:jar:1.2.1 in central (https://repo.maven.apache.org/maven2) -> [Help 1]
[ERROR]
Please note Magnolia repo is already added and artifacts are already downloaded from the Magnolia repository, this is not due to Magnolia repo is not added. for some reason it's not trying to download from Magnolia repo, probably mvn tries to download from that first then trying mvn public repo due to some issue on Magnolia repo, Can some one help me to identify what's wrong ?
But this jar is available on Magnolia repo and I have downloaded the jar and installed manually, then I am getting following error,
[ERROR] Failed to execute goal info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1:set-property (currentDate) on project magnolia-travel-demo-parent: Execution currentDate of goal info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1:set-property failed: A required class was missing while executing info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1:set-property: org/apache/commons/lang/StringUtils
[ERROR] -----------------------------------------------------
[ERROR] realm = plugin>info.magnolia.maven.plugins:magnolia-setproperty-maven-plugin:1.2.1
[ERROR] strategy = org.codehaus.plexus.classworlds.strategy.SelfFirstStrategy
[ERROR] urls[0] = file:/C:/software-install/repo/info/magnolia/maven/plugins/magnolia-setproperty-maven-plugin/1.2.1/magnolia-setproperty-maven-plugin-1.2.1.jar
[ERROR] urls[1] = file:/C:/software-install/repo/org/codehaus/plexus/plexus-utils/1.1/plexus-utils-1.1.jar
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[maven.api, parent: null]]
[ERROR]
[ERROR] -----------------------------------------------------: org.apache.commons.lang.StringUtils
[ERROR] -> [Help 1]
回答1:
Not that you want to hear it, but I suspect that it is indeed a repo problem. You have set repository for normal artifacts, but what you are missing is that what maven is trying to download is plugin.
Look at Maven docu on how to setup plugin repo in your settings.xml, e.g. here (with the slight difference that you want releases and not snapshots).
Also, you might want to check note from Mathias at the bottom of Magnolia Maven setup guide
HTH,
Jan
来源:https://stackoverflow.com/questions/36368406/magnolia-demo-project-mvn-build-failed-due-to-not-able-to-fetch-magnolia-setprop