You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@maven.apache.org by rf...@apache.org on 2020/06/16 19:40:51 UTC
[maven] 03/03: ReAdd DefaultModelSourceTransformer
This is an automated email from the ASF dual-hosted git repository.
rfscholte pushed a commit to branch MNG-6656
in repository https://gitbox.apache.org/repos/asf/maven.git
commit 1737d23574f7361450c2a94dd135f085c9bf8e45
Author: rfscholte <rf...@apache.org>
AuthorDate: Tue Jun 16 21:40:35 2020 +0200
ReAdd DefaultModelSourceTransformer
---
.../building/DefaultModelSourceTransformer.java | 43 ++++++++++++++++++++++
1 file changed, 43 insertions(+)
diff --git a/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java
new file mode 100644
index 0000000..50ad04b
--- /dev/null
+++ b/maven-model-builder/src/main/java/org/apache/maven/model/building/DefaultModelSourceTransformer.java
@@ -0,0 +1,43 @@
+package org.apache.maven.model.building;
+
+/*
+ * 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 java.io.IOException;
+import java.io.InputStream;
+import java.nio.file.Files;
+import java.nio.file.Path;
+
+/**
+ * Default ModelSourceTransformer, provides pomFile as inputStream and ignores the context
+ *
+ * @author Robert Scholte
+ * @since 3.7.0
+ */
+public class DefaultModelSourceTransformer implements ModelSourceTransformer
+{
+
+ @Override
+ public InputStream transform( Path pomFile, TransformerContext context )
+ throws IOException, TransformerException
+ {
+ return Files.newInputStream( pomFile );
+ }
+
+}