question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

--fully-export-maven-dependencies

See original GitHub issue

The existing --auto-export-maven-dependencies flag has the effect of exporting every dependency Y of a maven module X to other maven modules that depend on X, but, confusingly for most people, it does not export Y to Ceylon modules that depend on X.

At least, I think that’s the right way to describe its effect.

The reasoning behind this was that the transitive dependencies of a maven module can include a whole heap of rubbish which just doesn’t affect the Ceylon program, and which would clog up IDE autocompletion, etc.

However, in practice, the need to explicitly specify a dependency on every dependency of a dependency (!) has been shown to be a major problem for people getting started in environments such as, for example, WildFly Swarm.

Worse, people are starting to invent workarounds like the Ceylon Gradle plugin’s generateOverridesFile command which generates a massive overrides.xml file which just exports all deps of all the maven modules, completely negating the “advantage” of not having --auto-export-maven-dependencies do it.

Therefore, I propose that we provide a second option, --fully-export-maven-dependencies, which exports transitive dependencies all the way to the Ceylon module. Even if it’s not ideal, it’s still a good way to get started when all else fails.

And it’s not like you can’t filter out stuff you don’t need. There are multiple ways to do that: overrides.xml, and IDE completion filters.

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Reactions:1
  • Comments:147 (146 by maintainers)

github_iconTop GitHub Comments

2reactions
FroMagecommented, Oct 27, 2016

So the first victory is that I now only get those errors when compiling:

test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.slf4j:slf4j-api': version '1.7.20' and version '1.7.21'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.jboss.logging:jboss-logging': version '3.1.3.GA' and version '3.2.1.Final'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework:spring-core': version '4.1.9.RELEASE' and version '4.2.6.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework:spring-beans': version '4.1.9.RELEASE' and version '4.2.6.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework:spring-jdbc': version '4.1.9.RELEASE' and version '4.2.6.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework:spring-tx': version '4.1.9.RELEASE' and version '4.2.6.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework:spring-context': version '4.1.9.RELEASE' and version '4.2.6.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework:spring-aop': version '4.1.9.RELEASE' and version '4.2.6.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'org.springframework.security:spring-security-crypto': version '3.2.7.RELEASE' and version '4.0.4.RELEASE'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'commons-logging:commons-logging': version '1.1.1' and version '1.2'
test/src/com/redhat/ceylon/compiler/java/test/issues/bug65xx/bug6597/module.ceylon:1:ERROR:source code imports two different versions of module 'com.fasterxml.jackson.core:jackson-annotations': version '2.6.0' and version '2.6.6'

And not the hundreds of duplicate errors.

1reaction
FroMagecommented, Oct 31, 2016

Does that mean that the IDE will introduce the corresponding import statements into the module descriptor when an IDE-proposed import from a transitive maven dependency is accepted?

yes

Read more comments on GitHub >

github_iconTop Results From Across the Web

Maven dependencies doesn't get exported into the jar
Maven dependencies doesn't get exported into the jar ... I export it this way (Eclipse): Run as -> Maven build... ... It is...
Read more >
How to Build Java Project including all Dependencies ...
Using Maven POM.xml file to keep all dependancies up-to date? In your project do you have src folder , resources folder , lib...
Read more >
Apache Maven Dependency Plugin – dependency:copy ...
Description: Goal that copies the project dependencies from the repository to a defined location. Attributes: Requires a Maven project to be executed.
Read more >
How to Create an Executable JAR with Maven
A quick and practical guide to creating executable JARs with Maven.
Read more >
Maven dependencies | IntelliJ IDEA Documentation
IntelliJ IDEA lets you add a Maven dependency to your project. We recommend that you specify the dependency inside your POM. Dependencies that ......
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found