karaf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jean-Baptiste Onofré (JIRA) <j...@apache.org>
Subject [jira] [Commented] (KARAF-3019) karaf-maven-plugin cannot handle all types of mvn urls
Date Thu, 18 Dec 2014 13:20:14 GMT

    [ https://issues.apache.org/jira/browse/KARAF-3019?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14251638#comment-14251638
] 

Jean-Baptiste Onofré commented on KARAF-3019:
---------------------------------------------

With Karaf 3.0.3-SNAPSHOT plugin, I have:

{code}
[INFO] == Installing bundle mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1
Downloading: http://repo.maven.apache.org/maven2/com/google/code/scriptengines/scriptengines-groovy/1.1/scriptengines-groovy-1.1.jar
[WARNING] Could not resolve com.google.code.scriptengines:scriptengines-groovy:1.1
org.sonatype.aether.resolution.ArtifactResolutionException: Could not find artifact com.google.code.scriptengines:scriptengines-groovy:jar:1.1
in central (http://repo.maven.apache.org/maven2)
{code}

while installing the camel-script-groovy feature (as a boot feature).

I just add the http://scriptengines.googlecode.com/svn/m2-repo <repository/> in my pom.xml
and it works fine:

{code}
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 4.607s
[INFO] Finished at: Thu Dec 18 14:18:14 CET 2014
[INFO] Final Memory: 19M/437M
[INFO] ------------------------------------------------------------------------
{code}

Here's the POM that I used for my test:

{code}
<?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/xsd/maven-4.0.0.xsd">

    <modelVersion>4.0.0</modelVersion>

    <groupId>net.nanthrax.karaf.test</groupId>
    <artifactId>assembly</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>karaf-assembly</packaging>

    <dependencies>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>framework</artifactId>
            <version>3.0.3-SNAPSHOT</version>
            <type>kar</type>
        </dependency>
        <dependency>
            <groupId>org.apache.karaf.features</groupId>
            <artifactId>standard</artifactId>
            <version>3.0.3-SNAPSHOT</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
        <dependency>
            <groupId>org.apache.camel.karaf</groupId>
            <artifactId>apache-camel</artifactId>
            <version>2.12.4</version>
            <classifier>features</classifier>
            <type>xml</type>
            <scope>runtime</scope>
        </dependency>
    </dependencies>

    <repositories>
       <repository>
         <name>scriptengine</name>
         <id>scriptengines</id>
         <url>http://scriptengines.googlecode.com/svn/m2-repo</url>
       </repository>
    </repositories>

    <build>
        <resources>
            <resource>
                <directory>src/main/resources</directory>
                <filtering>false</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/filtered-resources</directory>
                <filtering>true</filtering>
                <includes>
                    <include>**/*</include>
                </includes>
            </resource>
        </resources>
        <pluginManagement>
            <plugins>
                <plugin>
                    <groupId>org.apache.karaf.tooling</groupId>
                    <artifactId>karaf-maven-plugin</artifactId>
                    <version>3.0.3-SNAPSHOT</version>
                    <extensions>true</extensions>
                </plugin>
            </plugins>
        </pluginManagement>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-resources-plugin</artifactId>
                <version>2.6</version>
                <executions>
                    <execution>
                        <id>process-resources</id>
                        <goals>
                            <goal>resources</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
            <plugin>
                <groupId>org.apache.karaf.tooling</groupId>
                <artifactId>karaf-maven-plugin</artifactId>
                <configuration>
                    <!-- <startupFeatures/> -->
                    <bootFeatures>
                        <feature>standard</feature>
                        <feature>management</feature>
                        <feature>camel-script-groovy</feature>
                    </bootFeatures>
                    <!-- <installedFeatures/> -->
                </configuration>
            </plugin>
        </plugins>
    </build>

</project>
{code}

> karaf-maven-plugin cannot handle all types of mvn urls
> ------------------------------------------------------
>
>                 Key: KARAF-3019
>                 URL: https://issues.apache.org/jira/browse/KARAF-3019
>             Project: Karaf
>          Issue Type: Bug
>          Components: karaf-tooling
>    Affects Versions: 3.0.1
>            Reporter: Kai Reichert
>            Assignee: Jean-Baptiste Onofré
>            Priority: Minor
>              Labels: karaf-maven-plugin
>             Fix For: 4.0.0, 3.0.3
>
>         Attachments: pom.xml
>
>
> Some feature files list bundle references with maven repository urls.
> For example the apache-camel-2.13.1 feature file contains:
> {code:language=xml}
> <feature name='camel-script-groovy' version='2.13.1' resolver='(obr)' start-level='50'>
>     <bundle>mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1</bundle>
> …
> {code}
> There is no problem if you install such a feature from the karaf shell. I think karaf
uses the pax url handler internally (see [https://ops4j1.jira.com/wiki/display/paxurl/Mvn+Protocol])
which handles repository urls, too.
> But if you try to provision a new karaf distribution with maven and the {{karaf-assembly}}
packaging type, those urls cannot be resolved. 
> Just try to include the bootFeature {{camel-script-groovy}} and you get the following
error:
> {noformat}
> [ERROR] Failed to execute goal org.apache.karaf.tooling:karaf-maven-plugin:3.0.1:install-kars
(default-install-kars) on project karaf3-distribution: Couldn't resolve artifact mvn:http://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1:
Could not find artifact mvn:http:jar://scriptengines.googlecode.com/svn/m2-repo/!com.google.code.scriptengines/scriptengines-groovy/1.1
in central (http://repo1.maven.org/maven2) -> [Help 1]
> {noformat}
> If the plugin cannot or even should not try to include the maven repository it could
just ignore it in the resolution process (strip of the repository information from the url)
and report the repo url as a warning.
> The missing reference to the repository can then be included in the {{pom.xml}} file.

> I removed the repository information in the feature file inside my local maven repository
for testing purposes, included the missing repository in the {{pom.xml}} file and the karaf-plugin
was able to install the feature. 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message