pull/6721/merge
Phillip Webb 8 years ago
parent 08fbe87290
commit 951f051df9

@ -140,8 +140,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
/** /**
* Flag to indicate if the run processes should be forked. {@code fork } is * Flag to indicate if the run processes should be forked. {@code fork } is
* automatically enabled if an agent or jvmArguments are specified, or if * automatically enabled if an agent or jvmArguments are specified, or if devtools is
* devtools is present. * present.
* @since 1.2 * @since 1.2
*/ */
@Parameter(property = "fork") @Parameter(property = "fork")
@ -167,8 +167,7 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
getLog().debug("skipping run as per configuration."); getLog().debug("skipping run as per configuration.");
return; return;
} }
final String startClassName = getStartClass(); run(getStartClass());
run(startClassName);
} }
/** /**
@ -237,8 +236,8 @@ public abstract class AbstractRunMojo extends AbstractDependencyFilterMojo {
} }
/** /**
* Log a warning indicating that fork mode has been explicitly disabled * Log a warning indicating that fork mode has been explicitly disabled while some
* while some conditions are present that require to enable it. * conditions are present that require to enable it.
* @see #enableForkByDefault() * @see #enableForkByDefault()
*/ */
protected void logDisabledFork() { protected void logDisabledFork() {

@ -124,8 +124,13 @@ public class RunMojo extends AbstractRunMojo {
try { try {
URL[] urls = getClassPathUrls(); URL[] urls = getClassPathUrls();
URLClassLoader classLoader = new URLClassLoader(urls); URLClassLoader classLoader = new URLClassLoader(urls);
try {
return (classLoader.findResource(RESTARTER_CLASS_LOCATION) != null); return (classLoader.findResource(RESTARTER_CLASS_LOCATION) != null);
} }
finally {
classLoader.close();
}
}
catch (Exception ex) { catch (Exception ex) {
return false; return false;
} }

@ -25,9 +25,6 @@ import java.util.Set;
import javax.sql.DataSource; import javax.sql.DataSource;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import org.springframework.orm.jpa.JpaVendorAdapter; import org.springframework.orm.jpa.JpaVendorAdapter;
import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean; import org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean;
import org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager; import org.springframework.orm.jpa.persistenceunit.PersistenceUnitManager;
@ -48,9 +45,6 @@ import org.springframework.util.ClassUtils;
*/ */
public class EntityManagerFactoryBuilder { public class EntityManagerFactoryBuilder {
private static final Log logger = LogFactory
.getLog(EntityManagerFactoryBuilder.class);
private final JpaVendorAdapter jpaVendorAdapter; private final JpaVendorAdapter jpaVendorAdapter;
private final PersistenceUnitManager persistenceUnitManager; private final PersistenceUnitManager persistenceUnitManager;
@ -211,7 +205,8 @@ public class EntityManagerFactoryBuilder {
entityManagerFactoryBean.getJpaPropertyMap().putAll(this.properties); entityManagerFactoryBean.getJpaPropertyMap().putAll(this.properties);
URL rootLocation = EntityManagerFactoryBuilder.this.persistenceUnitRootLocation; URL rootLocation = EntityManagerFactoryBuilder.this.persistenceUnitRootLocation;
if (rootLocation != null) { if (rootLocation != null) {
entityManagerFactoryBean.setPersistenceUnitRootLocation(rootLocation.toString()); entityManagerFactoryBean
.setPersistenceUnitRootLocation(rootLocation.toString());
} }
if (EntityManagerFactoryBuilder.this.callback != null) { if (EntityManagerFactoryBuilder.this.callback != null) {
EntityManagerFactoryBuilder.this.callback EntityManagerFactoryBuilder.this.callback

Loading…
Cancel
Save