|
23 | 23 | import java.util.function.Consumer; |
24 | 24 |
|
25 | 25 | import org.apache.commons.exec.CommandLine; |
| 26 | +import org.apache.commons.logging.Log; |
| 27 | +import org.apache.commons.logging.LogFactory; |
26 | 28 |
|
27 | 29 | import org.springframework.beans.factory.BeanNameAware; |
28 | 30 | import org.springframework.beans.factory.DisposableBean; |
|
42 | 44 | public class CommonsExecWebServerFactoryBean |
43 | 45 | implements SmartFactoryBean<CommonsExecWebServer>, DisposableBean, BeanNameAware { |
44 | 46 |
|
| 47 | + private static Log logger = LogFactory.getLog(CommonsExecWebServerFactoryBean.class); |
| 48 | + |
45 | 49 | private static final String DEFAULT_SPRING_BOOT_MAIN_CLASSNAME = "org.springframework.experimental.boot.server.exec.main.SpringBootApplicationMain"; |
46 | 50 |
|
47 | 51 | private String executable = currentJavaExecutable(); |
@@ -150,11 +154,22 @@ public void setBeanName(String beanName) { |
150 | 154 | } |
151 | 155 |
|
152 | 156 | private void defaultApplicationConfiguration(String beanName, String extension) { |
153 | | - ResourceClasspathEntry defaultApplicationConfig = new ResourceClasspathEntry( |
154 | | - "testjars/" + beanName + "/application." + extension, "application." + extension); |
| 157 | + String existingResourceName = "testjars/" + beanName + "/application." + extension; |
| 158 | + String classpathResourceName = "application." + extension; |
| 159 | + ResourceClasspathEntry defaultApplicationConfig = new ResourceClasspathEntry(existingResourceName, |
| 160 | + classpathResourceName); |
155 | 161 | if (defaultApplicationConfig.exists()) { |
| 162 | + if (logger.isDebugEnabled()) { |
| 163 | + logger.debug("Adding default resource " + existingResourceName + " as " + classpathResourceName); |
| 164 | + } |
156 | 165 | classpath((cp) -> cp.entries(defaultApplicationConfig)); |
157 | 166 | } |
| 167 | + else { |
| 168 | + if (logger.isDebugEnabled()) { |
| 169 | + logger.debug("The default resource was not found " + existingResourceName |
| 170 | + + " and will not be added to the classpath as " + classpathResourceName); |
| 171 | + } |
| 172 | + } |
158 | 173 | } |
159 | 174 |
|
160 | 175 | @Override |
|
0 commit comments