Maven custom archive extension - how to use decompression?

I have my own type artfiact web-module ; just zip, but with custom extension.

Then I have a project depending on it, I want its dependencies of this custom type to be unpacked. The goal of maven-dependency-plugin unpack-dependencies seemed to match the score, however I keep getting the error:

 [INFO] Unknown archiver type Embedded error: No such archiver: 'web-module'. [INFO] ------------------------------------------------------------------------ [INFO] Trace org.apache.maven.lifecycle.LifecycleExecutionException: Unknown archiver type at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719) at org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556) ... 

I did Googling and realized that I could specify my own unarchiver type in my custom plugin components.xml. Below in my components.xml:

 <component> <role>org.codehaus.plexus.archiver.UnArchiver</role> <role-hint>web-module</role-hint> <implementation>org.codehaus.plexus.archiver.zip.ZipUnArchiver</implementation> <instantiation-strategy>per-lookup</instantiation-strategy> </component> 

As soon as my custom plugin was installed, I tried again, still no luck! Does anyone know where I am going wrong?

I also tried adding a custom extension plugin to the POM error module using <extensions>true</extensions> .

+4
source share
1 answer

Try the following:

 <component-set> <components> <!-- Life-cycle mappings --> <component> <role>org.apache.maven.lifecycle.mapping.LifecycleMapping</role> <role-hint>web-module</role-hint> <implementation>org.apache.maven.lifecycle.mapping.DefaultLifecycleMapping</implementation> <configuration> <phases> <!-- You might need these as well. --> </phases> </configuration> </component> <!-- Artifact Handlers --> <component> <role>org.apache.maven.artifact.handler.ArtifactHandler</role> <role-hint>web-module</role-hint> <implementation>org.apache.maven.artifact.handler.DefaultArtifactHandler</implementation> <configuration> <extension>web-module</extension> <type>web-module</type> <packaging>web-module</packaging> </configuration> </component> </components> </component-set> 
0
source

Source: https://habr.com/ru/post/1469044/


All Articles