0

I am trying to deploy an application on Karaf 3.0.1.
Upon starting the bin/karaf clean script and trying to add the desired features which reside on my local maven repository ~/.m2/repository (I have manually checked in repository to make sure they exist).

The command I run:

karaf@root()> feature:repo-add mvn:com.mycompany.myproject.common/common-karaf-features/1.1.0/xml/features

I get the following error:

Adding feature url mvn:com.mycompany.myproject.common/common-karaf-features/1.1.0/xml/features
Error executing command: Error resolving artifact com.mycompany.myproject.common:common-karaf-features:xml:features:1.1.0: Could not transfer artifact com.mycompany.myproject.common:common-karaf-features:xml:features:1.1.0 from/to central (http://repo1.maven.org/maven2/):
Error transferring file: Connection refused

I have already tried manually setting the maven repository in the etc/org.ops4j.pax.url.mvn.cfg

Does anyone know at least the possible causes of such behavior? Why doesn't karaf look at the local repo?

BalusC
  • 1,082,665
  • 372
  • 3,610
  • 3,555
  • I've found similar question: https://stackoverflow.com/q/32847252/1823545. Maybe there are some issue with features definition? Could you try with the repository file containing one very simple feature or without any feature? – Witek May 24 '18 at 14:02
  • @Witek Thank you for the reply, I problem is that a have tried the solutions described in the question you linked, all different ways. Also their issue was that they were not runnig repo-add before install, I am doing this and `repo-add` is where I get the error. – Athanasios Doulgeris May 25 '18 at 11:29

1 Answers1

0

you almost there, you just need to add a <classifier>features</classifier> at maven attach artifact plugin

<plugin>
    <groupId>org.codehaus.mojo</groupId>
    <artifactId>build-helper-maven-plugin</artifactId>
    <executions>
        <execution>
            <id>attach-artifacts</id>
            <phase>package</phase>
            <goals>
                <goal>attach-artifact</goal>
            </goals>
            <configuration>
                <artifacts>
                    <artifact>
                        <file>target/feature/feature.xml</file>
                        <classifier>features</classifier>
                        <type>xml</type>
                    </artifact>
                </artifacts>
            </configuration>
        </execution>
    </executions>
</plugin>
David Buck
  • 3,752
  • 35
  • 31
  • 35
Data Feed
  • 11
  • 1