未找到 EntityManager 提供程序

问题描述 投票:0回答:1
java hibernate jpa entitymanager jpa-2.1
1个回答
0
投票

我终于解决了我的问题。

maven-dependency-plugin
应该这样配置:

            <!-- Copy dependencies -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-dependency-plugin</artifactId>
                <executions>
                    <execution>
                        <id>copy-dependencies</id>
                        <phase>package</phase>
                        <goals>
                            <goal>copy-dependencies</goal>
                        </goals>
                        <configuration>
                            <outputDirectory>${project.build.directory}/lib</outputDirectory>
                            <includeScope>runtime</includeScope>
                        </configuration>
                    </execution>
                </executions>
            </plugin>

注意: 应该配置复制

runtime
依赖项

© www.soinside.com 2019 - 2024. All rights reserved.