Closed joehni closed 4 years ago
You are right, the type specifier is indeed missing from the dynamicDependency configuration element. I will add it as soon as I have time
I have made the necessary changes on master. Are you able to build the plugin locally and test if it works for you?
Hi,
thanks for your fast reaction. Yes, the current master works for me, but it is not correct, because the type of a Maven artifact is not necessarily its extension. Try to address now a plugin with its correct type:
<dynamicDependency>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-verifier-plugin</artifactId>
<version>1.1</version>
<type>maven-plugin</type>
<repositoryType>PLUGIN</repositoryType>
</dynamicDependency>
You will have to use the typeRegistry for this:
diff --git a/src/main/java/de/qaware/maven/plugin/offline/DependencyDownloader.java b/src/main/java/de/qaware/maven/plugin/offline/DependencyDownloader.java
index 2b218e6..f914976 100644
--- a/src/main/java/de/qaware/maven/plugin/offline/DependencyDownloader.java
+++ b/src/main/java/de/qaware/maven/plugin/offline/DependencyDownloader.java
@@ -277,7 +277,9 @@ public class DependencyDownloader {
* @param dynamicDependency the dependency to download
*/
public Set<ArtifactWithRepoType> resolveDynamicDependency(DynamicDependency dynamicDependency) {
- DefaultArtifact artifact = new DefaultArtifact(dynamicDependency.getGroupId(), dynamicDependency.getArtifactId(), dynamicDependency.getClassifier(), "jar", dynamicDependency.getVersion());
+ ArtifactType artifactType = typeRegistry.get(dynamicDependency.getType());
+ String extension = artifactType!= null ? artifactType.getExtension() : dynamicDependency.getType();
+ DefaultArtifact artifact = new DefaultArtifact(dynamicDependency.getGroupId(), dynamicDependency.getArtifactId(), dynamicDependency.getClassifier(), extension, dynamicDependency.getVersion());
CollectRequest collectRequest = new CollectRequest();
collectRequest.setRoot(new Dependency(artifact, null));
Right, thanks for the review :) I have fixed it on the master. I will release a new version to maven-central with the new feature now
Thanks, a new release would be great.
Hi Theoderich, do you have a time schedule for a new release?
The Sync with mvn-central is in progress and should be done SOON™
Thanks!
We have themes in ZIP files that are unpacked by the dependency:unpack goal and specified with the artifactItems configuration. Therefore these artifacts will by downloaded dynamically during the build.
However, it is not possible to specify the type of a dynamic dependency:
It complains about the type element and without it tries to download a jar file.