为什么 zxing 不能很好地与 ant/java8 和 pom.xml 一起玩?
Why isn't zxing playing nicely with ant/java8 and the pom.xml?
我将 zxing 的 pom.xml 条目更改为 3.3.0
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>zxing-parent</artifactId>
<version>3.3.0</version>
<type>pom</type>
</dependency>
现在我明白了:
[artifact:dependencies] Unable to resolve artifact: Unable to get dependency information: Unable to read the metadata file for artifact 'com.github.jai-imageio:jai-imageio-core:jar': Invalid JDK version in profile 'java8-and-higher': Unbounded range: [1.8, for project com.github.jai-imageio:jai-imageio-core
[artifact:dependencies] com.github.jai-imageio:jai-imageio-core:jar:1.3.1
据我所知,这表明与 java(我正在使用 java 8)所需版本相关的 zxing 的 pom 文件有问题?
使用 Maven 和 Eclipse 可以很好地编译代码,但是在尝试 运行 一个单独的 ant 进程时会发生此错误。
<artifact:dependencies filesetId="dependency.fileset">
<artifact:pom file="${basedir}/pom.xml"/>
</artifact:dependencies>
如果我在 pom 中使用 zxing 2.2,ant 任务工作得很好,但当然我的代码没有。
这是 zwing 3.3.0 中的错误还是我遗漏了什么?
问题的原因是 jai-imageio:jai-imageio-core:jar:1.3.1
的 pom
。
Maven 对以下几行有问题
<profile>
<id>java8-and-higher</id>
<activation>
<jdk>[1.8,</jdk>
</activation>
...
对于丑陋的修复,您可以在本地存储库中打开 pom
并将激活值更改为
<profile>
<id>java8-and-higher</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
...
另一种选择是更改您的 Maven 版本。某些版本在解释错误语法时没有问题。这应该也是为什么你用eclipse和ant构建的结果不同的答案。
我将 zxing 的 pom.xml 条目更改为 3.3.0
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>core</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>javase</artifactId>
<version>3.3.0</version>
</dependency>
<dependency>
<groupId>com.google.zxing</groupId>
<artifactId>zxing-parent</artifactId>
<version>3.3.0</version>
<type>pom</type>
</dependency>
现在我明白了:
[artifact:dependencies] Unable to resolve artifact: Unable to get dependency information: Unable to read the metadata file for artifact 'com.github.jai-imageio:jai-imageio-core:jar': Invalid JDK version in profile 'java8-and-higher': Unbounded range: [1.8, for project com.github.jai-imageio:jai-imageio-core
[artifact:dependencies] com.github.jai-imageio:jai-imageio-core:jar:1.3.1
据我所知,这表明与 java(我正在使用 java 8)所需版本相关的 zxing 的 pom 文件有问题?
使用 Maven 和 Eclipse 可以很好地编译代码,但是在尝试 运行 一个单独的 ant 进程时会发生此错误。
<artifact:dependencies filesetId="dependency.fileset">
<artifact:pom file="${basedir}/pom.xml"/>
</artifact:dependencies>
如果我在 pom 中使用 zxing 2.2,ant 任务工作得很好,但当然我的代码没有。 这是 zwing 3.3.0 中的错误还是我遗漏了什么?
问题的原因是 jai-imageio:jai-imageio-core:jar:1.3.1
的 pom
。
Maven 对以下几行有问题
<profile>
<id>java8-and-higher</id>
<activation>
<jdk>[1.8,</jdk>
</activation>
...
对于丑陋的修复,您可以在本地存储库中打开 pom
并将激活值更改为
<profile>
<id>java8-and-higher</id>
<activation>
<jdk>[1.8,)</jdk>
</activation>
...
另一种选择是更改您的 Maven 版本。某些版本在解释错误语法时没有问题。这应该也是为什么你用eclipse和ant构建的结果不同的答案。