'包装'的价值'jar'无效。聚合器项目需要'pom'作为包装

时间:2015-09-07 17:18:51

标签: maven

我的项目存在问题,即项目pom文件有错误,说明打包不应解析为jar而是pom。我需要我的项目生成一个目标'jar'而我没有任何子模块,但是这个错误是由另一个错误生成的:Child module of pom.xml does not exist现在这里是我的pom文件:

<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/xsd/maven-4.0.0.xsd">
    <modelVersion>4.0.0</modelVersion>
    <groupId>com.itworx.bigdata</groupId>
    <artifactId>MediaSensor</artifactId>
    <version>0.0.1</version>
    <name>MediaSensor</name>
    <description>Complete and Integrated Spark Flow of Big Data</description>
    <repositories>
        <repository>
            <id>cloudera</id>
            <url>https://repository.cloudera.com/artifactory/cloudera-repos/</url>
        </repository>
    </repositories>
    <!-- please stick to the CDH version and this repositry do not use apache repos -->
    <!-- All CDH jars in this link http://www.cloudera.com/content/cloudera/en/documentation/core/latest/topics/cdh_vd_cdh5_maven_repo.html#concept_jhf_dcz_bs_unique_2-->
    <dependencies>
        <!-- following jar is implicitly needed by one of spark ref -->
        <dependency>
            <groupId>jdk.tools</groupId>
            <artifactId>jdk.tools</artifactId>
            <scope>system</scope>
            <version>1.6.0_24</version>
            <systemPath>C:/Program Files/Java/jdk1.7.0_51/lib/tools.jar</systemPath>
        </dependency>

        <dependency>
            <groupId>com.itworx.epenta</groupId>
            <artifactId>ePenta</artifactId>
            <scope>system</scope>
            <version>1.1</version>
            <systemPath>D:/Capability_Building/Media_Sensor_Development/temp_space/ePenta.jar</systemPath>
        </dependency>
        <dependency>
            <groupId>com.itworx.lucene</groupId>
            <artifactId>solr-writer</artifactId>
            <scope>system</scope>
            <version>1.1</version>
            <systemPath>D:/Capability_Building/Media_Sensor_Development/temp_space/spark-solr-1.0-SNAPSHOT-shaded.jar
            </systemPath>
        </dependency>
        <dependency>
            <groupId>org.json</groupId>
            <artifactId>json</artifactId>
            <version>20141113</version>
        </dependency>

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-core_2.10</artifactId>
            <version>1.3.0-cdh5.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming_2.10</artifactId>
            <version>1.3.0-cdh5.4.2</version>
        </dependency>
        <!-- <dependency>   -->
        <!--   <groupId>org.apache.spark</groupId>  -->
        <!--   <artifactId>spark-streaming-twitter_2.10</artifactId>  -->
        <!--   <version>1.3.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->

        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming-kafka-assembly_2.10</artifactId>
            <version>1.3.0-cdh5.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.spark</groupId>
            <artifactId>spark-streaming-kafka_2.10</artifactId>
            <version>1.3.0-cdh5.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.htrace</groupId>
            <artifactId>htrace-core</artifactId>
            <version>3.1.0-incubating</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-server</artifactId>
            <version>1.0.0-cdh5.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-annotations</artifactId>
            <version>1.0.0-cdh5.4.2</version>
        </dependency>

        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-hadoop-compat</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-hadoop2-compat</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-it</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-common</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->

        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-client</artifactId>
            <version>1.0.0-cdh5.4.2</version>
        </dependency>
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-checkstyle</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->

        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-examples</artifactId>
            <version>1.0.0-cdh5.4.2</version>
        </dependency>
        <dependency>
            <groupId>org.apache.hbase</groupId>
            <artifactId>hbase-prefix-tree</artifactId>
            <version>1.0.0-cdh5.4.2</version>
        </dependency>

        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-protocol</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-rest</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-shell</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-testing-util</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
        <!-- <dependency> -->
        <!--   <groupId>org.apache.hbase</groupId>  -->
        <!--   <artifactId>hbase-thrift</artifactId>  -->
        <!--  <version>1.0.0-cdh5.4.2</version>  -->
        <!-- </dependency> -->
    </dependencies>

    <build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>2.2</version>
                <configuration>
                    <shadedArtifactAttached>false</shadedArtifactAttached>
                    <outputFile>D:/Capability_Building/Media_Sensor_Development/temp_space/MediaSensorShaded.jar
                    </outputFile>
                    <artifactSet>
                        <includes>
                            <include>*:*</include>
                        </includes>
                    </artifactSet>
                    <filters>
                        <filter>
                            <artifact>*:*</artifact>
                            <excludes>
                                <exclude>META-INF/*.SF</exclude>
                                <exclude>META-INF/*.DSA</exclude>
                                <exclude>META-INF/*.RSA</exclude>
                            </excludes>
                        </filter>
                    </filters>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.ServicesResourceTransformer"/>
                                <transformer
                                        implementation="org.apache.maven.plugins.shade.resource.AppendingTransformer">
                                    <resource>reference.conf</resource>
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
            </plugin>
        </plugins>
    </build>

    <modules>
        <module>?</module>
    </modules>
</project>

有人可以帮忙吗?

1 个答案:

答案 0 :(得分:3)

就像@ florian-schaetz在评论中指出的那样,你在pom的最后有这个:

<modules>
    <module>?</module>
</modules>

如果您不打算使用子模块,则应将其删除。通过拥有它你迫使Maven认为你的pom是一个聚合pom(它显然不是)。