How to find if I need to exclude dependencies in a maven java project?Is there a decent HTML Junit report plugin for Maven?How do I efficiently iterate over each entry in a Java Map?How do I read / convert an InputStream into a String in Java?How do I generate random integers within a specific range in Java?How can I create an executable JAR with dependencies using Maven?How do I determine whether an array contains a particular value in Java?How to add local jar files to a Maven project?How do I convert a String to an int in Java?IntelliJ inspection gives “Cannot resolve symbol” but still compiles codeImport Maven dependencies in IntelliJ IDEADealing with “Xerces hell” in Java/Maven?
Did the British navy fail to take into account the ballistics correction due to Coriolis force during WW1 Falkland Islands battle?
Understanding Parallelize methods
Why do all fields in a QFT transform like *irreducible* representations of some group?
What is the difference between Major and Minor Bug?
French abbreviation for comparing two items ("vs")
Is there any way to keep a player from killing an NPC?
Architectural feasibility of a tiered circular stone keep
How to gently end involvement with an online community?
Are the players on the same team as the DM?
If the first law of thermodynamics ensures conservation of energy, why does it allow systems to lose energy?
Can a Rogue PC teach an NPC to perform Sneak Attack?
Is using a hyperlink to close a modal a poor design decision?
Non-visual Computers - thoughts?
What is the difference between "Grippe" and "Männergrippe"?
Is immersion of utensils (tevila) valid before koshering (hagala)?
Is for(( ... )) ... ; a valid shell syntax? In which shells?
Was there ever a treaty between 2 entities with significantly different translations to the detriment of one party?
Justifying the use of directed energy weapons
Are there any elected officials in the U.S. who are not legislators, judges, or constitutional officers?
Is "The life is beautiful" incorrect or just very non-idiomatic?
Was it ever possible to target a zone?
How to respectfully refuse to assist co-workers with IT issues?
Is there any practical application for performing a double Fourier transform? ...or an inverse Fourier transform on a time-domain input?
What would be the challenges to taking off and landing a typical passenger jet at FL300?
How to find if I need to exclude dependencies in a maven java project?
Is there a decent HTML Junit report plugin for Maven?How do I efficiently iterate over each entry in a Java Map?How do I read / convert an InputStream into a String in Java?How do I generate random integers within a specific range in Java?How can I create an executable JAR with dependencies using Maven?How do I determine whether an array contains a particular value in Java?How to add local jar files to a Maven project?How do I convert a String to an int in Java?IntelliJ inspection gives “Cannot resolve symbol” but still compiles codeImport Maven dependencies in IntelliJ IDEADealing with “Xerces hell” in Java/Maven?
.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;
I use both Intellij IDEA (2018.3.5) & Eclipse IDEs, but I prefer Intellij. I have a maven based Java project with multiple poms. I added some dependencies to one of the pom files. I need to find out if there are any dependency conflicts which could prevent the build from running when its deployed, and then exclude them. I tried the steps given below to find conflicts which could cause problems. Are they enough or do I need to do more ?
Check if there are any compile time dependency conflicts with
mvn clean install -DskipTests
. Build was successful with no errors.Check if Intellij shows no problems under File > Project Structure > Problems. There are no problems.
I also saw the dependency tree with mvn dependency:tree -Dverbose
. It has a lot of "omitted for duplicate" and "omitted for conflict with" items, but the build was successful. I don't see any errors though. Does this mean that everything is okay or do I have to do something more about these conflicts ?
java maven
add a comment |
I use both Intellij IDEA (2018.3.5) & Eclipse IDEs, but I prefer Intellij. I have a maven based Java project with multiple poms. I added some dependencies to one of the pom files. I need to find out if there are any dependency conflicts which could prevent the build from running when its deployed, and then exclude them. I tried the steps given below to find conflicts which could cause problems. Are they enough or do I need to do more ?
Check if there are any compile time dependency conflicts with
mvn clean install -DskipTests
. Build was successful with no errors.Check if Intellij shows no problems under File > Project Structure > Problems. There are no problems.
I also saw the dependency tree with mvn dependency:tree -Dverbose
. It has a lot of "omitted for duplicate" and "omitted for conflict with" items, but the build was successful. I don't see any errors though. Does this mean that everything is okay or do I have to do something more about these conflicts ?
java maven
add a comment |
I use both Intellij IDEA (2018.3.5) & Eclipse IDEs, but I prefer Intellij. I have a maven based Java project with multiple poms. I added some dependencies to one of the pom files. I need to find out if there are any dependency conflicts which could prevent the build from running when its deployed, and then exclude them. I tried the steps given below to find conflicts which could cause problems. Are they enough or do I need to do more ?
Check if there are any compile time dependency conflicts with
mvn clean install -DskipTests
. Build was successful with no errors.Check if Intellij shows no problems under File > Project Structure > Problems. There are no problems.
I also saw the dependency tree with mvn dependency:tree -Dverbose
. It has a lot of "omitted for duplicate" and "omitted for conflict with" items, but the build was successful. I don't see any errors though. Does this mean that everything is okay or do I have to do something more about these conflicts ?
java maven
I use both Intellij IDEA (2018.3.5) & Eclipse IDEs, but I prefer Intellij. I have a maven based Java project with multiple poms. I added some dependencies to one of the pom files. I need to find out if there are any dependency conflicts which could prevent the build from running when its deployed, and then exclude them. I tried the steps given below to find conflicts which could cause problems. Are they enough or do I need to do more ?
Check if there are any compile time dependency conflicts with
mvn clean install -DskipTests
. Build was successful with no errors.Check if Intellij shows no problems under File > Project Structure > Problems. There are no problems.
I also saw the dependency tree with mvn dependency:tree -Dverbose
. It has a lot of "omitted for duplicate" and "omitted for conflict with" items, but the build was successful. I don't see any errors though. Does this mean that everything is okay or do I have to do something more about these conflicts ?
java maven
java maven
edited Mar 27 at 19:27
MasterJoe2
asked Mar 27 at 17:28
MasterJoe2MasterJoe2
5087 silver badges31 bronze badges
5087 silver badges31 bronze badges
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
The best way to tell if everything is fine with your application is to have good tests.
However normally one doesn't exclude transitive dependencies from project's <dependency>
libraries. Doing it can potentially break the dependency in a subtle and hard to notice way. It's usually safer to remove the whole <dependency>
.
There are few scenario when one should use <exclude>
:
Dealing with incompatible transitive dependencies between different libraries e.g. A requires library C-1.0 but library B requires library C-2.0 while C-1.0 and C-2.0 can't coexist on the classpath.
Having transitive dependencies already provided by system e.g. deploying to Tomcat with additional JARs in the
TOMCAT_HOME/lib
directory.
If you decide to exclude a dependency it's important that you check the final artifact because sometimes plugins do weird things e.g. there were versions of maven-assembly-plugin
affected by a bug that resulted in different dependencies being resolved during shaded JAR creation than maven-dependency-plugin
used for compilation.
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
add a comment |
Your Answer
StackExchange.ifUsing("editor", function ()
StackExchange.using("externalEditor", function ()
StackExchange.using("snippets", function ()
StackExchange.snippets.init();
);
);
, "code-snippets");
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "1"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55383266%2fhow-to-find-if-i-need-to-exclude-dependencies-in-a-maven-java-project%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
The best way to tell if everything is fine with your application is to have good tests.
However normally one doesn't exclude transitive dependencies from project's <dependency>
libraries. Doing it can potentially break the dependency in a subtle and hard to notice way. It's usually safer to remove the whole <dependency>
.
There are few scenario when one should use <exclude>
:
Dealing with incompatible transitive dependencies between different libraries e.g. A requires library C-1.0 but library B requires library C-2.0 while C-1.0 and C-2.0 can't coexist on the classpath.
Having transitive dependencies already provided by system e.g. deploying to Tomcat with additional JARs in the
TOMCAT_HOME/lib
directory.
If you decide to exclude a dependency it's important that you check the final artifact because sometimes plugins do weird things e.g. there were versions of maven-assembly-plugin
affected by a bug that resulted in different dependencies being resolved during shaded JAR creation than maven-dependency-plugin
used for compilation.
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
add a comment |
The best way to tell if everything is fine with your application is to have good tests.
However normally one doesn't exclude transitive dependencies from project's <dependency>
libraries. Doing it can potentially break the dependency in a subtle and hard to notice way. It's usually safer to remove the whole <dependency>
.
There are few scenario when one should use <exclude>
:
Dealing with incompatible transitive dependencies between different libraries e.g. A requires library C-1.0 but library B requires library C-2.0 while C-1.0 and C-2.0 can't coexist on the classpath.
Having transitive dependencies already provided by system e.g. deploying to Tomcat with additional JARs in the
TOMCAT_HOME/lib
directory.
If you decide to exclude a dependency it's important that you check the final artifact because sometimes plugins do weird things e.g. there were versions of maven-assembly-plugin
affected by a bug that resulted in different dependencies being resolved during shaded JAR creation than maven-dependency-plugin
used for compilation.
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
add a comment |
The best way to tell if everything is fine with your application is to have good tests.
However normally one doesn't exclude transitive dependencies from project's <dependency>
libraries. Doing it can potentially break the dependency in a subtle and hard to notice way. It's usually safer to remove the whole <dependency>
.
There are few scenario when one should use <exclude>
:
Dealing with incompatible transitive dependencies between different libraries e.g. A requires library C-1.0 but library B requires library C-2.0 while C-1.0 and C-2.0 can't coexist on the classpath.
Having transitive dependencies already provided by system e.g. deploying to Tomcat with additional JARs in the
TOMCAT_HOME/lib
directory.
If you decide to exclude a dependency it's important that you check the final artifact because sometimes plugins do weird things e.g. there were versions of maven-assembly-plugin
affected by a bug that resulted in different dependencies being resolved during shaded JAR creation than maven-dependency-plugin
used for compilation.
The best way to tell if everything is fine with your application is to have good tests.
However normally one doesn't exclude transitive dependencies from project's <dependency>
libraries. Doing it can potentially break the dependency in a subtle and hard to notice way. It's usually safer to remove the whole <dependency>
.
There are few scenario when one should use <exclude>
:
Dealing with incompatible transitive dependencies between different libraries e.g. A requires library C-1.0 but library B requires library C-2.0 while C-1.0 and C-2.0 can't coexist on the classpath.
Having transitive dependencies already provided by system e.g. deploying to Tomcat with additional JARs in the
TOMCAT_HOME/lib
directory.
If you decide to exclude a dependency it's important that you check the final artifact because sometimes plugins do weird things e.g. there were versions of maven-assembly-plugin
affected by a bug that resulted in different dependencies being resolved during shaded JAR creation than maven-dependency-plugin
used for compilation.
edited May 21 at 20:24
answered Mar 27 at 17:36
Karol DowbeckiKarol Dowbecki
30.1k9 gold badges43 silver badges62 bronze badges
30.1k9 gold badges43 silver badges62 bronze badges
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
add a comment |
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
Thanks. I haven't removed any <exclude>. I want to find out if I need to exclude anything just because of adding some new dependencies to one of the poms. I updated my title just now to clarify. mvn clean package - I see some test failures after this. I am looking into them.
– MasterJoe2
Mar 27 at 19:26
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
The only good answer is: have good enough tests to tell you that you can release if the project builds. Try to decrease number of dependencies if you don't need them.
– Karol Dowbecki
Mar 27 at 19:31
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
It was suggested to me that I run the app. Thats when a dependency conflict came up. I don't know if this is also needed to discover conflicts.
– MasterJoe2
May 21 at 20:13
add a comment |
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Got a question that you can’t ask on public Stack Overflow? Learn more about sharing private information with Stack Overflow for Teams.
Thanks for contributing an answer to Stack Overflow!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55383266%2fhow-to-find-if-i-need-to-exclude-dependencies-in-a-maven-java-project%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown