I use Maven and I need to process classes from another dependencies. Before processing the classes, maven-dependency-plugin is used to unpack those dependencies with the unpack-dependencies goal, so then I can process the classes in the target directory. Everything is fine while the referenced dependencies are packaged as JARs. Now I'm faced with an AAR dependency that is required to be class-processed in a special way. The error I get so far is:
Failed to execute goal org.apache.maven.plugins:maven-dependency-plugin:2.10:unpack-dependencies (aars-only) on project app-android: Unknown archiver type: No such archiver: 'aar'. -> [Help 1]
The aars-only execution identifier comes from the configuration below, but in general it gives the same error if not splitting the executions. Here is my maven-dependency-plugin configuration I have split later into two executions:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>jars-only</id>
<phase>process-classes</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<includeGroupIds>foo-group,bar-group</includeGroupIds>
<includeTypes>jar</includeTypes> <!-- this is necessary to skip AAR dependencies -->
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
<execution>
<id>aars-only</id>
<phase>process-classes</phase>
<goals>
<goal>unpack-dependencies</goal>
</goals>
<configuration>
<includeScope>runtime</includeScope>
<includeGroupIds>baz-group</includeGroupIds>
<includeTypes>aar</includeTypes> <!-- hoping this can process AARs as well, but it's just another execution, nothing special -->
<outputDirectory>${project.build.directory}/classes</outputDirectory>
</configuration>
</execution>
</executions>
</plugin>
Commenting out the aars-only execution leads to a runtime application crash, but the build passes as the jars-only execution includes the jar type only -- not exactly what I need.
How do I unpack the AAR dependency (baz-group) to the target/classes directory? Is it possible to configure the maven-dependency-plugin somehow so it could accept AAR and its packed classes.jar? Or is there any other way to make it work probably just using another plugin?
(Maybe it's a useful hint: I also use com.simpligility.maven.plugins:android-maven-plugin.)