Developer is using App Advisor and getting error:
app advisor -v
Exception in thread "main" org.springframework.beans.factory.UnsatisfiedDependencyException: Error creating bean with name 'mappingCreateCommand': Unsatisfied dependency expressed through field 'versionQueryService': Error creating bean with name 'versionQueryService': Unsatisfied dependency expressed through constructor parameter 0: Error creating bean with name 'mavenRepositoryService': null
at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveValue(AutowiredFieldValueResolver.java:181)
at org.springframework.beans.factory.aot.AutowiredFieldValueResolver.resolveAndSet(AutowiredFieldValueResolver.java:154)
at com.vmware.tanzu.spring.advisor.cli.mapping.MappingCreateCommand__Autowiring.apply(MappingCreateCommand__Autowiring.java:17)
at org.springframework.beans.factory.support.InstanceSupplier$1.get(InstanceSupplier.java:72)
at org.springframework.beans.factory.support.DefaultListableBeanFactory.obtainInstanceFromSupplier(DefaultListableBeanFactory.java:1021)
at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.obtainFromSupplier(AbstractAutowireCapableBeanFactory.java:1246)
Example settings.xml to reproduce the issue, for config file:
<?xml version="1.0"?>
<settings>
<servers>
<server>
<id>central</id>
</server>
</servers>
</settings>
The above config is valid per schema but contians no username/password property.
App advisor fails and does not load.
This exception is caused by a bug in Spring App Advisor where it does not recognize lack of username and password as a valid setting.
The workaround is to simply use a blank username and password when using a Maven repository that does not require authentication.
Example setting.xml to fix:
<?xml version="1.0"?>
<settings>
<servers>
<server>
<id>central</id>
<username/>
<password/>
</server>
</servers>
</settings>
A defect is logged against Spring App Advisor for fix in a future release.