Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plugins: Fix module name conflict check for meta plugins #29146

Merged
merged 2 commits into from
Mar 20, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -532,6 +532,12 @@ private Path stagingDirectoryWithoutPosixPermissions(Path pluginsDir) throws IOE

// checking for existing version of the plugin
private void verifyPluginName(Path pluginPath, String pluginName, Path candidateDir) throws UserException, IOException {
// don't let user install plugin conflicting with module...
// they might be unavoidably in maven central and are packaged up the same way)
if (MODULES.contains(pluginName)) {
throw new UserException(ExitCodes.USAGE, "plugin '" + pluginName + "' cannot be installed as a plugin, it is a system module");
}

final Path destination = pluginPath.resolve(pluginName);
if (Files.exists(destination)) {
final String message = String.format(
Expand Down Expand Up @@ -574,13 +580,6 @@ private PluginInfo loadPluginInfo(Terminal terminal, Path pluginRoot, boolean is

terminal.println(VERBOSE, info.toString());

// don't let user install plugin as a module...
// they might be unavoidably in maven central and are packaged up the same way)
if (MODULES.contains(info.getName())) {
throw new UserException(ExitCodes.USAGE, "plugin '" + info.getName() +
"' cannot be installed like this, it is a system module");
}

// check for jar hell before any copying
jarHellCheck(info, pluginRoot, env.pluginsFile(), env.modulesFile());

Expand Down