我使用以下命令行创建了一个j2ee-simple项目,该项目使用maven模板:
mvn archetype:create -DgroupId=com.hardik -DartifactId=ActionBazaar -DarchetypeArtifactId=maven-archetype-j2ee-simple
当我尝试在创建的项目文件夹中运行安装目标时,会出现有关站点模块中不存在模型文件的错误。下面描述了这个错误。
如果我从根pom.xml中删除站点模块,它就可以正常工作。有没有正确的方法来解决这个问题?
如果我想保留站点模块以便为我的项目制作网站怎么办?
以下是错误信息:
$ mvn install
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[ERROR] FATAL ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: unknown
Reason: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
[INFO] ------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.reactor.MavenExecutionException: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:432)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:300)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:137)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:356)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
at java.lang.reflect.Method.invoke(Method.java:597)
at org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
at org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.project.ProjectBuildingException: Could not find the model file '/home/hardik/projects/ActionBazaar/site'. for project unknown
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1585)
at org.apache.maven.project.DefaultMavenProjectBuilder.buildFromSourceFileInternal(DefaultMavenProjectBuilder.java:506)
at org.apache.maven.project.DefaultMavenProjectBuilder.build(DefaultMavenProjectBuilder.java:200)
at org.apache.maven.DefaultMaven.getProject(DefaultMaven.java:632)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:515)
at org.apache.maven.DefaultMaven.collectProjects(DefaultMaven.java:588)
at org.apache.maven.DefaultMaven.getProjects(DefaultMaven.java:419)
... 11 more
Caused by: java.io.FileNotFoundException: /home/hardik/projects/ActionBazaar/site (No such file or directory)
at java.io.FileInputStream.open(Native Method)
at java.io.FileInputStream.<init>(FileInputStream.java:106)
at hidden.org.codehaus.plexus.util.xml.XmlReader.<init>(XmlReader.java:124)
at hidden.org.codehaus.plexus.util.xml.XmlStreamReader.<init>(XmlStreamReader.java:67)
at hidden.org.codehaus.plexus.util.ReaderFactory.newXmlReader(ReaderFactory.java:113)
at org.apache.maven.project.DefaultMavenProjectBuilder.readModel(DefaultMavenProjectBuilder.java:1580)
... 17 more
[INFO] ------------------------------------------------------------------------
[INFO] Total time: < 1 second
[INFO] Finished at: Sat Jul 04 07:59:37 CEST 2009
[INFO] Final Memory: 1M/4M
[INFO] ----