#104 - Fix jpa eclipselink example build.
Added main method to eclipselink JPA example to prevent “Unable to find main class” error from spring-boot repacking during build.
This commit is contained in:
@@ -18,6 +18,7 @@ package example.eclipselink;
|
||||
import java.util.Collections;
|
||||
import java.util.Map;
|
||||
|
||||
import org.springframework.boot.SpringApplication;
|
||||
import org.springframework.boot.autoconfigure.SpringBootApplication;
|
||||
import org.springframework.boot.autoconfigure.orm.jpa.JpaBaseConfiguration;
|
||||
import org.springframework.orm.jpa.vendor.AbstractJpaVendorAdapter;
|
||||
@@ -51,4 +52,12 @@ public class Application extends JpaBaseConfiguration {
|
||||
// Turn off dynamic weaving to disable LTW lookup in static weaving mode
|
||||
return Collections.singletonMap("eclipselink.weaving", "false");
|
||||
}
|
||||
|
||||
public static void main(String[] args) {
|
||||
|
||||
CustomerRepository repository = SpringApplication.run(Application.class, args).getBean(CustomerRepository.class);
|
||||
repository.save(new Customer("Richard", "Feynman"));
|
||||
|
||||
System.out.println(repository.findAll());
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user