0

In Maven for a cloned project (even multi-module) from GitHub if the mvn compile command is executed mostly happens the following:

  • it downloads all the dependencies declared according in the pom.xml file
  • it compiles
  • it executes the tests

Until here all is OK.

Now in the STS IDE is possible enable/disable the following checkboxes

  • Download Artifact Sources
  • Download Artifact Javadoc

as follows:

enter image description here

In the figure I have disabled them to save space in the repository.

  1. Assuming that mvn compile by default downloads both (pls confirm if that is correct)
  2. How I can indicate explicitly through parameters in the command that Maven should download or not each (Artifact Sources|Javadoc)? - therefore represent the GUI settings through parameters in the command line
Manuel Jordan
  • 15,253
  • 21
  • 95
  • 158
  • I don't think this can be done in command line. I guess it is a feature of m2e. – J Fabian Meier Aug 04 '21 at 19:13
  • even if you are correct - `m2e` should create internally or behind the scenes the command for Maven to be executed, right? – Manuel Jordan Aug 04 '21 at 19:26
  • 2
    Does this answer your question? [Get source JARs from Maven repository](https://stackoverflow.com/questions/2059431/get-source-jars-from-maven-repository) – SiKing Aug 04 '21 at 20:17
  • In some way, yes, About my question (1) seems the artifacts are not downloaded by default. It is good. (2) I must test the commands proposed. – Manuel Jordan Aug 04 '21 at 23:02
  • 1
    Note: `mvn compile` doesn't execute tests, see [Maven Build Lifecycle](https://maven.apache.org/guides/introduction/introduction-to-the-lifecycle.html#Lifecycle_Reference). And dependencies are are only downloaded if they aren't in the local Maven repo yet. – Gerold Broser Aug 05 '21 at 02:21
  • 2
    @ManuelJordan Note that m2e is most probably not just running Maven commands. Maven is written in Java and m2e as well. I guess they directly use the Maven libraries to contact Maven repositories. – J Fabian Meier Aug 05 '21 at 07:09
  • @GeroldBroser when I did mention about the "test" term I mean about to test if the commands proposed to indicate explicitly to get the artifacts works or not - sorry for the confusion – Manuel Jordan Aug 05 '21 at 13:32
  • @JFabianMeier I see, I am going to test the proposed solution(s) in the link shared. – Manuel Jordan Aug 05 '21 at 13:33
  • @ManuelJordan Your comment now is more confusing than your third list item is wrong and your first list item is imprecise . :) – Gerold Broser Aug 05 '21 at 13:52

0 Answers0