0

Running WINDOWS 7 but ran into same problem on Ubuntu 14.0.4

Very possible given my limited experience with these sorts of things that I am doing something very wrong.

I was trying to build the LibUSB directory using the suggestion of running mvn install from the /libusb/ directory, but it didn't work. I downloaded the LibUSB latest GIT from https://github.com/libusb/libusb and placed it in the javax-usb-libusb1-master/libusb-git folder, and then changed over to the javax-usb-libusb1-master/libusb directory and ran mvn install.

Before when I tried this I received a great deal of information about things being downloaded and ultimately ended up in failure.

This time when I tried it after having GITten the latest LibUSB build and placed it into the libusb-git directory, there was less information, but it still ended with the same error:

Y:\Development Tools\Java\javax-usb-libusb1-master\libusb>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethrea
ded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Javalibusb1 :: libusb 1.0.1-1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ libusb ---
[WARNING] Rule 1: org.apache.maven.plugins.enforcer.RequireProperty failed with
message:
Property "libusb.home" is required for this build.
[WARNING] Rule 2: org.apache.maven.plugins.enforcer.RequireProperty failed with
message:
Property "libusb.cflags" is required for this build.
[WARNING] Rule 3: org.apache.maven.plugins.enforcer.RequireProperty failed with
message:
Property "libusb.configure.args" is required for this build.
[WARNING] Rule 4: org.apache.maven.plugins.enforcer.RequireProperty failed with
message:
Property "nar.optionSet.c" is required for this build.
[WARNING] Rule 5: org.apache.maven.plugins.enforcer.RequireProperty failed with
message:
Property "nar.optionSet.linker" is required for this build.
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.302 s
[INFO] Finished at: 2014-06-06T10:51:48-06:00
[INFO] Final Memory: 7M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-enforcer-plugin:1.
0:enforce (enforce-maven) on project libusb: Some Enforcer rules have failed. Lo
ok above for specific messages explaining why the rule failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

What am I doing wrong? Am I even doing anything wrong? If not, how can I resolve this issue, or is it even something that I can resolve?

EDIT: Okay so I was informed a bit about profiles and added the following to the Maven Settings.xml file in the /conf folder:

  <activeProfiles>
    <activeProfile>amd64-Win7</activeProfile>
  </activeProfiles>

and the following to the pom.xml file in the /libusb directory:

<profile>
    <id>amd64-Win7</id>
    <activation>
        <os>
            <name>Windows 7</name>
            <arch>amd64</arch>          
        </os>
    </activation>
    <properties>
        <nar.optionSet.c>-Wall -Wno-long-long -Wpointer-arith -fPIC -g -m64 </nar.optionSet.c>
        <nar.optionSet.linker>-m64 -lrt</nar.optionSet.linker>
        <libusb.configure.args/>
        <libusb.cflags>-m64</libusb.cflags>
        <libusb.home>${usr.home}/opt/libusb-git</libusb.home>
    </properties>
</profile>

Now I am getting this message:

Y:\Development Tools\Java\javax-usb-libusb1-master\libusb>mvn install
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethrea
ded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Javalibusb1 :: libusb 1.0.1-1-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (enforce-maven) @ libusb ---
[INFO]
[INFO] --- maven-enforcer-plugin:1.0:enforce (default) @ libusb ---
[INFO]
[INFO] --- maven-install-plugin:2.3.1:install (default-install) @ libusb ---
[INFO] Installing Y:\Development Tools\Java\javax-usb-libusb1-master\libusb\pom.
xml to C:\Users\Will\.m2\repository\io\trygvis\usb\libusb\1.0.1-1-SNAPSHOT\libus
b-1.0.1-1-SNAPSHOT.pom
[INFO]
[INFO] --- exec-maven-plugin:1.2:exec (libusb-autogen) @ libusb ---
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.636 s
[INFO] Finished at: 2014-06-06T16:52:48-06:00
[INFO] Final Memory: 8M/112M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.codehaus.mojo:exec-maven-plugin:1.2:exec (lib
usb-autogen) on project libusb: Command execution failed. Cannot run program "ba
sh" (in directory "Y:\Development Tools\Java\javax-usb-libusb1-master\libusb-git
"): CreateProcess error=2, The system cannot find the file specified -> [Help 1]

