Skip to content

[KARAF-5810] No config file installed in custom distribution. (On master)#553

Closed
vanSabben wants to merge 3 commits intoapache:masterfrom
vanSabben:KARAF-5810_master
Closed

[KARAF-5810] No config file installed in custom distribution. (On master)#553
vanSabben wants to merge 3 commits intoapache:masterfrom
vanSabben:KARAF-5810_master

Conversation

@vanSabben
Copy link
Copy Markdown
Contributor

Now config files also installed for custom distributions.

Signed-off-by: van Sabben <4246302+vanSabben@users.noreply.github.com>
- Remove unused parameters.

Signed-off-by: van Sabben <4246302+vanSabben@users.noreply.github.com>
@vanSabben vanSabben changed the title Karaf 5810 master [KARAF-5810] No config file installed in custom distribution. (On master) Jul 12, 2018
@jbonofre jbonofre self-requested a review July 13, 2018 04:25
}

new ConfigInstaller(etcDirectory, pidsToExtract)
new ConfigInstaller(homeDirectory, etcDirectory, pidsToExtract)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need the homeDirectory here ? Config should go in etc. And it seems to be the baseDirectory (not home).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The documentation says it is relative.

If not specified, the location is relative from the KARAF_BASE variable. It’s also possible to use variable like ${karaf.home}, ${karaf.base}, ${karaf.etc}, or even system properties.

Each location can occur or it is relative to KARAF_BASE. KARAF_HOME is indeed not good. But is home not always equal to base in the AssemblyMojo? Here are no other instances possible? The builder name it home, but it is the custom distribution directory in the maven target directory. What do you think is best?

public ConfigInstaller(Path etcDirectory, List<String> pidsToExtract) {

public ConfigInstaller(Path homeDirectory, Path etcDirectory, List<String> pidsToExtract) {
this.homeDirectory = homeDirectory;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same, I don't think homeDirectory is required here.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

True, but baseDirectory is required.

}
}

private void installConfig(Downloader downloader, ConfigFile pConfigFile) throws Exception {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The method should be named installConfigFile to avoid confusion.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Correct.

path = path.substring(1);
}

Path configFileTarget = homeDirectory.resolve(substFinalName(path));
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think it's a good idea to do this here. We should just copy the config file in the etc directory "raw".

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by 'raw'? Do not use variables and the like? See comment / documentation above. It can be absolute or relative and use variables.

});
}

private String substFinalName(String finalname) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Useless (at least not in the target of this class).

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See comment / documentation above. It can be absolute or relative and use variables.

- Changes based on review comment.

Signed-off-by: van Sabben <4246302+vanSabben@users.noreply.github.com>
@jbonofre
Copy link
Copy Markdown
Member

jbonofre commented Aug 3, 2018

See my comment in Jira.

@jbonofre jbonofre closed this Aug 3, 2018
gnodet pushed a commit to gnodet/karaf that referenced this pull request Mar 15, 2023
[ENTESB-18335] Teach karaf-maven-plugin how to make use of the CVE me…
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants