Currently, I have a pom.xml, which, upon build, gathers dependency Javadoc jars from mvnrepository and unpacks them in specific folders:
<build>
<finalName>${parent.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-dependency-plugin</artifactId>
<executions>
<execution>
<id>unpack-javadoc-jars</id>
<goals>
<goal>unpack</goal>
</goals>
</execution>
</executions>
<configuration>
<artifactItems>
<artifactItem>
<groupId>groupid1</groupId>
<artifactId>artifactid1</artifactId>
<version>1.0.0</version>
<classifier>javadoc</classifier>
<outputDirectory>${project.build.directory}/dependency-javadoc/artifactid1-1.0.0</outputDirectory>
</artifactItem>
<artifactItem>
<groupId>groupid2</groupId>
<artifactId>artifactid2</artifactId>
<version>2.0.0</version>
<classifier>javadoc</classifier>
<outputDirectory>${project.build.directory}/dependency-javadoc/artifactid2-2.0.0</outputDirectory>
</artifactItem>
...
</artifactItems>
</configuration>
</plugin>
</plugins>
</build>
The thing is, if I do not specify the output directory field for each artifact, the javadoc gets unpacked all in one folder (which is also configurable for the unpack goal - https://maven.apache.org/plugins-archives/maven-dependency-plugin-2.6/unpack-mojo.html ), and I want them to be clearly structured in folders. So I added a directory entry for each artifactItem. However, I have to write the folder name manually. Is there a way to refer the existing artifactItem's fields, in a way similar to this:
<artifactItem>
<groupId>groupid1</groupId>
<artifactId>artifactid1</artifactId>
<version>1.0.0</version>
<classifier>javadoc</classifier>
<outputDirectory>${project.build.directory}/dependency-javadoc/${artifactItem.artifactId}-${artifactItem.version}</outputDirectory>
</artifactItem>
This way,I will be able to just copy/paste the outputDirectory in all javadoc artifact entries, but it will be the same. Thanks!