Expand my Community achievements bar.

SOLVED

Maven is throwing build error although repository is configured

Avatar

Level 2
  1. hi, im trying to follow this tutorial to create a basic AEM service

    http://helpx.adobe.com/experience-manager/using/first-osgi.html

    in the section Create an Adobe CQ archetype project im getting an error when i try to run the command:

    mvn eclipse:eclipse

     

    im getting this error:

  2. D:\Dex\Key\key>mvn eclipse:eclipse
    [INFO] Scanning for projects...
    Downloading: http://repo1.maven.org/maven2/com/day/jcr/vault/content-package-mav
    en-plugin/0.0.20/content-package-maven-plugin-0.0.20.pom
    [WARNING] The POM for com.day.jcr.vault:content-package-maven-plugin:jar:0.0.20
    is missing, no dependency information available
    Downloading: http://repo1.maven.org/maven2/com/day/jcr/vault/content-package-mav
    en-plugin/0.0.20/content-package-maven-plugin-0.0.20.jar
    [ERROR] The build could not read 1 project -> [Help 1]
    [ERROR]
    [ERROR]   The project com.adobe.cq:key-content:1.0-SNAPSHOT (D:\Dex\Key\key\cont
    ent\pom.xml) has 2 errors
    [ERROR]     Unresolveable build extension: Plugin com.day.jcr.vault:content-pack
    age-maven-plugin:0.0.20 or one of its dependencies could not be resolved: Could
    not find artifact com.day.jcr.vault:content-package-maven-plugin:jar:0.0.20 in c
    entral (http://repo1.maven.org/maven2) -> [Help 2]
    [ERROR]     Unknown packaging: content-package @ line 20, column 16
    [ERROR]
    [ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
    ch.
    [ERROR] Re-run Maven using the -X switch to enable full debug logging.
    [ERROR]
    [ERROR] For more information about the errors and possible solutions, please rea
    d the following articles:
    [ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/ProjectBuildin
    gException
    [ERROR] [Help 2] http://cwiki.apache.org/confluence/display/MAVEN/PluginResoluti
    onException

 

Could any one suggest what changes in POM are needed to fix this?

 

Many Thanks.

1 Accepted Solution

Avatar

Correct answer by
Level 2

The issue is finally resolved. The problem is not with the version of maven.

Here is the solution:

Go to content folder of your project. Open up the pom.xml from content. In the plugins for group id: com.day.jcr.vault change the filter source to filter.xml

<filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>

This will resolve the issue.

Thanks all.

View solution in original post

7 Replies

Avatar

Level 10

Check if Adobe Maven repository configured. You have to do that before this goal will work . Also, you should use version 0.0.20 of the plugin as the current version.

Also make sure that you have changed the directory path to where the pom.xml (your project directory) is situated and then try mvn eclipse:eclipse

Avatar

Level 2

Maven repository configuration is in place but still am getting the error.

And this is where from I am building the maven project. In the same path POM is present.

D:\Dex\Key\key>mvn eclipse:eclipse
[INFO] Scanning for projects...

Please find the screen prints attached for the same.

Avatar

Level 9

It seems that your content-maven-package plugin is not downloaded or is invalid in your path. Have you followed this (from the link)

Next, copy the Maven configuration file named settings.xml from [install location]\apache-maven-3.0.4\conf\ to your user profile. For example, C:\Users\scottm\.m2\.

You have to configure your settings.xml file to use Adobe’s public repository. For information, see Adobe Public Maven Repository at http://repo.adobe.com/.

Pls make sure you have this jar in C:\Users\<your_username>\.m2\repository\com\day\jcr\vault\content-package-maven-plugin\0.0.20 and it is valid

If it doesn't work, delete this folder and run maven build again, check whether the folder is created again and downloaded with necessary jar files.

Avatar

Level 2

@Ahmed Now I get different error message after following your steps:

D:\Dex\Key\key>mvn eclipse:eclipse
[INFO] Scanning for projects...
[WARNING] The POM for com.day.jcr.vault:content-package-maven-plugin:jar:0.0.14
is missing, no dependency information available
[ERROR] The build could not read 1 project -> [Help 1]
[ERROR]
[ERROR]   The project com.adobe.cq:key-content:1.0-SNAPSHOT (D:\Dex\Key\key\cont
ent\pom.xml) has 2 errors
[ERROR]     Unresolveable build extension: Plugin com.day.jcr.vault:content-pack
age-maven-plugin:0.0.20 or one of its dependencies could not be resolved: Failur
e to find com.day.jcr.vault:content-package-maven-plugin:jar:0.0.20 in http://re
po1.maven.org/maven2 was cached in the local repository, resolution will not be
reattempted until the update interval of central has elapsed or updates are forc
ed -> [Help 2]
[ERROR]     Unknown packaging: content-package @ line 20, column 16
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.


Please suggest.

Thanks.

Avatar

Level 2

Please find POM.xml for your reference:

 

<?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>
    <!-- ====================================================================== -->
    <!-- P A R E N T P R O J E C T D E S C R I P T I O N -->
    <!-- ====================================================================== -->

    <groupId>com.adobe.cq</groupId>
    <artifactId>key</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>Custom AEM Service - Reactor Project</name>
    <description>Maven Multimodule project for Custom AEM Service.</description>

    <!-- ====================================================================== -->
    <!-- P R O P E R T I E S -->
    <!-- ====================================================================== -->
    <properties>
        <crx.host>localhost</crx.host>
        <crx.port>4502</crx.port>
    </properties>

    <build>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-scr-plugin</artifactId>
                    <version>1.7.4</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.felix</groupId>
                    <artifactId>maven-bundle-plugin</artifactId>
                    <version>2.3.6</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-compiler-plugin</artifactId>
                    <!-- use version 2.3.2 to have java 1.5 as the default -->
                </plugin>
                <plugin>
                    <groupId>org.apache.maven.plugins</groupId>
                    <artifactId>maven-resources-plugin</artifactId>
                    <version>2.5</version>
                </plugin>
                <plugin>
                    <groupId>org.apache.sling</groupId>
                    <artifactId>maven-sling-plugin</artifactId>
                    <version>2.0.6</version>
                </plugin>
                <plugin>
                          <groupId>com.day.jcr.vault</groupId>
                          <artifactId>content-package-maven-plugin</artifactId>
                          <version>0.0.20</version>
                </plugin>
                <!--This plugin's configuration is used to store Eclipse
                    m2e settings only. It has no influence on the Maven build itself. -->
                <plugin>
                    <groupId>org.eclipse.m2e</groupId>
                    <artifactId>lifecycle-mapping</artifactId>
                    <version>1.0.0</version>
                    <configuration>
                        <lifecycleMappingMetadata>
                            <pluginExecutions>
                                <pluginExecution>
                                    <pluginExecutionFilter>
                                        <groupId>
                                            org.apache.felix
                                        </groupId>
                                        <artifactId>
                                            maven-scr-plugin
                                        </artifactId>
                                        <versionRange>
                                            [1.0.0,)
                                        </versionRange>
                                        <goals>
                                            <goal>scr</goal>
                                        </goals>
                                    </pluginExecutionFilter>
                                    <action>
                                        <ignore/>
                                    </action>
                                </pluginExecution>
                            </pluginExecutions>
                        </lifecycleMappingMetadata>
                    </configuration>
                </plugin>
            </plugins>
        </pluginManagement>
    </build>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.core</artifactId>
                <version>4.2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.osgi</groupId>
                <artifactId>org.osgi.compendium</artifactId>
                <version>4.2.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.apache.felix</groupId>
                <artifactId>org.apache.felix.scr.annotations</artifactId>
                <version>1.6.0</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>org.slf4j</groupId>
                <artifactId>slf4j-api</artifactId>
                <version>1.5.10</version>
                <scope>provided</scope>
            </dependency>
            <dependency>
                <groupId>junit</groupId>
                <artifactId>junit</artifactId>
                <version>4.8.1</version>
                <scope>test</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

    <profiles>
        <profile>
            <id>autoInstallBundle</id>
            <build>
                <plugins>
                    <plugin>
                        <groupId>org.apache.sling</groupId>
                        <artifactId>maven-sling-plugin</artifactId>
                        <executions>
                            <execution>
                                <id>install-bundle</id>
                                <goals>
                                    <goal>install</goal>
                                </goals>
                            </execution>
                        </executions>
                    </plugin>
                </plugins>
            </build>
        </profile>
    </profiles>
  <modules>
    <module>bundle</module>
    <module>content</module>
  </modules>
</project>

Avatar

Level 9

Change to 1.0.2 version, run the maven archetype command like this

mvn archetype:generate -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype -DarchetypeVersion=1.0.2 -DarchetypeRepository=adobe-public-releases

Then go to your key directory and run "mvn eclipse:eclipse"  command

If this doesn't work try this 

mvn archetype:generate -DarchetypeRepository=http://repo.adobe.com/nexus/content/groups/public/ -DarchetypeGroupId=com.day.jcr.vault -DarchetypeArtifactId=multimodule-content-package-archetype    -DarchetypeVersion=1.0.2
Then go to your key directory and run "mvn eclipse:eclipse"  command again   

Avatar

Correct answer by
Level 2

The issue is finally resolved. The problem is not with the version of maven.

Here is the solution:

Go to content folder of your project. Open up the pom.xml from content. In the plugins for group id: com.day.jcr.vault change the filter source to filter.xml

<filterSource>src/main/content/META-INF/vault/filter.xml</filterSource>

This will resolve the issue.

Thanks all.