2017-03-01 4 views
0

내 받는다는의 pom.xml 찾을 수없는 것은 매우 간단하다 :메이븐은 jar 파일로 <packaing> 치어</package> 치어를 다운로드하려고하고

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>org.acb</groupId> 
    <artifactId>adfafa</artifactId> 
    <version>0.0.1-SNAPSHOT</version> 
    <dependencies> 
<dependency> 
    <!-- https://mvnrepository.com/artifact/org.pentaho/pentaho-aggdesigner --> 
<groupId>org.pentaho</groupId> 
<artifactId>pentaho-aggdesigner</artifactId> 
    <version>5.1.5-jhyde</version> 
</dependency> 

    </dependencies> 
</project> 

, 나는 그냥 펜타-aggdesigner을 원한다 그래서, 나는 생각 받는다는 다음, 부모 치어를 다운로드 http://repo.spring.io/plugins-release/org/pentaho/pentaho-aggdesigner/5.1.5-jhyde/pentaho-aggdesigner-5.1.5-jhyde.pom을 방문 http://repo.spring.io/plugins-release

따라 : 두 모듈의 부모 치어는 펜타-aggdesigner-core.jar를하고 펜타-aggdesigner-algorithm.jar, 내 원격 REPO입니다 pom에는 2 개의 하위 모듈 pentaho-aggdesigner-core.jar 및 pentaho-aggdesigner-algorithm.jar이 다운로드됩니다. 펜타-aggdesigner-5.1.5-jhyde.pom의 내용은 다음과 같습니다

<?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/xsd/maven-4.0.0.xsd"> 
    <modelVersion>4.0.0</modelVersion> 

    <groupId>org.pentaho</groupId> 
    <artifactId>pentaho-aggdesigner</artifactId> 
    <packaging>pom</packaging> 
    <version>5.1.5-jhyde</version> 
    <name>Pentaho Aggregate Designer</name> 
    <description>Designs aggregate tables for the Mondrian OLAP engine</description> 
    <url>http://github.com/pentaho/mondrian</url> 
    <inceptionYear>2006</inceptionYear> 

    <properties> 
    <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> 
    </properties> 

    <distributionManagement> 
    <repository> 
     <id>conjars</id> 
     <name>Conjars</name> 
     <url>http://conjars.org/repo</url> 
     <layout>default</layout> 
    </repository> 
    </distributionManagement> 



    <issueManagement /> 

    <scm> 
    <connection>scm:git:git://github.com/julianhyde/pentaho-aggdesigner.git</connection> 
    <developerConnection>scm:git:[email protected]:julianhyde/pentaho-aggdesigner.git</developerConnection> 
    <url>http://github.com/julianhyde/pentaho-aggdesigner/tree/master</url> 
    <tag>pentaho-aggdesigner-5.1.5-jhyde</tag> 
    </scm> 

    <modules> 
    <module>pentaho-aggdesigner-algorithm</module> 
    <module>pentaho-aggdesigner-core</module> 
    </modules> 

    <dependencyManagement> 
    <!-- Dependency versions for all sub-modules. 
     Sorted by groupId, artifactId. --> 
    <dependencies> 
     <dependency> 
     <groupId>commons-lang</groupId> 
     <artifactId>commons-lang</artifactId> 
     <version>2.4</version> 
     </dependency> 
     <dependency> 
     <groupId>commons-logging</groupId> 
     <artifactId>commons-logging</artifactId> 
     <version>1.1.3</version> 
     </dependency> 
     <dependency> 
     <groupId>commons-io</groupId> 
     <artifactId>commons-io</artifactId> 
     <version>1.3.1</version> 
     </dependency> 
     <dependency> 
     <groupId>org.pentaho</groupId> 
     <artifactId>pentaho-aggdesigner-algorithm</artifactId> 
     <version>5.1.5-jhyde</version> 
     </dependency> 
     <dependency> 
     <groupId>pentaho</groupId> 
     <artifactId>mondrian</artifactId> 
     <version>3.6.9</version> 
     </dependency> 
     <dependency> 
     <groupId>dom4j</groupId> 
     <artifactId>dom4j</artifactId> 
     <version>1.6.1</version> 
     </dependency> 
     <dependency> 
     <groupId>jaxen</groupId> 
     <artifactId>jaxen</artifactId> 
     <version>1.1-beta-6</version> 
     </dependency> 

     <!-- Test dependencies. --> 
     <dependency> 
     <groupId>junit</groupId> 
     <artifactId>junit</artifactId> 
     <version>4.4</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>org.jmock</groupId> 
     <artifactId>jmock-junit4</artifactId> 
     <version>2.4.0</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>org.jmock</groupId> 
     <artifactId>jmock-legacy</artifactId> 
     <version>2.4.0</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>org.pentaho</groupId> 
     <artifactId>pentaho-aggdesigner-algorithm</artifactId> 
     <version>5.1.5-jhyde</version> 
     <type>test-jar</type> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>org.hsqldb</groupId> 
     <artifactId>hsqldb</artifactId> 
     <version>2.3.1</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>mysql</groupId> 
     <artifactId>mysql-connector-java</artifactId> 
     <version>5.1.17</version> 
     <scope>test</scope> 
     </dependency> 
     <dependency> 
     <groupId>pentaho</groupId> 
     <artifactId>mondrian-data-foodmart-hsqldb</artifactId> 
     <version>0.2</version> 
     </dependency> 
    </dependencies> 
    </dependencyManagement> 

    <reporting> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-javadoc-plugin</artifactId> 
     <version>2.9.1</version> 
     <configuration> 
      <links> 
      <link>http://docs.oracle.com/javase/7/docs/api/</link> 
      </links> 
     </configuration> 
     </plugin> 
    </plugins> 
    </reporting> 

    <build> 
    <defaultGoal>package</defaultGoal> 
    <plugins> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-dependency-plugin</artifactId> 
     <version>2.8</version> 
     <executions> 
      <execution> 
      <id>properties</id> 
      <goals> 
       <goal>properties</goal> 
      </goals> 
      <phase>initialize</phase> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <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-no-fork</goal> 
       <goal>test-jar-no-fork</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <artifactId>maven-compiler-plugin</artifactId> 
     <version>2.3.2</version> 
     <configuration> 
      <source>1.6</source> 
      <target>1.6</target> 
     </configuration> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-jar-plugin</artifactId> 
     <version>2.2</version> 
     <executions> 
      <execution> 
      <goals> 
       <goal>test-jar</goal> 
      </goals> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <groupId>org.codehaus.mojo</groupId> 
     <artifactId>properties-maven-plugin</artifactId> 
     <version>1.0-alpha-2</version> 
     <executions> 
      <execution> 
      <phase>initialize</phase> 
      <goals> 
       <goal>read-project-properties</goal> 
      </goals> 
      <configuration> 
       <files> 
       <file>build.properties</file> 
       </files> 
      </configuration> 
      </execution> 
     </executions> 
     </plugin> 
     <plugin> 
     <!-- If we don't specify gitexe version, git doesn't 
      commit during release process. --> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-release-plugin</artifactId> 
     <dependencies> 
      <dependency> 
      <groupId>org.apache.maven.scm</groupId> 
      <artifactId>maven-scm-provider-gitexe</artifactId> 
      <version>1.9.1</version> 
      </dependency> 
     </dependencies> 
     </plugin> 
     <plugin> 
     <groupId>org.apache.maven.plugins</groupId> 
     <artifactId>maven-surefire-plugin</artifactId> 
     <version>2.17</version> 
     </plugin> 
    </plugins> 
    </build> 
