質問

I have a core project with some libraries which my other projects want to depend on. In the other projects I want to reference those libraries within the core project.

I think I'm missing either some build path settings or classpath settings, but can't really find out which.

For instance, let's say my core project includes JodaTime and my other projects want to manipulate some dates as well. Do I need to include JodaTime with the other projects or is it enough to leave it in my core project and just reference it correctly?

役に立ちましたか?

解決

That depends on whether your core project exports JodaTime in the order and export settings.

There are tradeoffs to exporting a third-party library. If your core project will only be used as part of your other projects, exporting the library makes it easy to ensure that all your other projects are using the same version. But if your core project is itself a library that you're going to publish, you usually don't want to export third-party libraries because then they effectively become part of your API. In fact, you may actually want to design your API to conceal what third-party libraries you're using in case you ever want to switch to something else.

ライセンス: CC-BY-SA帰属
所属していません StackOverflow
scroll top