【问题标题】:alfresco-maven-plugin; truezip issues to pre-AMP a WAR露天maven插件; truezip 问题预 AMP WAR
【发布时间】:2015-03-05 16:40:02
【问题描述】:

我真的在使用 alfresco-maven-plugin 并寻求帮助。用例是将 AMP 预先应用到露天并共享 WAR(版本 4.2.f),然后再部署到与在安全环境中运行 apply_amp.sh 的文件权限问题相关的系统。

我尝试了以下 1.1.1 和 2.0.0 版本,都带有关联的父 alfresco-sdk-parent 和没有(注意:没有父是首选,因为我们有公司父 POM 用于分发和其他原因)

        <plugin>
            <groupId>org.alfresco.maven.plugin</groupId>
            <artifactId>alfresco-maven-plugin</artifactId>
            <version>1.1.1</version>
            <extensions>true</extensions>
            <executions>
                <execution>
                    <id>install-amps</id>
                    <goals>
                        <goal>install</goal>
                    </goals>
                    <phase>package</phase>
                </execution>
            </executions>
            <configuration>
                <ampLocation>${project.build.directory}/amps</ampLocation>
                         <warLocation>${project.build.directory}/${project.artifactId}-${project.version}-war</warLocation>
            </configuration>
        </plugin>

不断收到错误:

java.lang.NoClassDefFoundError: de/schlichtherle/truezip/fs/FsSyncExceptionBuilder

我添加了作为依赖项和插件依赖项的 truezip、truezip-file、truezip-driver-file、truezip-driver-zip、truezip-swing,尝试从 6.X 到 7.8.1 的 truezip 版本,尝试明确列出 alfresco-mmt 版本 4.2.f 到 5.0.c(5.0.x 似乎预先捆绑,但对 maven 插件没有帮助)。

请问有什么指导吗?

编辑:对于 2 年前提出的这个问题,下面提供的答案与不正确的 maven 版本有关。检测到可能重复的TrueZip: NoClassDefFoundError (but for shutdown hook only?) 稍后询问,未提供答案/未解决问题;请注意,此问题被视为“已回答”并已解决。

【问题讨论】:

  • 最新的 Alfresco Maven AMP 插件版本看起来是3.0.4,如果你尝试这样做会发生什么?
  • 上面的场景不是创建一个 AMP(alfresco maven AMP 插件所做的),它采用已经构建的 AMP 并将它们应用到 Alfresco / Share WAR(这是如何alfresco 支持扩展)。
  • 那为什么不直接运行 mmt 工具呢?
  • 通过构建服务器 (Jenkins) 自动创建完全应用的 WAR。
  • 那么您的 jenkins 作业是否将 mmt 工具作为构建作业的一部分运行?还是我错过了什么?

标签: maven alfresco


【解决方案1】:

您使用的是不受支持的 Maven 版本(实际上 Alfresco SDK 2.0.0 需要 Maven 3.2.5 及更高版本,请参阅http://docs.alfresco.com/sdk2.0/tasks/alfresco-sdk-install-maven.html)。

这解释了为什么您会看到此问题,而该问题在经过适当测试的配置中并不存在。

也会关闭相关的https://github.com/Alfresco/alfresco-sdk/issues/265

【讨论】:

  • 感谢您对此进行调查并确认(当时所需的 maven 版本尚未到位,但现在已经到位)。
【解决方案2】:

我做的解决方法是:

截至 2015 年 3 月 9 日,从此处结帐 2.0.1-SNAPSHOT: https://github.com/Alfresco/alfresco-sdk

使用 maven 3.0.5, jdk7,更改 plugins/alfresco-maven-plugin/pom.xml,从 3.2 版更改到这个版本的 maven-plugin-plugin 条目,这样它实际上会编译新版本的 alfresco -maven插件:

            <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-plugin-plugin</artifactId>
            <version>3.0</version>
            <!-- <version>3.2</version> <executions> <execution> <id>generated-helpmojo</id> 
                <goals> <goal>helpmojo</goal> </goals> </execution> </executions> -->


        </plugin>

在我的项目中更新 alfresco-maven-plugin 的 2.0.1-SNAPSHOT 并按预期工作(不需要 alfresco-sdk 父 pom)。

可以通过下载或复制 alfresco-mmt jar 并使用来检查预先应用了 AMP 的新 WAR:

java -jar alfresco-mmt.jar list ${project}/target/${newalfresco}.war

在解决之前的跟踪器:https://github.com/Alfresco/alfresco-sdk/issues/265https://github.com/Alfresco/alfresco-sdk/issues/266

【讨论】:

    猜你喜欢
    • 2011-06-01
    • 1970-01-01
    • 2018-09-27
    • 2012-07-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多