You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@maven.apache.org by GitBox <gi...@apache.org> on 2022/08/30 07:58:31 UTC

[GitHub] [maven-dependency-plugin] jasperkamerling commented on a diff in pull request #233: [MDEP-782] - Add ability to strip type

jasperkamerling commented on code in PR #233:
URL: https://github.com/apache/maven-dependency-plugin/pull/233#discussion_r958138173


##########
src/test/java/org/apache/maven/plugins/dependency/fromDependencies/TestCopyDependenciesMojo2.java:
##########
@@ -373,7 +373,50 @@ public void testSubPerArtifactAndTypeRemoveVersion()
         for ( Artifact artifact : artifacts )
         {
             String fileName = DependencyUtil.getFormattedFileName( artifact, true );
-            File folder = DependencyUtil.getFormattedOutputDirectory( false, true, true, false, true,
+            File folder = DependencyUtil.getFormattedOutputDirectory( false, true, true, false, true, false,
+                                                                      mojo.outputDirectory, artifact );
+            File file = new File( folder, fileName );
+            assertTrue( file.exists() );
+        }
+    }
+
+    public void testSubPerArtifactRemoveType()
+        throws Exception
+    {
+        mojo.useSubDirectoryPerArtifact = true;
+        mojo.stripType = true;
+
+        mojo.execute();
+
+        Set<Artifact> artifacts = mojo.getProject().getArtifacts();
+        for ( Artifact artifact : artifacts )
+        {
+            // TODO fix test
+            String fileName = DependencyUtil.getFormattedFileName( artifact, false );
+            File folder = DependencyUtil.getFormattedOutputDirectory( false, false, true, false, false, true,
+                mojo.outputDirectory, artifact );
+            File file = new File( folder, fileName );
+            assertTrue( file.exists() );

Review Comment:
   This is something the remove version tests above do not have. Do you want me to also add the check there?



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: issues-unsubscribe@maven.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org