2017-07-15 14 views
0

私はマルチモジュールプロジェクトを持っています。私は別のモジュールからモジュールのコンテンツにアクセスしようとしています。 Mavenは私にこのエラーを与えます。Mavenモジュールプロジェクトが見つかりません

Could not resolve dependencies for project net.twerion:wrapper:jar:1.0-SNAPSHOT: Failed to collect dependencies at net.twerion:cloud.packets:jar:1.0-SNAPSHOT: Failed to read artifact descriptor for net.twerion:cloud.packets:jar:1.0-SNAPSHOT: Could not find artifact net.twerion:cloud:pom:1.0-SNAPSHOT 

モジュールラッパーはコンパイルされたモジュールで、アクセス可能なモジュールをパケット化してプロジェクトをクラウド化します。

私を助けてください。

<?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"> 
<parent> 
    <artifactId>cloud</artifactId> 
    <groupId>net.twerion</groupId> 
    <version>1.0-SNAPSHOT</version> 
</parent> 
<modelVersion>4.0.0</modelVersion> 

<artifactId>wrapper</artifactId> 

<dependencies> 
    <dependency> 
     <groupId>net.twerion</groupId> 
     <artifactId>cloud.packets</artifactId> 
     <version>1.0-SNAPSHOT</version> 
    </dependency> 
    <dependency> 
     <groupId>io.netty</groupId> 
     <artifactId>netty-all</artifactId> 
     <version>4.1.6.Final</version> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-server</artifactId> 
     <version>9.3.6.v20151106</version> 
    </dependency> 
    <dependency> 
     <groupId>org.eclipse.jetty</groupId> 
     <artifactId>jetty-servlet</artifactId> 
     <version>9.3.6.v20151106</version> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.8</source> 
       <target>1.8</target> 
       <encoding>UTF-8</encoding> 
      </configuration> 
     </plugin> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-shade-plugin</artifactId> 
      <version>2.3</version> 
      <executions> 
       <execution> 
        <phase>package</phase> 
        <goals> 
         <goal>shade</goal> 
        </goals> 
        <configuration> 
         <transformers> 
          <transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer"> 
           <mainClass>net.twerion.wrapper.MainClass</mainClass> 
          </transformer> 
         </transformers> 
        </configuration> 
       </execution> 
      </executions> 
      <configuration> 
       <artifactSet> 
        <includes> 
         <include>io.netty:*</include> 
         <include>net.twerion:cloud.packets</include> 
         <include>org.eclipse.jetty:*</include> 
         <include>javax.servlet:*</include> 
        </includes> 
       </artifactSet> 
       <filters> 
        <filter> 
         <artifact>io.netty:*</artifact> 
        </filter> 
        <filter> 
         <artifact>org.eclipse.jetty:*</artifact> 
        </filter> 
        <filter> 
         <artifact>javax.servlet:*</artifact> 
        </filter> 
       </filters> 
       <minimizeJar>true</minimizeJar> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 
</project> 

パケットの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/xsd/maven-4.0.0.xsd"> 
<parent> 
    <artifactId>cloud</artifactId> 
    <groupId>net.twerion</groupId> 
    <version>1.0-SNAPSHOT</version> 
</parent> 
<modelVersion>4.0.0</modelVersion> 

<artifactId>packets</artifactId> 

<dependencies> 
    <dependency> 
     <groupId>org.projectlombok</groupId> 
     <artifactId>lombok</artifactId> 
     <version>RELEASE</version> 
    </dependency> 
</dependencies> 

<build> 
    <plugins> 
     <plugin> 
      <groupId>org.apache.maven.plugins</groupId> 
      <artifactId>maven-compiler-plugin</artifactId> 
      <version>3.1</version> 
      <configuration> 
       <source>1.7</source> 
       <target>1.7</target> 
       <encoding>UTF-8</encoding> 
      </configuration> 
     </plugin> 
    </plugins> 
</build> 

+0

pom.xmlを投稿できますか? –

+0

どちらのPOM? Porjectまたはモジュールpom? – Markus

+0

両方のデータがある場合は注意してください –

答えて

2

あなたの最初のポンポン参照間違ったアーティファクトIDです。代わりに

<dependency> 
    <groupId>net.twerion</groupId> 
    <artifactId>cloud.packets</artifactId> 
    <version>1.0-SNAPSHOT</version> 
</dependency> 

のあなたはそれが動作するはず

<dependency> 
    <groupId>net.twerion</groupId> 
    <artifactId>packets</artifactId> 
    <version>1.0-SNAPSHOT</version> 
</dependency> 

を使用する必要があります。

関連する問題