使用Maven构建我收到此错误。 (在Maven构建和pom.xml文件中) 缺少工件org.bytedeco.javacpp -presets:artoolkitplus:jar:2.3.1-0.0.1-SNAPSHOT等依赖于每个依赖项。
我尝试从我的本地.m2存储库中删除org.bytedeco文件夹,但错误仍然存在。
我的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.ayman</groupId>
<artifactId>JavaCV</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>JavaCV</name>
<description>Java interface to OpenCV and more</description>
<url>http://bytedeco.org/javacv/</url>
<licenses>
<license>
<name>Apache License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0</url>
<distribution>repo</distribution>
</license>
<license>
<name>GNU General Public License (GPL) version 2, or any later version</name>
<url>http://www.gnu.org/licenses/</url>
<distribution>repo</distribution>
</license>
<license>
<name>GPLv2 with Classpath exception</name>
<url>http://www.gnu.org/software/classpath/license.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<developers>
<developer>
<name>Ayman</name>
<email>ayman.patel@gmail.com</email>
</developer>
</developers>
<prerequisites>
<maven>3.0</maven>
</prerequisites>
<scm>
<url>https://github.com/bytedeco/javacv</url>
<connection>scm:git:git://github.com/bytedeco/javacv.git</connection>
<developerConnection>scm:git:ssh://git@github.com/bytedeco/javacv.git</developerConnection>
</scm>
<distributionManagement>
<snapshotRepository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots/</url>
</snapshotRepository>
<repository>
<id>sonatype-nexus-staging</id>
<name>Sonatype Nexus Staging</name>
<url>https://oss.sonatype.org/service/local/staging/deploy/maven2/</url>
</repository>
</distributionManagement>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.build.timestamp.format>yyyyMMddhhmm</maven.build.timestamp.format>
<javacpp.version>${project.version}</javacpp.version>
</properties>
<dependencies>
<dependency>
<groupId>org.bytedeco</groupId>
<artifactId>javacpp</artifactId>
<version>${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>opencv</artifactId>
<version>3.4.1-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>ffmpeg</artifactId>
<version>4.0-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>flycapture</artifactId>
<version>2.11.3.121-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>libdc1394</artifactId>
<version>2.2.5-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>libfreenect</artifactId>
<version>0.5.3-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>libfreenect2</artifactId>
<version>0.2.0-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>librealsense</artifactId>
<version>1.12.1-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>videoinput</artifactId>
<version>0.200-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>artoolkitplus</artifactId>
<version>2.3.1-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>flandmark</artifactId>
<version>1.07-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>leptonica</artifactId>
<version>1.76.0-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>org.bytedeco.javacpp-presets</groupId>
<artifactId>tesseract</artifactId>
<version>4.0.0-beta.1-${javacpp.version}</version>
</dependency>
<dependency>
<groupId>com.google.android</groupId>
<artifactId>android</artifactId>
<version>4.1.1.4</version>
<exclusions>
<exclusion>
<groupId>*</groupId>
<artifactId>*</artifactId>
</exclusion>
</exclusions>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jogamp.gluegen</groupId>
<artifactId>gluegen-rt-main</artifactId>
<version>2.3.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jogamp.jogl</groupId>
<artifactId>jogl-all-main</artifactId>
<version>2.3.1</version>
<optional>true</optional>
</dependency>
<dependency>
<groupId>org.jogamp.jocl</groupId>
<artifactId>jocl-main</artifactId>
<version>2.3.1</version>
<optional>true</optional>
</dependency>
</dependencies>
<repositories>
<repository>
<id>sonatype-nexus-snapshots</id>
<name>Sonatype Nexus Snapshots</name>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
<releases>
<enabled>false</enabled>
</releases>
<snapshots>
<enabled>true</enabled>
</snapshots>
</repository>
</repositories>
<build>
<finalName>${project.artifactId}</finalName>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.3</version>
<configuration>
<source>1.7</source>
<target>1.7</target>
<excludes>
<exclude>org/bytedeco/javacv/FlyCaptureFrameGrabber.java</exclude>
</excludes>
</configuration>
</plugin>
<plugin>
<artifactId>maven-jar-plugin</artifactId>
<version>3.0.2</version>
<configuration>
<archive>
<manifest>
<mainClass>org.bytedeco.javacv.JavaCV</mainClass>
<addClasspath>true</addClasspath>
</manifest>
<manifestEntries>
<!-- <addClasspath/> is broken: http://jira.codehaus.org/browse/MJAR-61 -->
<Class-Path>. javacpp.jar opencv.jar ffmpeg.jar flycapture.jar libdc1394.jar libfreenect.jar libfreenect2.jar librealsense.jar videoinput.jar artoolkitplus.jar flandmark.jar</Class-Path>
<Name>org/bytedeco/javacv/</Name>
<Implementation-Title>${project.name}</Implementation-Title>
<Implementation-Vendor>Bytedeco</Implementation-Vendor>
<Implementation-Version>${project.version}</Implementation-Version>
<Specification-Title>${project.name}</Specification-Title>
<Specification-Vendor>Bytedeco</Specification-Vendor>
<Specification-Version>${project.version}</Specification-Version>
</manifestEntries>
</archive>
</configuration>
</plugin>
<plugin>
<artifactId>maven-install-plugin</artifactId>
<version>2.5.2</version>
<configuration>
<createChecksum>true</createChecksum>
</configuration>
</plugin>
<plugin>
<artifactId>maven-source-plugin</artifactId>
<version>3.0.1</version>
<executions>
<execution>
<id>attach-source</id>
<goals>
<goal>jar-no-fork</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<version>2.10.4</version>
<executions>
<execution>
<id>attach-javadocs</id>
<goals>
<goal>jar</goal>
</goals>
<configuration>
<links>
<link>http://bytedeco.org/javacpp/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/opencv/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/ffmpeg/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/flycapture/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/libdc1394/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/libfreenect/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/libfreenect2/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/librealsense/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/videoinput/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/artoolkitplus/apidocs/</link>
<link>http://bytedeco.org/javacpp-presets/flandmark/apidocs/</link>
<link>https://developer.android.com/reference/</link>
<link>https://jogamp.org/deployment/v2.3.1/javadoc/gluegen/javadoc/</link>
<link>https://jogamp.org/deployment/v2.3.1/javadoc/jocl/javadoc/</link>
<link>https://jogamp.org/deployment/v2.3.1/javadoc/jogl/javadoc/</link>
<link>http://junit.org/junit4/javadoc/4.11/</link>
</links>
</configuration>
</execution>
</executions>
</plugin>
<plugin>
<artifactId>maven-deploy-plugin</artifactId>
<version>2.8.2</version>
<configuration>
<skip>true</skip>
</configuration>
</plugin>
<plugin>
<groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.6</version>
<executions>
<execution>
<id>default-deploy</id>
<phase>deploy</phase>
<goals>
<goal>deploy</goal>
</goals>
</execution>
</executions>
<extensions>true</extensions>
<configuration>
<serverId>sonatype-nexus-staging</serverId>
<nexusUrl>https://oss.sonatype.org/</nexusUrl>
<skipStagingRepositoryClose>true</skipStagingRepositoryClose>
</configuration>
</plugin>
</plugins>
</build>
<profiles>
<profile>
<id>doclint-java8-disable</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
</configuration>
</plugin>
</plugins>
</build>
</profile>
<profile>
<id>sign-artifacts</id>
<activation>
<property>
<name>performRelease</name>
<value>true</value>
</property>
</activation>
<build>
<plugins>
<plugin>
<artifactId>maven-gpg-plugin</artifactId>
<version>1.6</version>
<executions>
<execution>
<id>sign-artifacts</id>
<phase>verify</phase>
<goals>
<goal>sign</goal>
</goals>
</execution>
</executions>
<configuration>
<passphrase>${env.GPG_PASSPHRASE}</passphrase>
<useAgent>false</useAgent>
</configuration>
</plugin>
</plugins>
</build>
</profile>
</profiles>
</project>
</project>
答案 0 :(得分:3)
不要将project.version用作依赖项的版本。始终使用修复版
更改
<javacpp.version>${project.version}</javacpp.version>
到
<javacpp.version>2.3.1-1.4.1</javacpp.version>