From 67cb2281f166ae75afa2131ad91cf4d7629b0397 Mon Sep 17 00:00:00 2001 From: Simon Seyock Date: Wed, 13 Sep 2023 10:21:37 +0200 Subject: [PATCH] fix: use home instead of cwd as settingsPath as action/setup-java creates a default file there BREAKING CHANGE: The default for the `settingsPath` changes from `.m2/settings.xml` to `~/.m2/settings.xml`. This is the same path that `action/setup-java` uses by default. --- src/plugin-config.js | 2 +- src/prepare.js | 2 +- src/publish.js | 2 +- src/success.js | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/plugin-config.js b/src/plugin-config.js index ebd4b9b..5b62ad1 100644 --- a/src/plugin-config.js +++ b/src/plugin-config.js @@ -1,6 +1,6 @@ /** * @typedef {Object} PluginConfig - * @property {string} [settingsPath='.m2/settings.xml'] Path to a maven settings file. + * @property {string} [settingsPath='~/.m2/settings.xml'] Path to a maven settings file. * @property {boolean} [processAllModules=false] This sets the `processAllModules` option for the `versions:set` target. It is useful for multimodule projects. * @property {'deploy'|'package jib:build'|'deploy jib:build'} [mavenTarget='deploy'] This determines which mvn targets are used to publish. * @property {boolean} [clean=true] Whether the `clean` target will be applied before publishing. diff --git a/src/prepare.js b/src/prepare.js index 32c1752..de83b69 100644 --- a/src/prepare.js +++ b/src/prepare.js @@ -14,7 +14,7 @@ module.exports = async function prepare(pluginConfig, { }) { logger.log('prepare maven release'); - const settingsPath = pluginConfig.settingsPath || '.m2/settings.xml'; + const settingsPath = pluginConfig.settingsPath || '~/.m2/settings.xml'; if (!/^[\w~./-]*$/.test(settingsPath)) { throw new Error('config settingsPath contains disallowed characters'); diff --git a/src/publish.js b/src/publish.js index 8ed17cf..bcde667 100644 --- a/src/publish.js +++ b/src/publish.js @@ -14,7 +14,7 @@ module.exports = async function publish(pluginConfig, { }) { logger.log('publish mvn release'); - const settingsPath = pluginConfig.settingsPath || '.m2/settings.xml'; + const settingsPath = pluginConfig.settingsPath || '~/.m2/settings.xml'; const mavenTarget = pluginConfig.mavenTarget || 'deploy'; const clean = pluginConfig.clean || true; const debug = pluginConfig.debug || false; diff --git a/src/success.js b/src/success.js index ef2c0d6..a448c23 100644 --- a/src/success.js +++ b/src/success.js @@ -37,7 +37,7 @@ module.exports = async function success(pluginConfig, { }); if (updateSnapshotVersionOpt) { - const settingsPath = pluginConfig.settingsPath || '.m2/settings.xml'; + const settingsPath = pluginConfig.settingsPath || '~/.m2/settings.xml'; if (!/^[\w~./-]*$/.test(settingsPath)) { throw new Error('config settingsPath contains disallowed characters');