Bug 1011123

Summary: No settings.xml path validation during quickstarts installation
Product: [JBoss] JBoss Enterprise Application Platform 6 Reporter: Petr Kremensky <pkremens>
Component: InstallerAssignee: Francisco Canas <fcanas>
Status: CLOSED CURRENTRELEASE QA Contact: Petr Kremensky <pkremens>
Severity: low Docs Contact: Russell Dickenson <rdickens>
Priority: unspecified    
Version: 6.2.0CC: fcanas, thauser
Target Milestone: ER6   
Target Release: EAP 6.2.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-12-15 16:21:23 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Petr Kremensky 2013-09-23 16:14:06 UTC
I am able to set path to directory as settings.xml target path. We should add some validation here.

Following exception is thrown during installation:
Post Processing Error
Invocation Problem calling : com.redhat.installer.settings.MavenSettingsTransformer, java.lang.reflect.InvocationTargetException
	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.lang.reflect.Method.invoke(Method.java:606)
	at com.izforge.izpack.installer.ProcessPanelWorker$ExecutableClass.run(ProcessPanelWorker.java:765)
	at com.izforge.izpack.installer.ProcessPanelWorker$ProcessingJob.run(ProcessPanelWorker.java:516)
	at com.izforge.izpack.installer.ProcessPanelWorker.runJob(ProcessPanelWorker.java:462)
	at com.izforge.izpack.installer.ProcessPanelWorker.run(ProcessPanelWorker.java:388)
	at com.izforge.izpack.panels.ProcessPanelConsoleHelper.runConsole(ProcessPanelConsoleHelper.java:126)
	at com.izforge.izpack.installer.ConsoleInstaller.iterateAndPerformAction(ConsoleInstaller.java:278)
	at com.izforge.izpack.installer.ConsoleInstaller.doInstall(ConsoleInstaller.java:602)
	at com.izforge.izpack.installer.ConsoleInstaller.run(ConsoleInstaller.java:737)
	at com.izforge.izpack.installer.Installer.main(Installer.java:139)
Caused by: java.io.FileNotFoundException: /home/pkremens/test (Is a directory)
	at java.io.FileInputStream.open(Native Method)
	at java.io.FileInputStream.<init>(FileInputStream.java:146)
	at com.redhat.installer.settings.MavenSettingsTransformer.makeBackup(MavenSettingsTransformer.java:209)
	at com.redhat.installer.settings.MavenSettingsTransformer.run(MavenSettingsTransformer.java:66)
	... 13 more

Moreover there no default maven repo and settings.xml location while installing EAP via console. In gui there is default repo "${HOME}/.m2/repository" and default settings.xml "${HOME}/.m2/settings.xml", but in console there are just empty lines.

Comment 1 Francisco Canas 2013-10-11 15:30:54 UTC
I've added a touch of extra validation in the maven repo settings: It won't pass validation if the user enters a dir for his settings.xml instead of a proper file.

I have also added default repo paths in the -console installer to align it with the default paths in the GUI.

Comment 2 Petr Kremensky 2013-10-18 12:57:34 UTC
Verified on EAP 6.2.0.ER6 installer.