Adding own dependency
See original GitHub issueHey,
I’m trying to add a dependency with maven.
My dependencies in the pom.xml looks like this:
<dependencies>
<dependency>
<groupId>org.lambadaframework</groupId>
<artifactId>runtime</artifactId>
<version>${lambada.version}</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-log4j</artifactId>
<version>1.0.0</version>
</dependency>
<dependency>
<groupId>com.amazonaws</groupId>
<artifactId>aws-lambda-java-events</artifactId>
<version>1.3.0</version>
</dependency>
<dependency>
<groupId>org.json</groupId>
<artifactId>json</artifactId>
<version>20160810</version>
</dependency>
<dependency>
<groupId>junit</groupId>
<artifactId>junit</artifactId>
<version>4.12</version>
<scope>test</scope>
</dependency>
</dependencies>
It’s the dependency json.org
that won’t work.
The Error I receive is :
A required class was missing while executing org.lambadaframework:lambada-maven-plugin:0.0.6:deploy: org/json/JSONObject
[ERROR] Number of foreign imports: 1
[ERROR] import: Entry[import from realm ClassRealm[project>se.some.project:project-test:0.0.6, parent: ClassRealm[maven.api, parent: null]]]
[ERROR]
[ERROR] -----------------------------------------------------: org.json.JSONObject
I did suspect that it’s the maven-shade-plugin
that causes the problem but the log clearly states that it’s included in the shaded jar:
Including org.json:json:jar:20160810 in the shaded jar.
Local maven set up
Maven home: /opt/apache-maven-3.3.9
Java version: 1.8.0_102, vendor: Oracle Corporation
Java home: /Library/Java/JavaVirtualMachines/jdk1.8.0_102.jdk/Contents/Home/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "mac os x", version: "10.12", arch: "x86_64", family: "mac"
Is it possible to add dependencies?
Thanks!
//Jonathan
Issue Analytics
- State:
- Created 7 years ago
- Comments:29 (9 by maintainers)
Top Results From Across the Web
Add build dependencies - Android Developers
To add a dependency to your project, specify a dependency configuration such as implementation in the dependencies block of your module's build.gradle file....
Read more >Declaring dependencies - Gradle User Manual
Many Gradle plugins add pre-defined configurations to your project. ... A custom configuration is useful for separating the scope of dependencies needed for ......
Read more >How to create your own dependency injection framework in Java
This article will guide you to understand and build a lightweight Java application using your own Dependency Injection implementation.
Read more >How to add a custom <<Usage>> dependency and ... - IBM
By creating and adding a custom <<Usage>> dependency in a profile, you can easily share it across project teams. Answer. Following techniques ...
Read more >Create your Own Maven Dependency - YouTube
This tutorial shows how to create your own Maven project as dependency for other Maven projects.Please subscribe if you like my tutorial ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
No, of course it won’t crash with other dependencies. This is obviously a JSON library specific error, I’ll investigate the root cause. With other dependencies you should not experience any issue in theory.
I have tested the above, it works. Also I made the lambada maven plugin dependency the project itself, that also worked. Doing that you don’t need to duplicate all your dependencies.
See: https://github.com/arranubels/lambadaframework-boilerplate/blob/example1.2/pom.xml
We should probably add this to the boiler plate. I’ll send a PR.