Maven 2 & 3

Missing artifact error text improvement

Details

  • Type: Improvement Improvement
  • Status: Closed Closed
  • Priority: Minor Minor
  • Resolution: Fixed
  • Affects Version/s: 2.0.6
  • Fix Version/s: 2.0.8
  • Labels:
    None
  • Complexity:
    Intermediate
  • Number of attachments :
    1

Description

I love how when an artifact can't be found, a nice error explains how to install it locally. This is a great technique for onboarding new maven users who might otherwise be frustrated, thinking that they can't use things no in the public repo. Kudos to whoever did this initial work.

Now I suggest you take it a step further by including instructions for deploying the file to a personal repo. For example:

Caused by: Missing:
----------
1) j2ssh:j2ssh-core:jar:0.2.9

Try downloading the file manually from the project website.

Then, install it using the command:
mvn install:install-file -DgroupId=j2ssh -DartifactId=j2ssh-core \
-Dversion=0.2.9 -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:

mvn deploy:deploy-file -DgroupId=j2ssh -DartifactId=j2ssh-core \
-Dversion=0.2.9 -Dpackaging=jar -Dfile=/path/to/file
-Durl=... -DrepositoryId=...

Path to dependency:
1) com.hostedqa:hostedqa-anywhere-server:jar:1.7.4-SNAPSHOT
2) j2ssh:j2ssh-core:jar:0.2.9

Activity

Hide
Jason van Zyl added a comment -

Suggested applied.

Show
Jason van Zyl added a comment - Suggested applied.
Hide
Patrick Lightbody added a comment -

I see this is done, but the text output looks like utter shit. Attaching a screenshot to show you

Show
Patrick Lightbody added a comment - I see this is done, but the text output looks like utter shit. Attaching a screenshot to show you
Hide
Mauro Talevi added a comment -

Fixed format to appear as follows - also added unit test for it.

Missing artifact

Try downloading the file manually from:
http://somewhere.com/download

Then, install it using the command:
mvn install:install-file -DgroupId=aGroupId -DartifactId=anArtifactId \
-Dversion=aVersion -Dclassifier=aClassifier -Dpackaging=jar -Dfile=/path/to/file

Alternatively, if you host your own repository you can deploy the file there:
mvn deploy:deploy-file -DgroupId=aGroupId -DartifactId=anArtifactId \
-Dversion=aVersion -Dclassifier=aClassifier -Dpackaging=jar -Dfile=/path/to/file \
-Durl=[url] -DrepositoryId=[id]

Path to dependency:
1) dependency1
2) dependency2

Show
Mauro Talevi added a comment - Fixed format to appear as follows - also added unit test for it. Missing artifact Try downloading the file manually from: http://somewhere.com/download Then, install it using the command: mvn install:install-file -DgroupId=aGroupId -DartifactId=anArtifactId \ -Dversion=aVersion -Dclassifier=aClassifier -Dpackaging=jar -Dfile=/path/to/file Alternatively, if you host your own repository you can deploy the file there: mvn deploy:deploy-file -DgroupId=aGroupId -DartifactId=anArtifactId \ -Dversion=aVersion -Dclassifier=aClassifier -Dpackaging=jar -Dfile=/path/to/file \ -Durl=[url] -DrepositoryId=[id] Path to dependency: 1) dependency1 2) dependency2
Hide
Mauro Talevi added a comment -

I'll postpone merging to 2.1 trunk until this issue is closed on 2.0.x branch.

Please confirm that the fix addresses the formatting issues.

IMO - we could also remove the '\ ' and have the install/deploy commands appear in a single line.

Most command line terminal handle quite well the long line wrapping.

Show
Mauro Talevi added a comment - I'll postpone merging to 2.1 trunk until this issue is closed on 2.0.x branch. Please confirm that the fix addresses the formatting issues. IMO - we could also remove the '\ ' and have the install/deploy commands appear in a single line. Most command line terminal handle quite well the long line wrapping.
Hide
Oleksandr Maksymchuk added a comment -

I also support putting command into one line as for Windows users '\' need to be stripped manually.

Show
Oleksandr Maksymchuk added a comment - I also support putting command into one line as for Windows users '\' need to be stripped manually.
Hide
Brian Fox added a comment -

put it on one line

Show
Brian Fox added a comment - put it on one line

People

Vote (1)
Watch (1)

Dates

  • Created:
    Updated:
    Resolved: