Maven 2 在netbeans 6.8中使用maven逐步创建4层项目

Maven 2 在netbeans 6.8中使用maven逐步创建4层项目,maven-2,netbeans,Maven 2,Netbeans,嗨,实际上我正在尝试在netbeans中创建maven项目,但当我要构建它时失败了,并给出消息“错误构建POM(可能不是这个项目的POM)”,所以我需要帮助 更新:以下是请求的信息: pom.xml: <?xml version="1.0" encoding="UTF-8"?> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instan

嗨,实际上我正在尝试在netbeans中创建maven项目,但当我要构建它时失败了,并给出消息“错误构建POM(可能不是这个项目的POM)”,所以我需要帮助

更新:以下是请求的信息:

pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">        
    <modelVersion>4.0.0</modelVersion>        
    <groupId>com.demo</groupId>
    <artifactId>DemoProject</artifactId>
    <version>1.0-SNAPSHOT</version>
    <packaging>pom</packaging>

    <name>DemoProject</name>
    <description>Demo Project</description>

    <modules>
        <module>DemoModel</module>
        <module>DemoDao</module>
        <module>DemoService</module>        
        <module>DemoWeb</module>
    </modules>
    <build>
        <resources>
            <resource>
                <filtering>true</filtering>
                <directory>src/test/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <filtering>true</filtering>
                <directory>src/main/resources</directory>
                <includes>
                    <include>**/*.properties</include>
                </includes>
            </resource>
            <resource>
                <directory>src/main/resources</directory>
                <excludes>
                    <exclude>**/*.properties</exclude>
                </excludes>
            </resource>
        </resources>
        <plugins>          
            <plugin>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>2.0</version>
                <configuration>
                    <source>1.5</source>
                    <target>1.5</target>
                </configuration>
            </plugin>
        </plugins>
    </build>
    <dependencies>

    </dependencies>
    <reporting>
        <plugins>
            <plugin>
                <artifactId>maven-surefire-report-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-pmd-plugin</artifactId>
                <configuration>
                    <targetJdk>${compileSource}</targetJdk>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.codehaus.mojo</groupId>
                <artifactId>cobertura-maven-plugin</artifactId>
            </plugin>
            <plugin>
                <artifactId>maven-checkstyle-plugin</artifactId>
            </plugin>
        </plugins>
    </reporting>

    <pluginRepositories>
        <pluginRepository>
            <id>maven-repo</id>
            <name>Maven repo</name>
            <url>http://repo1.maven.org/maven2</url>
        </pluginRepository>
        <pluginRepository>
            <id>java.net</id>
            <name>Java.net Repository for Maven2</name>
            <url>http://download.java.net/maven/1/</url>
            <layout>legacy</layout>
        </pluginRepository>

    </pluginRepositories>
    <developers>
   <developer>
            <id>ttinwala</id>
            <name>Taher Tinwala</name>
            <email>taher@demo.com</email>
            <organization>Demo Technologies Pvt. Ltd.</organization>
            <organizationUrl>http://www.demo.com</organizationUrl>
            <roles>
                <role>Developer</role>
            </roles>
        </developer>
    </developers>
</project>

问题可能是由于坏的(例如损坏的)元数据(因为
maven资源插件
肯定可用)

我建议删除
~/.m2/respository/org/apache/maven/plugins/maven resources plugin/
,然后重试

顺便说一句,您不需要声明(默认情况下您有):


马文回购
马文回购
http://repo1.maven.org/maven2

请提供完整的错误消息(在“错误生成POM(可能不是本项目的POM)”下面有有用的信息)。在你的问题中也张贴罪犯POM。以目前的状态回答这个问题是不可能的。
[ERROR]BUILD ERROR
------------------------------------------------------------------------
Error building POM (may not be this project's POM).


Project ID: org.apache.maven.plugins:maven-resources-plugin

Reason: POM 'org.apache.maven.plugins:maven-resources-plugin' not found in repository: Unable to download the artifact from any repository

  org.apache.maven.plugins:maven-resources-plugin:pom:2.3

from the specified remote repositories:
  central (http://repo1.maven.org/maven2),
  unknown-jars-temp-repo (file:C:\Documents and Settings\Administrator\Desktop\taher\demomodel/lib),
  hibernate-support (http://download.java.net/maven/2)

 for project org.apache.maven.plugins:maven-resources-plugin
<pluginRepository>
    <id>maven-repo</id>
    <name>Maven repo</name>
    <url>http://repo1.maven.org/maven2</url>
</pluginRepository>