dependency-management

Maven 2 - define dependency version from transitive dependency version

白昼怎懂夜的黑 提交于 2019-12-18 04:19:11
问题 I'll explain the question with my real situation. I use logback 1.0.1 for logging, and it includes SLF4J 1.6.4 as a dependency. I also use the SLF4J API bridges for legacy logging API's (java.util.logging, log4j and commons-logging), which are not explicit dependencies. These must also (preferrably) be version 1.6.4. Trying to make my pom.xml as neat and error-free as possible, I'd like to enforce that these API bridges be the same version as SLF4J. The only way I know is to manually define

How to override the dependency of an sbt plugin?

守給你的承諾、 提交于 2019-12-18 01:53:50
问题 I've written an sbt plugin called sbt-jumi which implements sbt integration for Jumi. Right now the sbt-jumi plugin depends on the current Jumi release. Here is the relevant line from the plugin's build.sbt: libraryDependencies += "fi.jumi" % "jumi-launcher" % "0.5.376" And a user of the plugin would add this to his project/plugins.sbt file: addSbtPlugin("fi.jumi.sbt" % "sbt-jumi" % "0.1.0") Now let's say that Jumi 0.6.400 is released and it's backward compatible. How can a user of the sbt

How to override the dependency of an sbt plugin?

六眼飞鱼酱① 提交于 2019-12-18 01:53:28
问题 I've written an sbt plugin called sbt-jumi which implements sbt integration for Jumi. Right now the sbt-jumi plugin depends on the current Jumi release. Here is the relevant line from the plugin's build.sbt: libraryDependencies += "fi.jumi" % "jumi-launcher" % "0.5.376" And a user of the plugin would add this to his project/plugins.sbt file: addSbtPlugin("fi.jumi.sbt" % "sbt-jumi" % "0.1.0") Now let's say that Jumi 0.6.400 is released and it's backward compatible. How can a user of the sbt

Combining DI with constructor parameters?

五迷三道 提交于 2019-12-17 22:35:04
问题 How do I combine constructor injection with "manual" constructor parameters? ie. public class SomeObject { public SomeObject(IService service, float someValue) { } } Where IService should be resolved/injected by my DI container, and someValue should be specified. How do I mix the two? 回答1: Such constructs should be avoided whenever possible. Therefore, ask yourself: is this parameter really required as constructor argument? Or can SomeObject be replaced by a stateless one which is reused by

What is the meaning of type “bundle” in a maven dependency?

喜夏-厌秋 提交于 2019-12-17 15:24:21
问题 What is the meaning of "bundle" e.g in this dependency: <dependency> <groupId>org.apache.abdera</groupId> <artifactId>abdera-core</artifactId> <version>1.1.2</version> <type>bundle</type> <scope>compile</scope> </dependency> 回答1: This kind of artifact is an OSGi bundle, typically produced using the maven-bundle-plugin which is part of Apache Felix. The plugin treats all the classes available to your module (the module's own classes, classes provided by dependencies, other classes on the

Gradle Single vs Double Quotes

…衆ロ難τιáo~ 提交于 2019-12-17 10:56:27
问题 I'm new to gradle and am currently just trying to follow the tutorials and quite a few times I've seen single and double quotes intermixed. I just wanted to know if there was a difference of when one set should be used over the other. One example of this is section 6.12 of the tutorial - Default tasks: defaultTasks 'clean', 'run' task clean << { println 'Default Cleaning!' } task run << { println 'Default Running!' } task other << { println "I'm not a default task!" } So, I would just like to

Gradle equivalent to Maven's “copy-dependencies”?

丶灬走出姿态 提交于 2019-12-17 09:54:09
问题 In Maven-land, anytime I want to simply pull down the transitive dependencies for a particular POM file, I just open a shell, navigate to where the POM is located, and run: mvn dependency:copy-dependencies And boom , Maven creates a target/ directory inside the current one and places all the transitively-fetched JARs to that location. I am now trying to make the switch over to Gradle, but Gradle doesn't seem to have the same feature. So I ask: Does Gradle have an equivalent to Maven's copy

Maven : Should I keep or remove declared dependencies that are also transitives dependencies?

十年热恋 提交于 2019-12-17 06:37:18
问题 Do you think it is a good practice to remove every transitive dependencies that can be found in a maven pom? Example: My project depends on A and B. B is also a transitive dependency of A. Should I keep B in my pom or remove it ? What is the best: having all known jars, even transitive one, declared on the pom or keeping only the top level jars ? This is a little bit subjective, but I am trying to clean some huge poms (parent and children) with a lot of transitive dependencies. I want to keep

How does CocoaPods work

落花浮王杯 提交于 2019-12-17 05:13:44
问题 I used CocoaPods for some of my projects. It's cool and easy to keep updated with my dependencies/open source frameworks. But I have some doubts regarding the inner workings of CocoaPods. In our Podfile we are giving only the the name of pods, sometimes the version also,like pod "AFNetworking" , "1.3.2" Then it correctly finds and clones the AFNetworking repo. How this is work? How the ruby gems know the actual repository is in Github. Are pods work with Github only? (Because I saw pods for

How does CocoaPods work

天大地大妈咪最大 提交于 2019-12-17 05:13:19
问题 I used CocoaPods for some of my projects. It's cool and easy to keep updated with my dependencies/open source frameworks. But I have some doubts regarding the inner workings of CocoaPods. In our Podfile we are giving only the the name of pods, sometimes the version also,like pod "AFNetworking" , "1.3.2" Then it correctly finds and clones the AFNetworking repo. How this is work? How the ruby gems know the actual repository is in Github. Are pods work with Github only? (Because I saw pods for