You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by kw...@apache.org on 2022/08/12 14:24:55 UTC
[sling-maven-plugin] branch master updated: SLING-11537 never mount bundle files from the local Maven repository (#13)
This is an automated email from the ASF dual-hosted git repository.
kwin pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-maven-plugin.git
The following commit(s) were added to refs/heads/master by this push:
new e7f86a2 SLING-11537 never mount bundle files from the local Maven repository (#13)
e7f86a2 is described below
commit e7f86a2d18d2e1669db7ec2a15c35e2d5a1a9281
Author: Konrad Windszus <kw...@apache.org>
AuthorDate: Fri Aug 12 16:24:44 2022 +0200
SLING-11537 never mount bundle files from the local Maven repository (#13)
---
.../apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java | 3 ++-
.../org/apache/sling/maven/bundlesupport/BundleInstallFileMojo.java | 5 ++++-
2 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java b/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java
index cf92954..e6c3bb2 100644
--- a/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java
+++ b/src/main/java/org/apache/sling/maven/bundlesupport/AbstractBundleInstallMojo.java
@@ -94,6 +94,7 @@ abstract class AbstractBundleInstallMojo extends AbstractBundleRequestMojo {
* Whether to add (for install)/remove (for uninstall) the mapping for the
* <a href="https://sling.apache.org/documentation/bundles/accessing-filesystem-resources-extensions-fsresource.html">Apache Sling File System Resource Provider</a>
* for the <a href="https://sling.apache.org/documentation/bundles/content-loading-jcr-contentloader.html#initial-content-loading">bundle's initial content</a>.
+ * This parameter must not be {@code true} with bundles resolved from the Maven repository.
*/
@Parameter(property="sling.mountByFS", defaultValue = "false", required = true)
boolean mountByFS;
@@ -145,7 +146,7 @@ abstract class AbstractBundleInstallMojo extends AbstractBundleRequestMojo {
.mimeType(mimeType)
.refreshPackages(refreshPackages));
getLog().info("Bundle installed successfully");
- if ( mountByFS ) {
+ if (mountByFS) {
configure(httpClient, getConsoleTargetURL(), bundleFile);
}
} catch (IOException e) {
diff --git a/src/main/java/org/apache/sling/maven/bundlesupport/BundleInstallFileMojo.java b/src/main/java/org/apache/sling/maven/bundlesupport/BundleInstallFileMojo.java
index 5cde07d..0b55391 100644
--- a/src/main/java/org/apache/sling/maven/bundlesupport/BundleInstallFileMojo.java
+++ b/src/main/java/org/apache/sling/maven/bundlesupport/BundleInstallFileMojo.java
@@ -106,10 +106,13 @@ public class BundleInstallFileMojo extends AbstractBundleInstallMojo {
File fileName = bundleFileName;
if (fileName == null) {
fileName = resolveBundleFileFromArtifact();
-
if (fileName == null) {
throw new MojoExecutionException("Must provide either sling.file or sling.artifact parameters");
}
+ if (mountByFS) {
+ getLog().warn("The parameter 'mountByFS' is only supported with files outside the Maven repository and therefore ignored in this context!");
+ mountByFS = false;
+ }
}
return fileName;