无法在eclipse neo中创建Maven项目

时间:2017-05-25 06:50:11

标签: java maven drools

嗨,我的系统中有eclipse neo和java1.8。我在日食中添加了drools 6.5 jar,但我无法创建maven项目。

有人可以让我知道创建maven项目的完整过程,还是忘记了一些事情?

2 个答案:

答案 0 :(得分:0)

确保您的IDE中已安装Maven Integration for Eclipse插件(默认情况下应在Eclipse Neon中安装)。 为了验证这一点,请导航到Window->偏好设置并确保左侧偏好设置列表中列出了Maven。 如果未安装maven,请使用Eclipse Marketplace进行安装。 如果是,只需通过导航到File-> New-> Other-> Maven-> Maven Project来创建一个新的Maven项目。

答案 1 :(得分:0)

您还可以从命令行创建项目

mvn archetype:generate

然后将其作为maven项目在eclipse中导入

下面的示例命令输出
$ mvn archetype:generate
[INFO] Scanning for projects...
[INFO] Searching repository for plugin with prefix: 'archetype'.
[INFO] ------------------------------------------------------------------------
[INFO] Building Maven Default Project
[INFO]    task-segment: [archetype:generate] (aggregator-style)
[INFO] ------------------------------------------------------------------------
[INFO] Preparing archetype:generate
[INFO] No goals needed for project - skipping
[INFO] Setting property: classpath.resource.loader.class => 'org.codehaus.plexus.velocity.ContextClassLoaderResourceLoader'.
[INFO] Setting property: velocimacro.messages.on => 'false'.
[INFO] Setting property: resource.loader => 'classpath'.
[INFO] Setting property: resource.manager.logwhenfound => 'false'.
[INFO] [archetype:generate]
[INFO] Generating project in Interactive mode
[INFO] No archetype defined. Using maven-archetype-quickstart (org.apache.maven.archetypes:maven-archetype-quickstart:1.0)
Choose archetype:
1: http://cocoon.apache.org -> cocoon-22-archetype-block-plain (Creates an empty Cocoon block; useful if you want to add another block to a Cocoon application)
2: http://cocoon.apache.org -> cocoon-22-archetype-block (Creates a Cocoon block containing some small samples)
3: http://cocoon.apache.org -> cocoon-22-archetype-webapp (Creates a web application configured to host Cocoon blocks. Just add the block dependencies)
Choose a number or apply filter (format: [groupId:]artifactId, case sensitive contains): 1
Downloading: http://localhost:8081/nexus/content/groups/mac/org/apache/cocoon/cocoon-22-archetype-block-plain/1.0.0/cocoon-22-archetype-block-plain-1.0.0.jar
13K downloaded
Define value for groupId: : com.company
Define value for artifactId: : example
Define value for version:  1.0-SNAPSHOT: :
Define value for package:  com.company: : com.company.example
Confirm properties configuration:
groupId: com.company
artifactId: example
version: 1.0-SNAPSHOT
package: com.company.example
 Y: :
[INFO] ----------------------------------------------------------------------------
[INFO] Using following parameters for creating OldArchetype: cocoon-22-archetype-block-plain:1.0.0
[INFO] ----------------------------------------------------------------------------
[INFO] Parameter: groupId, Value: com.company
[INFO] Parameter: packageName, Value: com.company.example
[INFO] Parameter: package, Value: com.company.example
[INFO] Parameter: artifactId, Value: example
[INFO] Parameter: basedir, Value: /private/tmp/archetype
[INFO] Parameter: version, Value: 1.0-SNAPSHOT
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/pom.xml [line 20,column 6] : $Id is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/resources/META-INF/cocoon/spring/block-servlet-service.xml [line 20,column 6] : $Id is not a valid reference.
[WARNING] org.apache.velocity.runtime.exception.ReferenceException: reference : template = archetype-resources/src/main/resources/META-INF/cocoon/spring/block-application-context.xml [line 18,column 6] : $Id is not a valid reference.
[INFO] OldArchetype created in dir: /private/tmp/archetype/example
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESSFUL
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1 minute 20 seconds
[INFO] Finished at: Tue Sep 09 19:10:51 CEST 2008
[INFO] Final Memory: 8M/15M
[INFO] ------------------------------------------------------------------------