0

现在,这是我的 pom(.xml) 配置:

<build>

    <resources>
        <resource>
            <directory>src/resources/development</directory>
            <filtering>true</filtering>
        </resource>
    </resources>

    <plugins>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-eclipse-plugin</artifactId>
            <version>2.9</version>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-javadoc-plugin</artifactId>
            <version>2.8</version>
            <executions>
                <execution>
                    <id>attach-javadocs</id>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
        </plugin>

        <plugin>
            <inherited>true</inherited>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-source-plugin</artifactId>
            <version>2.2.1</version>
            <executions>
                <execution>
                    <id>attach-sources</id>
                    <phase>verify</phase>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration>
                <attach>true</attach>
            </configuration>
        </plugin>

        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-install-plugin</artifactId>
            <version>2.3.1</version>
            <configuration>
                <createChecksum>true</createChecksum>
            </configuration>
        </plugin>
        <plugin>
      <artifactId>maven-assembly-plugin</artifactId>
      <configuration>
        <archive>
          <manifest>
            <mainClass>mypackage.MyMainClass</mainClass>
      </manifest>
    </archive>
    <descriptorRefs>
      <descriptorRef>jar-with-dependencies</descriptorRef>
    </descriptorRefs>
  </configuration>
</plugin>
 <plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-dependency-plugin</artifactId>
    <version>2.8</version>
    <executions>
      <execution>
        <id>copy-dependencies</id>
        <phase>package</phase>
        <goals>
          <goal>copy-dependencies</goal>
        </goals>
        <configuration>
          <!-- configure the plugin here -->
        </configuration>
      </execution>
    </executions>
  </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-jar-plugin</artifactId>
            <version>2.3.1</version>
            <executions>
                <execution>
                    <goals>
                        <goal>jar</goal>
                    </goals>
                </execution>
            </executions>
            <configuration></configuration>
        </plugin>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-compiler-plugin</artifactId>
            <version>3.0</version>
            <configuration>
                <source>1.6</source>
                <target>1.6</target>
            </configuration>
        </plugin>

        <!--
        Plugin that can be configured to prevent deployment of artifact to the
        maven2 repository.
        -->
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-deploy-plugin</artifactId>
            <version>2.5</version>
        </plugin>

    </plugins>

</build>

<dependencies>
    <dependency>
        <groupId>com.vantage.iseek.content</groupId>
        <artifactId>iseek-content-publisher-ds</artifactId>
        <version>1.0.1-SNAPSHOT</version>
    </dependency>
    <dependency> 
        <groupId>com.vantage.iseek.content</groupId>
        <artifactId>iseek-content-api</artifactId>
        <version>1.0.1-SNAPSHOT</version>
    </dependency>

    <dependency>
        <groupId>com.restfb</groupId>
        <artifactId>restfb</artifactId>
        <version>1.6.11</version>
    </dependency>

    <dependency>
        <groupId>junit</groupId>
        <artifactId>junit</artifactId>
        <version>4.5</version>
        <scope>testing</scope>
    </dependency>

    <dependency>
        <groupId>org.apache.commons</groupId>
        <artifactId>commons-lang3</artifactId>
        <version>3.1</version>
    </dependency>

    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-api</artifactId>
        <version>1.7.2</version>
    </dependency>

    <dependency>
        <groupId>postgresql</groupId>
        <artifactId>postgresql</artifactId>
        <version>9.1-901-1.jdbc4</version>
    </dependency>

    <!-- Route commons over slf -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>jcl-over-slf4j</artifactId>
        <version>1.7.2</version>
        <scope>runtime</scope>
    </dependency>

    <!-- Use log4j as binding -->
    <dependency>
        <groupId>org.slf4j</groupId>
        <artifactId>slf4j-log4j12</artifactId>
        <version>1.7.2</version>
    </dependency>

</dependencies>

<repositories>

    <repository>
        <id>nexus</id>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <url>http://maven2.vantage.com:8080/repo/content/groups/public</url>
    </repository>

    <repository>
        <id>nexus-snapshots</id>
        <releases>
            <enabled>false</enabled>
        </releases>
        <url>http://maven2.vantage.com:8080/repo/content/groups/public</url>
    </repository>

</repositories>