[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e swit
ch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionE
xception

I'm pretty sure I populated the LibUsb.Home property with something wrong. What should I put in there?

Will
  • 3,413
  • 7
  • 50
  • 107
  • 1
    Have you set the properties it's complaining about? (`libusb.home`, `libusb.cflags`, etc.) – azurefrog Jun 06 '14 at 16:07
  • My experience with maven is, well that statement in itself is a joke, I don't actually have any experience with Maven, so I will have to look up that information. Some kind of Maven Profiles for the hopelessly clueless would be great. – Will Jun 06 '14 at 21:12

1 Answers1

0

As far as i found from pom of the project the properties which are missing are specified in profiles. Currently there are 4 profiles for Linux and Mac, 32 and 64 versions. So you need to define additional profile to build it on Windows. You can find how to make profile on maven project site.

If you do not want to go for profiles, i suggest to use your Ubuntu. It should resolve 4 out of 5 of properties. The one left is libusb.home. Unfortunately it seems that javax-usb-libusb1 does not have anymore their own module. So you have to build one manually.

You can install libusb from https://github.com/libusb/libusb following instructions from INSTALL. By default it is installed to "/usr/local/lib"

Once you will have it installed you should go to pom in "javax-usb-libusb1-master" and add libusb.home property in profile which is used for your system. So profile should look like:

<profile>
  <id>amd64-Linux-gpp</id>
  <activation>
    <os>
      <name>linux</name>
      <arch>amd64</arch>
    </os>
  </activation>
  <properties>
    <libusb.home>/usr/local/lib</libusb.home>
    <nar.optionSet.c>-Wall -Wno-long-long -Wpointer-arith -fPIC -g m64</nar.optionSet.c>
    <nar.optionSet.linker>-m64 -lrt</nar.optionSet.linker>
    <libusb.configure.args>--with-pic</libusb.configure.args>
    <libusb.cflags>-m64</libusb.cflags>
  </properties>
</profile>

Now you can run mvn install in "javax-usb-libusb1-master".

After all theses steps it seems that there is still a problem with other poms:

Downloading: https://oss.sonatype.org/content/repositories/snapshots/io/trygvis/usb/libusb/1.0.1-1-SNAPSHOT/maven-metadata.xml
Downloading: https://oss.sonatype.org/content/repositories/snapshots/io/trygvis/usb/libusb/1.0.1-1-SNAPSHOT/libusb-1.0.1-1-SNAPSHOT.pom
[WARNING] The POM for io.trygvis.usb:libusb:pom:1.0.1-1-SNAPSHOT is missing, no dependency information available

Trying to find out more about it.

seriar
  • 26
  • 2
  • Thank you. The problem with Ubuntu is I have a 3 TB HD on a non UEFI machine, and do need windows accessible. I tried Ubuntu on a VM but it ran pretty sluggish so at the moment Ubuntu (much to my chagrin) is not an option (unless I can figure out how to set it up on a flash drive). Anyway, I will look up how to set up a profile and go from there. Thanks for your help thus far. – Will Jun 06 '14 at 21:11
  • Some time later we have found ourselves on the same page wooh! I can be taught! – Will Jun 28 '14 at 15:17
  • If you are still working at this I found this which may lead us in the correct direction: https://github.com/trygvis/javax-usb-libusb1/issues/5 – Will Jun 28 '14 at 15:31
  • 1
    I've made some headway past THIS error (the one you're describing). Trygvis got in touch with me after I posted the issue and he said to run maven with the -Plibusb flag. So try it yourself it may work (but it plunged me headlong into another issue so it probably will you also): mvn install -Plibusb. – Will Jun 28 '14 at 18:25
  • Played a bit around and get intgration test problem with misc USB tools: `[ERROR] Failed to execute goal io.trygvis.usb:maven-nar-plugin:2.1-trygvis-1:nar-integration-test (default-nar-integration-test) on project usbtools: There are test failures.` @Will do you have same error? – seriar Jul 02 '14 at 06:46
  • something like it yes. – Will Jul 02 '14 at 13:11