我跟踪了旅行演示-供开发人员使用,并设法启动了旅行演示。现在,我正在尝试自定义模板(ftl)上的玉兰花-旅游旅游。
我已经注意到,对模板的更改不会被拾取。看起来,由于我没有指定版本号时,我包括作为我的网页应用程序的依赖,新的副本演示下载时,我正在构建木兰网站应用程序。我就是这样把依赖放在一起的
<?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.esharps.projects</groupId>
<artifactId>coreCMSProject</artifactId>
<version>1.0-SNAPSHOT</version>
<relativePath>../pom.xml</relativePath>
</parent>
<artifactId>coreCMSProject-webapp</artifactId>
<name>coreCMSProject: webapp</name>
<packaging>war</packaging>
<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.demo</groupId>
<artifactId>magnolia-travel-tours</artifactId>
</dependency>如果我的理解有误,请纠正我。
现在我所做的就是,我给出了玉兰花旅游旅游的版本号和组ID,并重建了玉兰花旅游旅游游(必须指定木兰旅游演示模块的版本号),并在我的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>info.magnolia.demo</groupId>
<artifactId>magnolia-travel-demo-parent</artifactId>
<version>0.11-SNAPSHOT</version>
<relativePath>../magnolia-travel-demo-parent/pom.xml</relativePath>
</parent>
**<groupId>info.magnolia.demo</groupId>**
<artifactId>magnolia-travel-tours</artifactId>
<packaging>jar</packaging>
**<version>0.11-CUSTOM</version>**
<name>Magnolia Travel Tours Module</name>
<description>Magnolia module showcasing a travel-tours website</description>
<properties>
<cloverCoverageThreshold>37</cloverCoverageThreshold>
</properties>
<dependencies>
<!-- Dependencies to travel-demo -->
<dependency>
<groupId>info.magnolia.demo</groupId>
<artifactId>magnolia-travel-demo</artifactId>
<version>**0.11-SNAPSHOT**</version>
</dependency>现在的问题是,当我试图启动这个web应用程序时,我会出现以下错误。
2016-04-22 02:33:54,906 ERROR info.magnolia.init.MagnoliaServletContextListener : Oops, Magnolia could not be started
info.magnolia.module.model.reader.ModuleDependencyException: The following exceptions were found while checking Magnolia modules dependencies (i.e. those in META-INF/magnolia/my-module.xml):
Module Magnolia Travel Tours Module (version 0.11.0-CUSTOM) is dependent on travel-demo (version 0.11-CUSTOM), but Magnolia Travel Demo Module (version 0.10.0) is currently installed.
Module Magnolia Travel Tours Module (version 0.11.0-CUSTOM) is dependent on mtk (version 0.10/*), but Magnolia Templating Kit (version 0.9.0) is currently installed.
info.magnolia.module.model.reader.ModuleDependencyException: The following exceptions were found while checking Magnolia modules dependencies (i.e. those in META-INF/magnolia/my-module.xml):我应该如何定制旅行演示?
发布于 2016-04-21 17:12:23
似乎你在尝试自定义旅行演示,而不改变你正在部署的web应用程序中的依赖性。我假设您有正在使用的IDE。然后,我会检查我想要部署的demo应用程序,然后在它的pom中,我将更改旅行演示依赖项,这将指向我的自定义旅行演示。这里的错误是您导入了空的webapp,但是它在那个时候已经构建好了,所以您的更改在那个时候不会被捕获。
请看一下
<!-- 1. Import dependency management from one of our parent poms (bundles or packs) -->
<dependency>
<!-- CE bundle -->
<groupId>info.magnolia.bundle</groupId>
<artifactId>magnolia-bundle-parent</artifactId>
<version>${magnoliaVersion}</version>
<scope>import</scope>
<type>pom</type>
</dependency>
<!-- 2. Own modules -->
<dependency>
<groupId>info.magnolia.dev</groupId>
<artifactId>magnolia-dev-webapp</artifactId>
<version>${project.version}</version>
</dependency>
<!-- 3. Version overrides for modules in this project -->
<!--<dependency>-->
<!--<groupId>info.magnolia.contacts</groupId>-->
<!--<artifactId>magnolia-contacts</artifactId>-->
<!--<version>${contactsVersion}</version>-->
<!--</dependency>-->
</dependencies>
</dependencyManagement>
<build>
<pluginManagement>
<plugins>
<!-- animal-sniffer doesn't support java 1.8 yet -->
<plugin>
<groupId>org.codehaus.mojo</groupId>
<artifactId>animal-sniffer-maven-plugin</artifactId>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
</project>基本上,这个开发项目包含一个您可以部署的web应用程序,并且您可以在那里更改任何依赖项。对其进行了深入的注释,因此使用它将是微不足道的。最后,您必须部署开发项目的war。
干杯,
https://stackoverflow.com/questions/36773291
复制相似问题