タイトルには、Mavenと奇妙な状況があります。私sampleModule.msg
モジュールはやや「-大丈夫ではない」であることを私に伝えますMavenのデバッグでは警告とエラーが表示されますが、最終的にはコンパイルされます
[DEBUG] =======================================================================
[WARNING] The POM for sampleModule:sampleModule.msg:jar:1.0.0.qualifier is invalid, transitive dependencies (if any) will not be available: 2 problems were encountered while building the effective model for sampleModule:sampleModule.msg:1.0.0.qualifier
[ERROR] 'dependencies.dependency.systemPath' for sampleModule:org.apache.felix:jar must specify an absolute path but is ${project.basedir}/../org.apache.felix/felix.jar @
[ERROR] 'dependencies.dependency.systemPath' for sampleModule:com.google.protobuf:jar must specify an absolute path but is ${project.basedir}/../com.google.protobuf/protobuf-java-2.5.0.jar @
:私はmvn install -X
コマンドを使用して走った私のデバッグプロセスの出力は、ある与えられました。しかし、少し下の私はこの行を参照してください:
[DEBUG] sampleModule:sampleModule.msg:jar:1.0.0.qualifier:compile
「コンパイル」と表示され、後でエラーはないことに注意してください。ここで
は私のsampleModule.msg
モジュールの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">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>sampleModule</groupId>
<artifactId>sampleModule.master</artifactId>
<relativePath>../pom.xml</relativePath>
<version>1.0.0-SNAPSHOT</version>
</parent>
<groupId>sampleModule</groupId>
<artifactId>sampleModule.msg</artifactId>
<name>sampleModule.msg</name>
<version>1.0.0.qualifier</version>
<packaging>jar</packaging>
<dependencies>
<dependency>
<groupId>sampleModule</groupId>
<artifactId>org.apache.felix</artifactId>
<version>1.0.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../org.apache.felix/felix.jar</systemPath>
</dependency>
<dependency>
<groupId>sampleModule</groupId>
<artifactId>com.google.protobuf</artifactId>
<version>2.5.0</version>
<scope>system</scope>
<systemPath>${project.basedir}/../com.google.protobuf/protobuf-java-2.5.0.jar</systemPath>
</dependency>
</dependencies>
<build>
<sourceDirectory>src/</sourceDirectory>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.2</version>
<configuration>
<source>${jdk.version}</source>
<target>${jdk.version}</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>2.1</version>
<configuration>
<archive>
<manifest>
<addClasspath>true</addClasspath>
<addDefaultImplementationEntries>true</addDefaultImplementationEntries>
<addDefaultSpecificationEntries>true</addDefaultSpecificationEntries>
</manifest>
<manifestEntries>
<Bundle-SymbolicName>${project.artifactId}</Bundle-SymbolicName>
<Bundle-Version>${project.version}</Bundle-Version>
<Bundle-ClassPath>.</Bundle-ClassPath>
<Export-Package>sampleModule.msg</Export-Package>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-antrun-plugin</artifactId>
<executions>
<execution>
<id>generate-sources</id>
<phase>generate-sources</phase>
<configuration>
<tasks>
<mkdir dir="target/src-gen"/>
<exec executable="protoc">
<arg value="--java_out=target/src-gen"/>
<arg value="target/proto/Empty.proto"/>
<arg value="target/proto/ComponentState.proto"/>
</exec>
</tasks>
<sourceRoot>target/src-gen</sourceRoot>
</configuration>
<goals>
<goal>run</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>
</project>
私は別のモジュールと同じ問題を抱えています。 5つの依存関係エラーを表示しますが、コンパイルします。私はちょっと混乱している。私たちがこれを解決すれば、もう片方を取り除くでしょう。
したがって、私はこのエラーを真剣に受け止めるべきですか?この矛盾の理由はありますか?
私は、システム全体の稼働を得れば、私は彼らにうまくいく、お薦めいただきありがとうございます。あなたの質問については、はい、それは動作します。だから私は安全な道を歩いていると私は思う。そして私にとっては、ローカルリポジトリの2番目の選択肢です。 –
@Schütze第2のオプションは、Mavenの_local_リポジトリ(mvnがインストールされている場所)が_remote_リポジトリ(あなたが 'mvn deploy'を実行する場所)に関するものではありません。 –
私は今非常に混乱しています。もし私が**私のローカルリポジトリを利用したいだけならば、私は 'deploy.deploy-file'メソッドのために行ってはいけませんか? –