<pluginRepositories>

    <pluginRepository>
        <id>nexus</id>
        <snapshots>
            <enabled>false</enabled>
        </snapshots>
        <url>http://maven2.vantage.com:8080/repo/content/groups/public</url>
    </pluginRepository>

    <pluginRepository>
        <id>nexus-snapshots</id>
        <releases>
            <enabled>false</enabled>
        </releases>
        <url>http://maven2.vantage.com:8080/repo/content/groups/public</url>
    </pluginRepository>

</pluginRepositories>

<distributionManagement>

    <!-- use the following if you ARE NOT deploying a snapshot version. -->
    <repository>
        <id>nexus</id>
        <name>Vantage Nexus Release Repository</name>
        <url>
            http://maven2.vantage.com:8080/repo/content/repositories/vantage-release
        </url>
    </repository>

    <!-- use the following if you ARE deploying a snapshot version. -->
    <snapshotRepository>
        <id>nexus-snapshot</id>
        <name>Vantage Nexus Snapshot Repository</name>
        <url>
            http://maven2.vantage.com:8080/repo/content/repositories/vantage-snapshot
        </url>
        <uniqueVersion>false</uniqueVersion>
    </snapshotRepository>

</distributionManagement>

<profiles>

    <profile>
        <id>env-development</id>
        <properties>
            <downloadSources>true</downloadSources>
            <downloadJavadocs>true</downloadJavadocs>
        </properties>
        <activation>
            <activeByDefault>true</activeByDefault>
            <property>
                <name>env</name>
                <value>development</value>
            </property>
        </activation>
    </profile>

</profiles>

`

当我运行时:mvn clean assembly:single它给出以下错误消息:
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project iseek-content-fetcher-fb: Failed to create assembly: Failed to resolve dependencies for project: com.vantage.iseek.content:iseek-content-fetcher-fb:jar:1.0.1-SNAPSHOT: Missing:
[ERROR] ----------
[ERROR] 1) com.vantage.iseek.content:iseek-content-publisher-ds:jar:1.0.1-SNAPSHOT
[ERROR]
[ERROR] Try downloading the file manually from the project website.
[ERROR]
[ERROR] Then, install it using the command:
[ERROR] mvn install:install-file -DgroupId=com.vantage.iseek.content -DartifactId=iseek-content-publisher-ds -Dversion=1.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file
[ERROR]
[ERROR] Alternatively, if you host your own repository you can deploy the file there:
[ERROR] mvn deploy:deploy-file -DgroupId=com.vantage.iseek.content -DartifactId=iseek-content-publisher-ds -Dversion=1.0.1-SNAPSHOT -Dpackaging=jar -Dfile=/path/to/file -Durl=[url] -DrepositoryId=[id]
[ERROR]
[ERROR] Path to dependency:
[ERROR] 1) com.vantage.iseek.content:iseek-content-fetcher-fb:jar:1.0.1-SNAPSHOT
[ERROR] 2) com.vantage.iseek.content:iseek-content-publisher-ds:jar:1.0.1-SNAPSHOT
[ERROR]
[ERROR] ----------
[ERROR] 1 required artifact is missing.
[ERROR]
[ERROR] for artifact:
[ERROR] com.vantage.iseek.content:iseek-content-fetcher-fb:jar:1.0.1-SNAPSHOT
[ERROR]
[ERROR] from the specified remote repositories:
[ERROR] nexus (http://maven2.vantage.com:8080/repo/content/groups/public, releases=true, snapshots=false),
[ERROR] central (http://repo.maven.apache.org/maven2, releases=true, snapshots=false)

但是在目标目录中,我总是在运行时找到 iseek-content-fetcher-fb-1.0.1-SNAPSHOT.jarmvn install
有人可以指出我缺少什么吗?

4

1 回答 1

0

似乎您有一个正在处理的 maven-Projekt“iseek-content-fetcher-fb”,并且您通过在另一个本地项目中的依赖项进行引用。

Maven 不会扫描 eclipse 目标文件夹中的项目。它只知道本地存储库“~/.m2”或远程存储库(如http://mvnrepository.com/ )中的 maven-artifacts 。

您必须使用以下命令编译并安装您的 maven 项目到本地存储库: mvn install

install - install the package into the local repository, for use as a dependency in other projects locally 
于 2014-07-31T11:10:24.350 回答