Skip to content
This repository has been archived by the owner on Oct 12, 2023. It is now read-only.

Java Development Environment Maven problem #89

Closed
Zuendelmeister opened this issue Jan 5, 2017 · 2 comments
Closed

Java Development Environment Maven problem #89

Zuendelmeister opened this issue Jan 5, 2017 · 2 comments
Assignees

Comments

@Zuendelmeister
Copy link

Zuendelmeister commented Jan 5, 2017

Greetings,

I want to build the Java Development Environment on Windows 10 but get some issues with maven. I tried both ways that you described.
1.:
I tried to search for "com.microsoft.azure.gateway" here: http://search.maven.org/. Unfortunately there was no entry (No records found, try new search criteria).
2.:
After installing with "mvn clean install" there is no {IoT gateway SDK root}/bindings/java/gateway-java-binding/target/gateway-java-binding-{version}-with-deps.jar file.

[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.microsoft.azure.gateway:gateway-java-binding:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-source-plugin is missing. @ line 58, column 21
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-javadoc-plugin is missing. @ line 70, column 21
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building Azure IoT Gateway SDK Java Module Binding 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ gateway-java-binding ---
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ gateway-java-binding ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\src\main\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:compile (default-compile) @ gateway-java-binding ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 4 source files to C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\classes
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ gateway-java-binding ---
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\src\test\resources
[INFO]
[INFO] --- maven-compiler-plugin:3.3:testCompile (default-testCompile) @ gateway-java-binding ---
[INFO] Changes detected - recompiling the module!
[WARNING] File encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO] Compiling 2 source files to C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\test-classes
[INFO]
[INFO] --- maven-surefire-plugin:2.19.1:test (default-test) @ gateway-java-binding ---


T E S T S

Running tests.unit.com.microsoft.azure.gateway.core.GatewayModuleTest
Tests run: 3, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.119 sec - in tests.unit.com.microsoft.azure.gateway.core.GatewayModuleTest
Running tests.unit.com.microsoft.azure.gateway.messaging.MessageTest
Tests run: 15, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.148 sec - in tests.unit.com.microsoft.azure.gateway.messaging.MessageTest

Results :

Tests run: 18, Failures: 0, Errors: 0, Skipped: 0

[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) @ gateway-java-binding ---
[INFO] Building jar: C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\gateway-java-binding-1.0.0.jar
[INFO]
[INFO] >>> maven-source-plugin:3.0.1:jar (default) > generate-sources @ gateway-java-binding >>>
[INFO]
[INFO] <<< maven-source-plugin:3.0.1:jar (default) < generate-sources @ gateway-java-binding <<<
[INFO]
[INFO] --- maven-source-plugin:3.0.1:jar (default) @ gateway-java-binding ---
[INFO] Building jar: C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\gateway-java-binding-1.0.0-sources.jar
[INFO]
[INFO] --- maven-javadoc-plugin:2.10.4:jar (default) @ gateway-java-binding ---
[WARNING] Source files encoding has not been set, using platform encoding Cp1252, i.e. build is platform dependent!
[INFO]
Loading source files for package com.microsoft.azure.gateway.core...
Loading source files for package com.microsoft.azure.gateway.messaging...
Constructing Javadoc information...
Standard Doclet version 1.8.0_111
Building tree for all the packages and classes...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\Broker.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\GatewayModule.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\IGatewayModule.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\messaging\Message.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\overview-frame.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\package-frame.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\package-summary.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\package-tree.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\messaging\package-frame.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\messaging\package-summary.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\messaging\package-tree.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\constant-values.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\class-use\IGatewayModule.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\class-use\GatewayModule.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\class-use\Broker.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\messaging\class-use\Message.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\core\package-use.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\com\microsoft\azure\gateway\messaging\package-use.html...
Building index for all the packages and classes...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\overview-tree.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\index-all.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\deprecated-list.html...
Building index for all classes...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\allclasses-frame.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\allclasses-noframe.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\index.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\overview-summary.html...
Generating C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\apidocs\help-doc.html...
[INFO] Building jar: C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\gateway-java-binding-1.0.0-javadoc.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) @ gateway-java-binding ---
[INFO] Installing C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\gateway-java-binding-1.0.0.jar to C:\Users<name>.m2\repository\com\microsoft\azure\gateway\gateway-java-binding\1.0.0\gateway-java-binding-1.0.0.jar
[INFO] Installing C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\pom.xml to C:\Users<name>.m2\repository\com\microsoft\azure\gateway\gateway-java-binding\1.0.0\gateway-java-binding-1.0.0.pom
[INFO] Installing C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\gateway-java-binding-1.0.0-sources.jar to C:\Users<name>.m2\repository\com\microsoft\azure\gateway\gateway-java-binding\1.0.0\gateway-java-binding-1.0.0-sources.jar
[INFO] Installing C:\Projects\Azure\azure-iot-gateway-sdk-java\azure-iot-gateway-sdk\bindings\java\gateway-java-binding\target\gateway-java-binding-1.0.0-javadoc.jar to C:\Users<name>.m2\repository\com\microsoft\azure\gateway\gateway-java-binding\1.0.0\gateway-java-binding-1.0.0-javadoc.jar
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 7.287 s
[INFO] Finished at: 2017-01-05T17:31:58+01:00
[INFO] Final Memory: 24M/189M
[INFO] ------------------------------------------------------------------------

@andrew-buckley
Copy link
Contributor

andrew-buckley commented Jan 6, 2017

Hi @Zuendelmeister, thanks for pointing this out.

  1. Our java binding has not yet made its way to the Maven Central Repository. I'll update our documentation to note that this will be the recommended way once the bits are placed in Maven Central.

  2. We no longer add the "-with-deps" suffix to that jar file. When creating your modules, we recommend creating a "shaded" jar file which packages all dependencies it needs into the jar file to reduce the chance of missing class files.

You can see this file as an example. Note that the class.path for each java module points to the location of the "shaded" jar file containing all dependencies.

Hope this helps!

@Zuendelmeister
Copy link
Author

Hi @andrew-buckley , thanks for the fast reply. I´ll try it out.

andrew-buckley added a commit to andrew-buckley/azure-iot-gateway-sdk that referenced this issue Jan 10, 2017
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants