You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by cs...@apache.org on 2022/06/10 10:09:28 UTC

[maven] branch zip-added-to-classpath created (now dfb2b28db)

This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a change to branch zip-added-to-classpath
in repository https://gitbox.apache.org/repos/asf/maven.git


      at dfb2b28db [EXPERIMENT] Add ZIP ArtifactHandler

This branch includes the following new commits:

     new dfb2b28db [EXPERIMENT] Add ZIP ArtifactHandler

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[maven] 01/01: [EXPERIMENT] Add ZIP ArtifactHandler

Posted by cs...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

cstamas pushed a commit to branch zip-added-to-classpath
in repository https://gitbox.apache.org/repos/asf/maven.git

commit dfb2b28db50e02e23b389e3b4f1b1d06c0c4a995
Author: Tamas Cservenak <ta...@cservenak.net>
AuthorDate: Fri Jun 10 12:08:49 2022 +0200

    [EXPERIMENT] Add ZIP ArtifactHandler
    
    And make it possible to control are they added to CP or not.
---
 .../providers/ZipArtifactHandlerProvider.java      | 61 ++++++++++++++++++++++
 1 file changed, 61 insertions(+)

diff --git a/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/ZipArtifactHandlerProvider.java b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/ZipArtifactHandlerProvider.java
new file mode 100644
index 000000000..2b1e62203
--- /dev/null
+++ b/maven-core/src/main/java/org/apache/maven/artifact/handler/providers/ZipArtifactHandlerProvider.java
@@ -0,0 +1,61 @@
+package org.apache.maven.artifact.handler.providers;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *  http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import javax.inject.Inject;
+import javax.inject.Named;
+import javax.inject.Provider;
+import javax.inject.Singleton;
+
+import org.apache.maven.artifact.handler.ArtifactHandler;
+import org.apache.maven.artifact.handler.DefaultArtifactHandler;
+
+/**
+ * {@code zip} artifact handler provider.
+ */
+@Named( "zip" )
+@Singleton
+public class ZipArtifactHandlerProvider
+    implements Provider<ArtifactHandler>
+{
+    private final ArtifactHandler artifactHandler;
+
+    @Inject
+    public ZipArtifactHandlerProvider( @Named( "${maven.artifactHandler.zip.addedToClasspath:-true}" )
+                                           boolean addedToClasspath )
+    {
+        this.artifactHandler = new DefaultArtifactHandler(
+            "zip",
+            null,
+            null,
+            null,
+            null,
+            false,
+            "java",
+            addedToClasspath
+        );
+    }
+
+    @Override
+    public ArtifactHandler get()
+    {
+        return artifactHandler;
+    }
+}