我在运行Magnolia空webapp项目时遇到了很多麻烦,所有这些都与Maven依赖项有关。这似乎是的一个极端情况。如果你给一个鼠标一个cookie ,因为每次我添加一个必需的依赖项时,它会抛出一个异常,要求另一个,它永远不够。
我一直在尝试关注this guide,它开始使用Maven原型命令,所以它不是从头开始。问题是指南已经写了一段时间,所以版本号从那时起发生了很大的变化,似乎最新的版本与它们自身并不兼容。
这是我的 acme-project-webapp / pom.xml 文件的样子:
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.acme</groupId>
<artifactId>acme-project</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>acme-project-webapp</artifactId>
<name>Acme Project: webapp</name>
<packaging>war</packaging>
<repositories>
<repository>
<id>magnolia-repo</id>
<name>Magnolia Repository</name>
<url>https://nexus.magnolia-cms.com</url>
</repository>
</repositories>
<dependencies>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-empty-webapp</artifactId>
<type>pom</type>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-empty-webapp</artifactId>
<type>war</type>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-standard-templating-kit</artifactId>
<version>2.9</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-dms</artifactId>
<version>1.6.9</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-fckeditor</artifactId>
<version>4.4.2</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-mail</artifactId>
<version>5.2.2</version>
</dependency>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-imaging-support</artifactId>
<version>3.2</version>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-war-plugin</artifactId>
<configuration>
<dependentWarExcludes>WEB-INF/lib/*.jar</dependentWarExcludes>
</configuration>
</plugin>
</plugins>
</build>
</project>
当我尝试运行项目时,我收到了大量异常消息。这就是他们所说的:
检查Magnolia模块依赖项(即META-INF / magnolia / my-module.xml中的那些)时发现以下异常: 模块Magnolia JSP模板支持模块(版本5.4.0)依赖于模板(版本5.3 / *),但目前安装了Magnolia模板模块(版本4.4.2)。
模块Magnolia RSS聚合器模块(版本2.4.0)依赖于调度程序(版本2.2 / *),但目前安装了Magnolia调度程序模块(版本2.1.1)。
模块Magnolia RSS聚合器模块(版本2.4.0)依赖于mte(版本0.5 / *),但未找到。
模块Magnolia DMS模块(版本1.6.9)依赖于adminInterface(版本4.5.8 / *),但目前安装了Magnolia管理界面模块(版本4.4.2)。
模块Magnolia DMS模块(版本1.6.9)依赖于fckEditor(版本4.5.8 / *),但目前安装了Magnolia FCKEditor模块(版本4.4.2)。
模块Magnolia DAM Templating(版本2.1.0)依赖于模板(版本5.4 / * - 可选),但目前安装了Magnolia Templating Module(版本4.4.2)。
模块Magnolia标准模板套件模块(版本2.9.0)取决于模板(版本5.3 / *),但目前安装了Magnolia模板模块(版本4.4.2)。
模块Magnolia标准模板套件模块(版本2.9.0)依赖于adminInterface(版本5.2 / *),但目前安装了Magnolia管理界面模块(版本4.4.2)。
模块就地模板模块(版本2.4.0)取决于模板(版本5.4 / *),但目前安装了Magnolia模板模块(版本4.4.2)。
模块Magnolia公共用户注册模块(版本2.4.3)依赖于模板(版本5.3 / *),但目前安装了Magnolia模板模块(版本4.4.2)。
模块Magnolia 4.5迁移模块(版本1.2.4)依赖于adminInterface(版本4.5.10 / *),但目前安装了Magnolia管理界面模块(版本4.4.2)。
模块Magnolia资源模块(版本2.4.0)依赖于模板(版本5.4 / *),但目前安装了Magnolia模板模块(版本4.4.2)。
模块Magnolia模块论坛(版本3.4.6)依赖于adminInterface(版本5.0.2 / *),但目前安装了Magnolia管理界面模块(版本4.4.2)。
模块Magnolia Site Module(版本1.0.0)依赖于模板(版本5.4 / *),但目前安装了Magnolia Templating Module(版本4.4.2)。
模块Magnolia表单模块(版本2.2.12)依赖于模板(版本5.2.2 / *),但目前安装了Magnolia模板模块(版本4.4.2)。
起初我会收到消息说没有找到依赖项(除了版本不匹配),所以每当我看到那些,我会尝试逐个添加缺少的依赖项。但它已经是一个长长的兔子洞,我一直在摔倒。
从根本上说,我并不真正关心它似乎需要的所有这些嵌套依赖项;我真正想要的是使用标准模板工具包运行,并且一旦使用了Jackrabbit持久性管理器(因此我可以使用MySQL)。为什么这么难以开箱即用?我怎么能在第一时间运行它?
编辑:这是父POM文件。
<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.acme</groupId>
<artifactId>acme-project</artifactId>
<name>Acme Project (parent pom)</name>
<version>1.0-SNAPSHOT</version>
<packaging>pom</packaging>
<properties>
<magnoliaVersion>5.4</magnoliaVersion>
<javaVersion>1.6</javaVersion>
</properties>
<scm>
<connection/>
<developerConnection/>
<url/>
</scm>
<dependencyManagement>
<dependencies>
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-project</artifactId>
<version>${magnoliaVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>info.magnolia.ui</groupId>
<artifactId>magnolia-ui-project</artifactId>
<version>${magnoliaVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<dependency>
<groupId>info.magnolia.bundle</groupId>
<artifactId>magnolia-bundle-parent</artifactId>
<version>${magnoliaVersion}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
<!-- TEST -->
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.11</version>
<scope>test</scope>
</dependency>
</dependencies>
</dependencyManagement>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>2.3.2</version>
<configuration>
<source>${javaVersion}</source>
<target>${javaVersion}</target>
</configuration>
</plugin>
</plugins>
<resources>
<resource>
<directory>src/main/resources</directory>
<includes>
<include>**/*</include>
</includes>
</resource>
<resource>
<filtering>true</filtering>
<directory>src/main/resources</directory>
<includes>
<include>META-INF/magnolia/*</include>
</includes>
</resource>
</resources>
</build>
<repositories>
<repository>
<id>magnolia.public</id>
<url>https://nexus.magnolia-cms.com/content/groups/public</url>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
<repository>
<id>vaadin-addons</id>
<url>https://maven.vaadin.com/vaadin-addons</url>
</repository>
</repositories>
<modules>
<module>acme-project-webapp</module>
</modules>
</project>
答案 0 :(得分:0)
好的,在将pom.xml文件加载到Eclips后,我终于看到了问题:你已经添加了magnolia-module-dms
和magnolia-module-fckeditor
依赖项,但这些是针对Magnolia 4.x的,而不是5.x系列 - 他们拖延了相关模块的过时版本。
删除这些依赖项 - 您不需要它们。 DMS模块已被DAM模块替换(您将其作为STK模块的子依赖项),并且不再使用FCK编辑器。
答案 1 :(得分:0)
对于 Magnolia版本5.4 ,请依赖主题模块中的 pom.xml 文件
<dependency>
<groupId>info.magnolia</groupId>
<artifactId>magnolia-module-legacy-admininterface</artifactId>
<version>5.3</version>
</dependency>
请参阅https://documentation.magnolia-cms.com/display/DOCS/AdminInterface+module
了解详情此致