</project> 

당신이 볼 수있는, 치어 내가 항아리 치어하지만 패키지 치어 아니라고 명확하게 나타냅니다. 그러나 받는다는는 여전히 항아리의 치어로 간주하고, 원격 REPO에서 펜타-aggdesigner.jar를 다운로드 물론, jar 파일이 오류가 존재 throw하지 않습니다 시도 :

[ERROR] Failed to execute goal on project adfafa: Could not resolve dependencies for project org.acb:adfafa:jar:0.0.1-SNAPSHOT: Could not find artifact org.pentaho:pentaho-aggdesigner:jar:5.1.5-jhyde in springmaven (http://repo.spring.io/plugins-release/) -> [Help 1] 
    org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal on project adfafa: 
Could not resolve dependencies for project org.acb:adfafa:jar:0.0.1-SNAPSHOT: Could not find artifact org.pentaho:pentaho-aggdesigner:jar:5.1.5-jhyde in springmaven (http://repo.spring.io/plugins-release/) 

답변

0

아니를 받는다는 아무튼 ' 그런 식으로 일해라. 또한 How to use POMs as a dependency in Maven?

부모는 구성 요소를 자식 모듈에 결합하는 것만으로 충분합니다. 전이 의존성을 자동으로 도입하지는 않습니다.

정확한 jar 종속성을 지정해야합니다. 아마 뭔가 같은 :

<dependency> 
    <groupId>org.pentaho</groupId> 
    <artifactId>pentaho-aggdesigner-algorithm</artifactId> 
    <version>5.1.5-jhyde</version> 
</dependency> 
<dependency> 
    <groupId>org.pentaho</groupId> 
    <artifactId>pentaho-aggdesigner-core</artifactId> 
    <version>5.1.5-jhyde</version> 
</dependency> 

당신이 당신의 의존성에 유형 '치어'를 포함하여, 다음과 같이 사용할 수 있습니다 치어의가있다 :이 경우

<dependency> 
    <groupId>xxx.yyy</groupId> 
    <artifactId>pentaho-all</artifactId> 
    <type>pom</type> 
    <version>XXXX</version> 
</dependency> 

이, 펜타은-모두와 치어 것 전이 의존성으로 가져올 직접 종속성의 목록입니다. 그러나 당신이 발견 한 aggregator pom은 모듈과 의존성 관리 만 직접적으로 의존하지 않기 때문에 작동하지 않습니다.

+0

이것은 내가 src 코드에서 하이브를 컴파일 할 때 만나는 것입니다. 컴파일이 실패하고 configuration.So를 찾았습니다. 이상합니다. – wuchang

+0

그건 분명히 잘못된 구성입니까? 대신 jar 대신 표시되는 것은 무엇입니까? – wuchang

+0

패키징 'pom'은 모듈이 jar/war/ear 자체를 생성하지 않는다는 것을 의미합니다. 그것은 주로 부모 모금 또는 아이 모듈과 함께 poms에 사용됩니다. – greyfairer