【问题标题】:maven alfresco project creates defective pom.xmlmaven alfresco 项目创建有缺陷的 pom.xml
【发布时间】:2016-08-11 02:47:00
【问题描述】:

我是 alfresco 的新手,我正在尝试制作一些简单的 helloworld,但经常遇到任何问题。现在,当我尝试使用 alfresco-amp-archetype 在 eclipse 中创建一个新的 maven 项目时,它会生成 pom.xml 文件有以下错误的项目:

Plugin execution not covered by lifecycle configuration: org.codehaus.mojo:build-helper-maven-plugin:1.8:add-test-resource (execution: add-env-test-properties, phase: generate-resources)

在这个地方:

<parent>
   <groupId>org.alfresco.maven</groupId>
   <artifactId>alfresco-sdk-parent</artifactId>
   <version>1.1.1</version>
</parent>

也许使用maven-alfresco-share-archetype 是更好的主意,因为我想为露天创建工作流程?或者如何解决这个问题?

尽管如此,mvn integration-test -Pamp-to-war -Dmaven.tomcat.port=8081 没有给出任何错误,并且 alfresco 开始了,但是当我尝试登录时,alfresco 给了我答案: 远程服务器可能不可用或您的身份验证详细信息未被识别

UPD:这里是漏洞 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>
    <groupId>com.someco</groupId>
    <artifactId>workflow-tutorial-repo</artifactId>
    <version>1.0-SNAPSHOT</version>
    <name>workflow-tutorial-repo AMP project</name>
    <packaging>amp</packaging>
    <description>Manages the lifecycle of the workflow-tutorial-repo AMP (Alfresco Module Package)</description>

    <parent>
        <groupId>org.alfresco.maven</groupId>
        <artifactId>alfresco-sdk-parent</artifactId>
        <version>1.1.1</version>
    </parent>


    <properties>
        <alfresco.groupId>org.alfresco</alfresco.groupId>
        <alfresco.version>4.2.e</alfresco.version>
        <app.log.root.level>WARN</app.log.root.level>
        <alfresco.data.location>alf_data_dev</alfresco.data.location>
         <alfresco.client.war>alfresco</alfresco.client.war>
        <alfresco.client.war.groupId>org.alfresco</alfresco.client.war.groupId>
        <alfresco.client.war.version>4.2.e</alfresco.client.war.version>
        <env>local</env>
    </properties>

     <dependencyManagement>
        <dependencies>
             <dependency>
                <groupId>${alfresco.groupId}</groupId>
                <artifactId>alfresco-platform-distribution</artifactId>
                <version>${alfresco.version}</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>
     <dependencies>
        <dependency>
            <groupId>${alfresco.groupId}</groupId>
            <artifactId>alfresco-repository</artifactId>
        </dependency>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>4.8.1</version>
            <scope>test</scope>
        </dependency>
    </dependencies>

    <repositories>
        <repository>
            <id>alfresco-public</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public</url>
        </repository>
        <repository>
            <id>alfresco-public-snapshots</id>
            <url>https://artifacts.alfresco.com/nexus/content/groups/public-snapshots</url>
            <snapshots>
                <enabled>true</enabled>
                <updatePolicy>daily</updatePolicy>
            </snapshots>
        </repository>
    </repositories>
</project>

【问题讨论】:

  • 您确定您运行的是 Java 7(或 8)吗? IIRC 最新的 Alfresco Maven 东西依赖于 Java 7,就像最新的 Alfresco 一样
  • @Gagravarr java -version 给出以下内容:java version "1.7.0_72"
  • 那你能把整个pom文件贴出来吗?我们也许能够看到问题所在
  • @Gagravarr 舒尔。更新了问题
  • 如果您使用的是 Maven AMP 原型,您还必须为存储库创建一个原型,然后首先使用相同的命令但在端口 8080 上启动它。

标签: maven eclipse-plugin alfresco pom.xml


【解决方案1】:

我认为你有两个不同的问题。

i) 运行共享 ii) 解决 Maven 问题

对于第一点,当您运行 4.2 版本时,您还需要使用 alfresco_target_amp_client_war = alfresco 创建一个 AMP 项目,然后首先从存储库 AMP 项目中启动命令 mvn integration-test -Pamp-to-war -Dmaven.tomcat.port=8080

第二点,它不应该阻止你运行项目,而是与Maven无法管理插件版本有关,所以如果你在Eclipse中运行项目尝试右键单击pom.xml并找到像 Select "mark goal set-version as ignored in build" 这样的项目

【讨论】:

    【解决方案2】:

    在 eclipse 中安装 m2e build-helper 连接器。您可以从 Window > Preferences > Maven > Discovery > Open Catalog 安装它。这样 build-helper-maven-plugin:add-sources 将在 Eclipse 中调用,而无需您更改 pom.xml。

    【讨论】:

      猜你喜欢
      • 2014-02-06
      • 1970-01-01
      • 2012-07-24
      • 2017-11-10
      • 2016-08-15
      • 2011-03-13
      • 2018-10-28
      • 1970-01-01
      • 2019-02-15
      相关资源
      最近更新 更多