创建maven项目错误

时间:2011-09-06 17:24:51

标签: java hibernate maven struts2

mvn archetype:generate -B              
  -DgroupId=com.my-company.my-project           
     -DartifactId=my-project-domain           
     -DpackageName=com.company.project.domain    
            -DarchetypeGroupId=org.appfuse.archetypes    
            -DarchetypeArtifactId=appfuse-basic-struts    
       -DremoteRepositories=http://maven.rodcoffin.com/repo    
            -DarchetypeVersion=1.0.0

我输入上面的命令来创建我的maven-hibernate项目。在此之后,我进入我的项目文件夹并输入mvn eclipse:eclipse,然后输入mvn clean install

此后,我在eclipse IDE中点击了import --> existing projects in to workspace但我无法打开它,因为pom.xml不存在。

注意:当我输入mvn clean install时,我收到以下错误

[ERROR] Failed to execute goal org.codehaus.mojo:aspectj-maven-plugin:1.0:compil
e (default) on project my-project-domain: The artifact org.springframework:sprin
g-aspects referenced in aspectj plugin as an aspect library, is not found the pr
 oject dependencies -> [Help 1]
 [ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
 ch.
 [ERROR] Re-run Maven using the -X switch to enable full debug logging.
 [ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

修改

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-compiler-plugin:2.
    3.1:compile (default-compile) on project my-project-domain: Compilation failure
      [ERROR] \Users\Administrator\Documents\MYPROJECTS\my-project-domain\src\main
     \java\com\my-company\my-project\App.java:[1,14] ';' expected
     [ERROR] -> [Help 1]

即使它表示缺少;符号,当我检查App.java文件时,我没有发现任何语法错误。

2 个答案:

答案 0 :(得分:4)

  

aspectj中引用的工件org.springframework:spring-aspects   插件作为方面库,找不到项目依赖项

您需要为此插件工件添加依赖项

答案 1 :(得分:3)

尝试删除程序包路径中的连字符。