Hello,

I created a custom ArtifactRepositoryLayout to import libraries from a non standard repository layout. Now I would like maven to use it...


The class is created like the default layout, with another id.

@Component(role =ArtifactRepositoryLayout.class, hint ="http-directory")

public String getId() {
   return "http-directory";
}

To make sure I see the usage of this extension interface method print a stacktrace:

public String pathOf(Artifact artifact) {
   Thread.dumpStack();

It's built as a plugin (only maven-bundle-plugin is new to me, I already made several plugins):

<plugin>
   <groupId>org.apache.felix</groupId>
   <artifactId>maven-bundle-plugin</artifactId>
   <extensions>true</extensions>
   <configuration>

   </configuration>
</plugin>
<plugin>
   <groupId>org.apache.maven.plugins</groupId>
   <artifactId>maven-plugin-plugin</artifactId>
   <version>3.6.0</version>
   <configuration>
      <!-- see http://jira.codehaus.org/browse/MNG-5346 --> 
<skipErrorNoDescriptorsFound>true</skipErrorNoDescriptorsFound>
   </configuration>
   <executions>
      <execution>
         <id>mojo-descriptor</id>
         <goals>
            <goal>descriptor</goal>
         </goals>
      </execution>
   </executions>
</plugin>

In the pom.xml of the project, I setup the repository with that layout:

<layout>http-directory</layout>

Then I registered an extension in a project (new to me) in order to have it in the classpath:

.mvn/extensions.xml

<extensions xmlns="http://maven.apache.org/EXTENSIONS/1.0.0"; xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"; xsi:schemaLocation="http://maven.apache.org/EXTENSIONS/1.0.0 http://maven.apache.org/xsd/core-extensions-1.0.0.xsd";>
   <extension>
      <groupId>...</groupId>
      <artifactId>maven-http-directory</artifactId>
      <version>1.0-SNAPSHOT</version>
   </extension>
</extensions>


Thanks for your help.
Stéphane

Reply via email to