在SVN存储库中找不到工件

时间:2013-09-13 13:55:23

标签: java xml svn maven

我想将我的项目设置为依赖于已经部署到SVN存储库的另一个项目,但问题出现了,就像这样说:

SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.
[INFO] Scanning for projects...
[INFO]                                                                         
[INFO] ------------------------------------------------------------------------
[INFO] Building ForSentProject 0.0.1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: https://Mac-PC/svn/Project/com/mycompany/TempT/0.0.1-SNAPSHOT/TempT-0.0.1-SNAPSHOT.pom
[WARNING] The POM for com.mycompany:TempT:jar:0.0.1-SNAPSHOT is missing, no dependency information available
Downloading: https://Mac-PC/svn/Project/com/mycompany/TempT/0.0.1-SNAPSHOT/TempT-0.0.1-SNAPSHOT.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.212s
[INFO] Finished at: Fri Sep 13 20:34:55 ICT 2013
[INFO] Final Memory: 6M/111M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project ForSentProject: Could not resolve dependencies for project MyMaven.Project.app:ForSentProject:jar:0.0.1-SNAPSHOT: Could not find artifact com.mycompany:TempT:jar:0.0.1-SNAPSHOT in Repo (https://Mac-PC/svn/Project) -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException

它说无法找到神器。

我的pom.xml是这样的:

<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>MyMaven.Project.app</groupId>
  <artifactId>ForSentProject</artifactId>
  <version>0.0.1-SNAPSHOT</version>
  <packaging>jar</packaging>

  <name>ForSentProject</name>
  <url>http://maven.apache.org</url>
  <properties>
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
  </properties>

  <dependencies>
    <dependency>
      <groupId>junit</groupId>
      <artifactId>junit</artifactId>
      <version>3.8.1</version>
      <scope>test</scope>
    </dependency>

    <dependency>
        <groupId>com.mycompany</groupId>
        <artifactId>TempT</artifactId>
        <version>0.0.1-SNAPSHOT</version>
    </dependency>
  </dependencies>

     <repositories>
      <repository>
         <id>Repo</id>
         <url>https://Mac-PC/svn/Project</url>
      </repository>
   </repositories>

  <build>
    <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-surefire-plugin</artifactId>
            <version>2.12.4</version>
        </plugin>
    </plugins>
  </build>
</project>

和Setting.xml是这样的:

<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
  xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
  xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0
                      http://maven.apache.org/xsd/settings-1.0.0.xsd">

    <servers>
     <server>
          <id>Repo</id>
          <username>pee</username>
          <password>pee</password>
        </server>
        <server>
          <id>Repo-releases</id>
          <username>pee</username>
          <password>pee</password>
        </server>
      </servers>


</settings>

我部署的pom.xml是这样的:

<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.mycompany</groupId>
    <artifactId>TempT</artifactId>
    <version>0.0.1-SNAPSHOT</version>
    <packaging>jar</packaging>

    <name>TempT</name>
    <url>http://maven.apache.org</url>
    <properties>
        <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
    </properties>

    <!--............... -->
    <!-- <scm> -->
    <!-- <url>http://www.svn.com</url> -->
    <!-- <connection>scm:svn:https://Mac-PC/svn/Project/MyMaven/Project</connection> -->
    <!-- <developerConnection>scm:svn:https://Mac-PC/svn/Project/MyMaven/Project</developerConnection> -->
    <!-- </scm> -->

    <distributionManagement>
        <repository>
          <uniqueVersion>false</uniqueVersion>
            <id>Repo-releases</id>
            <name>Release Repository</name>
            <url>svn:https://Mac-PC/svn/Project/</url>
        </repository>
    </distributionManagement>
    <!--............... -->


<!--............... -->
 <mailingLists>
        <mailingList>
            <name>Mailing List</name>
            <subscribe>rockbasic_ton@hotmail.com</subscribe>
            <unsubscribe>rockbasic_ton@hotmail.com</unsubscribe>
            <post>rockbasic_ton@hotmail.com</post>
            <archive>https://Mac-PC/svn/Project/keepList</archive>
        </mailingList>
    </mailingLists>
<!--............... -->


    <dependencies>
        <dependency>
            <groupId>junit</groupId>
            <artifactId>junit</artifactId>
            <version>3.8.1</version>
            <scope>test</scope>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>jazz</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>commons-be</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>commons-col</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>commons-di</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>commons-log</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>groovy</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>mysql</groupId>
            <artifactId>mysql-connector-java</artifactId>
            <version>5.0.8</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>table</artifactId>
            <version>1.0</version>
        </dependency>
        <dependency>
            <groupId>tu.cs.jdbcDriver</groupId>
            <artifactId>calendar</artifactId>
            <version>1.0</version>
        </dependency>
    </dependencies>

    <build>
       <!--............... -->
        <extensions>
         <!--.............. -->
           <extension>
                <groupId>org.jvnet.wagon-svn</groupId>
                <artifactId>wagon-svn</artifactId>
                <version>1.8</version>
            </extension>
             <!--.............. -->
            <extension>
                <groupId>org.apache.maven.wagon</groupId>
                <artifactId>wagon-scm</artifactId>
                <version>1.0-beta-6</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-manager-plexus</artifactId>
                <version>1.0</version>
            </extension>
            <extension>
                <groupId>org.apache.maven.scm</groupId>
                <artifactId>maven-scm-provider-svnexe</artifactId>
                <version>1.0</version>
            </extension>
        </extensions>
        <!--............... -->

        <!--............... -->
<!--        <extensions> -->
<!--            <extension> -->
<!--                <groupId>org.apache.maven.wagon</groupId> -->
<!--                <artifactId>wagon-scm</artifactId> -->
<!--                <version>1.0-beta-6</version> -->
<!--            </extension> -->
<!--            <extension> -->
<!--                <groupId>org.apache.maven.scm</groupId> -->
<!--                <artifactId>maven-scm-manager-plexus</artifactId> -->
<!--                <version>1.0</version> -->
<!--            </extension> -->
<!--            <extension> -->
<!--                <groupId>org.apache.maven.scm</groupId> -->
<!--                <artifactId>maven-scm-provider-svnexe</artifactId> -->
<!--                <version>1.0</version> -->
<!--            </extension> -->
<!--            <extension> -->
<!--                <groupId>org.apache.maven.wagon</groupId> -->
<!--                <artifactId>wagon-ssh</artifactId> -->
<!--                <version>2.4</version> -->
<!--            </extension> -->
<!--        </extensions> -->
        <!--............... -->

        <plugins>
            <!--............... -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-release-plugin</artifactId>
                <version>2.0-beta-9</version>
                <configuration>
                    <useReleaseProfile>false</useReleaseProfile>
                    <goals>deploy</goals>
                </configuration>
            </plugin>
            <!--............... -->

            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-surefire-plugin</artifactId>
                <version>2.12.4</version>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-compiler-plugin</artifactId>
                <version>3.1</version>
                <configuration>
                    <verbose>true</verbose>
                    <fork>true</fork>
                    <source>1.7</source>
                    <target>1.7</target>
                    <executable>C:\Program Files\Java\jdk1.7.0_17\bin\javac.exe
                    </executable>
                    <compilerVersion>1.7</compilerVersion>
                </configuration>
            </plugin>


        <!--............... -->
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-assembly-plugin</artifactId>
                <version>2.4</version>
                <configuration>
                    <archive>
                        <manifest>
                            <mainClass>com.mycompany.TempT.Main</mainClass>
                            <packageName>com.mycompany.TempT</packageName>
                        </manifest>
                    </archive>
                    <descriptorRefs>
                        <descriptorRef>jar-with-dependencies</descriptorRef>
                    </descriptorRefs>
                </configuration>
                <executions>
                    <execution>
                        <id>make-assembly</id>
                        <phase>package</phase>
                        <goals>
                            <goal>single</goal>
                        </goals>
                    </execution>
                </executions>
            </plugin>
        <!--............... -->
        </plugins>
    </build>


    <!--............... 
    <repositories>
        <repository>
            <id>Repo-releases</id>
            <name>Release Repository</name>
            <url>https://Mac-PC/svn/Project/</url>
        </repository>
    </repositories>
    ............... -->

</project>

1 个答案:

答案 0 :(得分:0)

Maven无法解析来自存储库(如SVN)的依赖关系。您需要一个工件库(有免费和付费软件可以提供此功能,或者您可以将依赖项安装到本地文件系统)。

如果这是非公开的工件,您应该先install it to your local repository

  

mvn install:install-file -Dfile = path-to-file -DgroupId = group-id -DartifactId = artifact-id -Dversion = version -Dpackaging = packaging