2
votes

I'm very new to alfresco and trying to make even some easy helloworld but constantly face any problems. Now when I'trying to create a new maven project in eclipse using alfresco-amp-archetype it generates the project where the pom.xml file has the following error:

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)

in this place:

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

Maybe it's the better idea to use maven-alfresco-share-archetype as I want to create a workflow for alfresco? or what to do with this problem?

nevertheless mvn integration-test -Pamp-to-war -Dmaven.tomcat.port=8081 gave no errors and alfresco started but alfresco gives me the answer when i'm trying to login : The remote server may be unavailable or your authentication details have not been recognized

UPD: here is the hole 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>
2
Did you make sure you were running Java 7 (or 8)? IIRC The latest Alfresco Maven stuff depends on Java 7, just as the latest Alfresco does - Gagravarr
@Gagravarr java -version gives the following: java version "1.7.0_72" - Nikitin Mikhail
Can you post the whole pom file then? We might be able to see what's wrong - Gagravarr
@Gagravarr shure. updated the question - Nikitin Mikhail
If you are using Maven AMP archetype, you have to create also an archetype for the repository, and then launch it first with the same command but on port 8080. - Leonardo

2 Answers

1
votes

I think you have two distinct problems.

i) Running share ii) Solving the Maven problem

For the first point, as you are running 4.2 version, you also need to create an AMP project with alfresco_target_amp_client_war = alfresco then launch firstly the command mvn integration-test -Pamp-to-war -Dmaven.tomcat.port=8080 from the repository AMP project.

The second point, it shouldn't stop you from running the projects, it is instead related to Maven being unable to manage plugin version, so if you are running the project in Eclipse try to right click the pom.xml and find an item like Select "mark goal set-version as ignored in build"

0
votes

Install the m2e build-helper connector in eclipse. You can install it from the Window > Preferences > Maven > Discovery > Open Catalog. That way build-helper-maven-plugin:add-sources would be called in eclipse without having you to change your pom.xml.