I have project A and B, both built in jenkins and pushed to artifactory.
Project C has dependencies on A and B and I can download each project's dependencies, but Gradle complains that the libraries stored in those JARs were not imported at compile time. Does anyone have an idea how to instruct Gradle to compile the libraries within the JARs?
Related
I'm looking for a way to copy jar files from the repo to a particular folder during build, to access this folder later on from the spring-boot webserver (e.g. /target/workspace/jars-go-here)
At first I had the maven-dependency-plugin in mind, but this does not seem to be capable of coping artifacts bundled within a pom as it does not work transitively for the goal 'copy'. 'copy-dependencies' does support copying the artifacts transitively, however only for dependencies of the project itself.
Next I've took a look on the maven-assembly-plugin. This supports copying jar of poms in a transitive way, but again only for dependencies of the project.
Is there a way to copy artifacts transitively that are NOT dependencies of the project itself?
I have my project jar published in Jfrog artifactory after being build. Now when some other project wants to download this and its dependencies, they have added it as a dependency in their build.gradle file. However, when we are trying to execute "gradle dependencies", only the project jar is being downloaded and not its dependencies.
Can someone help why the dependencies are not being downloaded.
Note: The pom.xml for the project jar is not uploaded to artifactory. Is this absolutely mandatory for downloading dependencies for project jar ?
Hey I am trying to sbt compile a Scala project with 2 external .jar libraries as dependencies. I've added them in the /lib folder and I can see they are recognized by sbt when I run "show unmanagedClasspath" I see the 2 jars. However when I run "sbt assembly", sbt tries to resolve dependencies and fails when it can't download the libraries that are already there.
You don't need to add the jars that you've in the \lib directory again in libraryDependencies. libraryDependencies is part of your managedClasspath and everything in lib directory is part of your unmanagedClasspath, both together forms your dependencyClasspath.
You can see this by typing this on sbt prompt and checking the dependencies section:
inspect externalDependencyClasspath
In this case 'external' just means dependencies that are external to the project (ie not internal project dependencies)
I'm working with a Java project in Intellij IDEA where we have a lot of internal, standalone, Maven dependencies.
I have the source code for these dependencies imported into my IDEA project as modules, but when I select Go To -> Implementation(s) on a class that is part of an internal Maven dependency (and that I have also imported as a module in my project) I'm navigated to a decompiled view of the class in the Maven dependency (jar) and not the source code file of that class that I imported as a module.
To solve this I need to do the following:
Open Module Settings on the module using the internal Maven dependency
Find and remove the internal Maven module in the Dependencies list
Add a new Module Dependency and then select the imported module that corresponds to the internal Maven dependency
Is there any way to have IDEA figuring out this automatically or do I have to do this manual procedure over and over?
To add another maven project (that is not part of your main project) as a dependency:
open you main project
in Maven Projects Tool Window click on green + button and select pom.xml of a dependency
repeat 2 as required
Source:
https://www.jetbrains.com/idea/help/maven-projects-tool-window.html?search=maven%20project
Lets say you have a maven module A which has module B as a dependency.
If you import both modules into one IntelliJ project, IntelliJ will automatically use the imported module B instead of the maven artifact from repository - but you must import it as a maven module.
If you then run some test or application via IntelliJ from module A, it will use it's own compiled classes from module B and not the maven artifact from repository, navigation in the code and everything else will work as expected.
If this does not work, then you should report a bug.
I'd suggest that you are using intellij incorrectly in this example. If you are referring to your maven dependencies as intellij modules, it will get confused.
You should either:
Change these maven dependencies to be maven modules.
Remove these intellij modules as intellij modules and set up your maven build so you can download the source from your maven dependencies.
I have a maven module with one pom.xml. I have added some external jars which don't have maven repository as external jars in the project build path. The module is working fine(no errors).
When I am building it using maven build, it says some of package names from external jars are not found. there are many like this. the reason is corresponding packages API (groupid,artifactid) are not part of the pom.xml.
I want to know how to build maven module in such scenarios.
Appreciate any help
Maven does not support using jars that are outside of Maven. You have two choices:
mvn install:install-file
mvn deploy:deploy-file
The first puts the jar in your local repo, the second in your shared repo manager, which you should have.