1

我使用以下命令创建了一个项目

mvn archetype:generate -B -DarchetypeGroupId=org.appfuse.archetypes -DarchetypeArtifactId=appfuse-light-spring-security-archetype -DarchetypeVersion=2.2.1 -DgroupId=com.app.PROJECT1 -DartifactId=PROJECT1 -DarchetypeRepository= https:// /oss.sonatype.org/content/repositories/appfuse

然后我在输入后在eclipse中打开它mvn eclipse:eclipse

在 pom.xml 我看到以下错误,我该如何解决这个问题。

1.

- Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: 
org.apache.maven.plugins:maven-resources-plugin:2.5:testResources (execution: default-
testResources, phase: process-test-resources)
- Plugin execution not covered by lifecycle configuration: 
org.apache.maven.plugins:maven-resources-plugin:2.5:resources (execution: default-
 resources, phase: process-resources)

2.

- cution not covered by lifecycle configuration: org.codehaus.mojo:dbunit-
 maven-plugin:1.0-beta-3:operation (execution: test-compile, phase: test-compile)

3.

- Plugin execution not covered by lifecycle configuration: 
 org.codehaus.mojo:hibernate3-maven-plugin:2.2:hbm2ddl (execution: default, phase: 
 process-test-resources)

4.

- Multiple annotations found at this line:
- Plugin execution not covered by lifecycle configuration: 
org.apache.maven.plugins:maven-compiler-plugin:2.4:testCompile (execution: default-
testCompile, phase: test-compile)
- Plugin execution not covered by lifecycle configuration: 
org.apache.maven.plugins:maven-compiler-plugin:2.4:compile (execution: default-compile, 
 phase: compile)

5.

Plugin execution not covered by lifecycle configuration: org.zeroturnaround:javarebel-
 maven-plugin:1.0.5:generate (execution: generate-rebel-xml, phase: process-resources)

问题2。

当我在 localhost 中运行它时,我在下面包含了应用程序的屏幕截图,但我没有看到 CSS 在这里工作,因为 UI 很乱。我该如何解决这个问题?

在此处输入图像描述

问题 3。

全新安装时出现以下错误

[ERROR] Failed to execute goal org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation (test-compile) on project PROJECT1: Error executing database operation: CLEAN_INSERT: Database may be already in use: "Locked by another process". Possible solutions: close all other connection(s); use the server mode [90020-170] -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal org.codehaus.mojo:dbunit-maven-plugin:1.0-beta-3:operation (test-compile) on project PROJECT1: Error executing database operation: CLEAN_INSERT
4

2 回答 2

1

我相信#1的答案与我刚刚在邮件列表上发布的答案相似。

您可以在下面的 URL 中找到更多信息。

https://www.eclipse.org/m2e/documentation/m2e-execution-not-covered.html

<pluginManagement>
    <plugins>
        <!--This plugin's configuration is used to store Eclipse m2e settings
        only. It has no influence on the Maven build itself.-->
        <plugin>
            <groupId>org.eclipse.m2e</groupId>
            <artifactId>lifecycle-mapping</artifactId>
            <version>1.0.0</version>
            <configuration>
                <lifecycleMappingMetadata>
                    <pluginExecutions>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>dbunit-maven-plugin</artifactId>
                                <versionRange>[1.0-beta-3,)</versionRange>
                                <goals>
                                    <goal>operation</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore/>
                            </action>
                        </pluginExecution>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>hibernate3-maven-plugin</artifactId>
                                <versionRange>[2.2,)</versionRange>
                                <goals>
                                    <goal>hbm2ddl</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore/>
                            </action>
                        </pluginExecution>
                        <pluginExecution>
                            <pluginExecutionFilter>
                                <groupId>org.codehaus.mojo</groupId>
                                <artifactId>native2ascii-maven-plugin</artifactId>
                                <versionRange>[1.0-beta-1,)</versionRange>
                                <goals>
                                    <goal>native2ascii</goal>
                                </goals>
                            </pluginExecutionFilter>
                            <action>
                                <ignore/>
                            </action>
                        </pluginExecution>
                    </pluginExecutions>
                </lifecycleMappingMetadata>
            </configuration>
        </plugin>
    </plugins>
</pluginManagement>
于 2014-12-19T16:52:41.843 回答
1

对问题 1 的回答:

您已经定义了M2Eclipse并不真正知道如何处理的插件执行。它知道如何处理默认执行(如何编译、将资源整合在一起,诸如此类),而不是您的自定义内容。您必须告诉它要做什么,这几乎可以归结为告诉它执行执行这些配置的插件执行。有三种方法可以解决这个问题,我刚刚注意到我之前已经回答过这个问题你可以在这里找到官方的解释。

回答问题 2:

不会是一个明确的答案。您的应用程序在哪里寻找 CSS?也许您必须了解 WAR 应用程序的相关源文件夹(假设您的项目是其中之一):

  • src/main/java: Java 类,编译成.class文件,最终会出现在你的类路径中,在WEB-INF/classes你的 WAR 文件中
  • src/main/resources: 资源文件,最终会出现在你的类路径中,在WEB-INF/classes你的 WAR 文件中
  • src/main/webapp: 资源文件,最终会出现在您的 Web 应用程序的根目录中

换句话说:如果您要制作src/main/webapp/some-folder/my-css.css,它将在 上可用http://localhost:8080/PROJECT1/some-folder/my-css.css

对问题 3 的回答:

不会是一个明确的答案。某些东西正在保留数据库。您确定应用程序已关闭?您是否打开了数据库工具来查看数据库?不要那样做:)

于 2014-12-19T07:37:11.953 回答