Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions services/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@
<module>eventadmin</module>
<module>staticcm</module>
<module>interceptor</module>
<module>url</module>
</modules>

</project>
Expand Down
134 changes: 134 additions & 0 deletions services/url/pom.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,134 @@
<?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">

<!--

Licensed to the Apache Software Foundation (ASF) under one or more
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License, Version 2.0
(the "License"); you may not use this file except in compliance with
the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
-->

<modelVersion>4.0.0</modelVersion>

<parent>
<artifactId>karaf</artifactId>
<groupId>org.apache.karaf</groupId>
<version>4.5.0-SNAPSHOT</version>
<relativePath>../../pom.xml</relativePath>
</parent>

<groupId>org.apache.karaf.services</groupId>
<artifactId>org.apache.karaf.services.url</artifactId>
<packaging>bundle</packaging>
<name>Apache Karaf :: OSGi Services :: URL Handlers</name>
<description>Karaf URL Handlers Service (mvn: protocol)</description>

<build>
<plugins>
<plugin>
<groupId>org.apache.karaf.tooling</groupId>
<artifactId>karaf-services-maven-plugin</artifactId>
</plugin>
<plugin>
<groupId>org.apache.felix</groupId>
<artifactId>maven-bundle-plugin</artifactId>
<configuration>
<instructions>
<Bundle-SymbolicName>
${project.artifactId}
</Bundle-SymbolicName>
<Bundle-Activator>
org.apache.karaf.services.url.internal.osgi.Activator
</Bundle-Activator>
<Bundle-Vendor>The Apache Software Foundation</Bundle-Vendor>
<Import-Package>
org.osgi.framework;version="[1,3)",
org.osgi.service.url;version="[1.0,2)",
org.osgi.service.cm;version="[1.5,2)";resolution:=optional,
org.osgi.util.tracker;version="[1.5,2)",
javax.net.ssl,
javax.xml.parsers,
org.w3c.dom,
org.xml.sax,
*
</Import-Package>
<Export-Package>
org.apache.karaf.services.url;version="${project.version}"
</Export-Package>
<Private-Package>
org.apache.karaf.services.url.internal,
org.apache.karaf.services.url.internal.osgi
</Private-Package>
<Export-Service>
org.osgi.service.url.URLStreamHandlerService,
org.apache.karaf.services.url.MavenResolver
</Export-Service>
</instructions>
</configuration>
</plugin>
</plugins>
</build>

<dependencyManagement>
<dependencies>
<dependency>
<groupId>org.apache.karaf</groupId>
<artifactId>karaf-bom</artifactId>
<version>${project.version}</version>
<type>pom</type>
<scope>import</scope>
</dependency>
</dependencies>
</dependencyManagement>

<dependencies>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.framework</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.url</artifactId>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.service.cm</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.osgi</groupId>
<artifactId>org.osgi.util.tracker</artifactId>
</dependency>
<dependency>
<groupId>org.apache.karaf</groupId>
<artifactId>org.apache.karaf.util</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.easymock</groupId>
<artifactId>easymock</artifactId>
<scope>test</scope>
</dependency>
</dependencies>

</project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
package org.apache.karaf.services.url;

import java.io.File;
import java.io.IOException;

/**
* Service interface for resolving Maven artifact URIs.
* <p>
* Maven URIs follow the syntax:
* {@code mvn:[repository_url!]groupId/artifactId[/[version][/[type][/classifier]]]}
*/
public interface MavenResolver {

/**
* Resolve a Maven artifact URI to a local file.
*
* @param url the Maven artifact URI (e.g. {@code mvn:groupId/artifactId/version})
* @return the resolved file
* @throws IOException if the artifact cannot be resolved
*/
File resolve(String url) throws IOException;

/**
* Resolve a Maven artifact by its coordinates to a local file.
*
* @param groupId the group ID
* @param artifactId the artifact ID
* @param version the version (can be {@code null} for LATEST)
* @param type the type/extension (can be {@code null} for jar)
* @param classifier the classifier (can be {@code null})
* @return the resolved file
* @throws IOException if the artifact cannot be resolved
*/
File resolve(String groupId, String artifactId, String version, String type, String classifier) throws IOException;

/**
* Get the local repository path.
*
* @return the local repository directory
*/
File getLocalRepository();

}
Loading
Loading