问题
I'm just getting started with QT Jambi and I have some problems getting the Maven-plugin to work. I get the following error message:
[ERROR] Failed to execute goal net.sf.qtjambi:qtjambi-maven-plugin:4.6.3.1:generate (default-cli) on project DegooClientGUI: Execution default-cli of goal net.sf.qtjambi:qtjambi-maven-plugin:4.6.3.1:generate failed: Plugin net.sf.qtjambi:qtjambi-maven-plugin:4.6.3.1 or one of its dependencies could not be resolved: Failed to collect dependencies for net.sf.qtjambi:qtjambi-maven-plugin:jar:4.6.3.1 (): Failed to read artifact descriptor for net.sf.qtjambi:qtjambi-maven-plugin-win32:jar:4.6.3.1: Could not transfer artifact net.sf.qtjambi:qtjambi-maven-plugin-win32:pom:4.6.3.1 from/to qtjambi (http://qtjambi.sourceforge.net/maven2/): Checksum validation failed, no checksums available from the repository -> [Help 1]
My pom looks like this:
<repositories>
<repository>
<id>qtjambi</id>
<name>qtjambi</name>
<url>http://qtjambi.sourceforge.net/maven2/</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</repository>
</repositories>
<pluginRepositories>
<pluginRepository>
<id>qtjambi</id>
<name>qtjambi</name>
<url>http://qtjambi.sourceforge.net/maven2/</url>
<releases>
<checksumPolicy>ignore</checksumPolicy>
</releases>
<snapshots>
<checksumPolicy>ignore</checksumPolicy>
</snapshots>
</pluginRepository>
</pluginRepositories>
<dependencies>
<dependency>
<groupId>net.sf.qtjambi</groupId>
<artifactId>qtjambi</artifactId>
<version>4.6.3</version>
</dependency>
</dependencies>
<build>
<sourceDirectory>src</sourceDirectory>
<testSourceDirectory>tests</testSourceDirectory>
<plugins>
<plugin>
<groupId>net.sf.qtjambi</groupId>
<artifactId>qtjambi-maven-plugin</artifactId>
<version>4.6.3.1</version>
<executions>
<execution>
<id>qtjambi</id>
<goals>
<goal>generate</goal>
</goals>
</execution>
</executions>
<configuration>
<!-- Specifies where sources are. This parameter is MANDATORY -->
<sourcesDir>src</sourcesDir>
<!-- following parameters aren't mandatory, they use defaults as specified here
if not specified
<translationsDir>src/main/resources/translations</translationsDir>
<destinationDir>target/generated-sources/qtjambi</destinationDir>
-->
<!-- cause -noobsolete switch for lupdate -->
<noObsoleteTranslations>true</noObsoleteTranslations>
</configuration>
</plugin>
</plugins>
</build>
As you can see I've tried to ignore checksum-errors but that doesn't help. I've also tried specifying other versions, that are available in the repository. That didn't help either. Any ideas? Thanks in advance!
回答1:
FYI the is no win64 version of 4.6.3.1.
Your error does clearly talk of win32 not win64 but it is worth trying to see if version 4.6.3 works instead, this version has win32 and win64). Maybe the person testing above and confirming was using Win7 32bit or something. But you have clearly stated you are Win7 64bit.
Although if you are using a 32bit JRE to run Maven then the system will think it is a 32bit system. Maybe this is what you are doing and explains why your Win7 64bit is trying to resolve qtjambi-maven-plugin-win32.
The pom.xml of the plugin auto-selects the qtjambi-maven-plugin-win32 or qtjambi-maven-plugin-win64 based on the platform at runtime.
2 options on a solution to fix (pick one)
1) Use version 4.6.3
2) Add in a section to your project POM to exclude groupId=net.sf.qtjambi artifactId=qtjambi-maven-plugin-win64 this is done inside the build/plugins/plugin/* section of the pom.xml. I don't have an example to hand but Eclipse m2e pom.xml editor allow quick and easy exclusion. Once you have excluded manually add in the additional dependency for the qtjambi-maven-plugin-win32. It is my understanding the platform depedent part provides an EXE that can be run and since all Win64 supports execution of Win32 binaries then using Win32 should be ok.
FYI
http://repository.qt-jambi.org/nexus/content/repositories/releases-before-2011/net/sf/qtjambi/qtjambi-maven-plugin-win64/ this is the directory where the 4.6.3.1 win64 version should be.
http://repository.qt-jambi.org/nexus/content/repositories/releases-before-2011/net/sf/qtjambi/qtjambi-maven-plugin-win32/4.6.3.1/ this is where the 4.6.3.1 win32 plugin actually is.
[Edited Feb 2013 - to replace "http://qt-jambi.org/maven2/" with "http://repository.qt-jambi.org/nexus/content/repositories/releases-before-2011/" this is the current URL]
来源:https://stackoverflow.com/questions/8324677/using-maven-with-qt-jambi