SlideShare una empresa de Scribd logo
1 de 17
Descargar para leer sin conexión
Maven Troubleshooting
Tips and FAQs
Alan Richardson
www.compendiumdev.co.uk
www.eviltester.com
www.seleniumsimplified.com
www.javafortesters.com
@eviltester
Maven is Great
… when you get it working
… most problems occur trying to get it working
… at the point that you know least
These Tips and FAQs can help you when you
get stuck.
TIP: Debug maven issues from the
command line, not from the IDE
Use the command line to debug maven
problems, that way it is just Maven and Java
that you are working with.
This way you can see the error messages
generated.
TIP: Read the error messages
If maven is complaining about corrupt jars then chances
are something went wrong when it was downloading the
dependencies, delete them and try again.
If your compile is complaining that it can't find classes from
libraries in your class path then maven didn't download the
dependencies, delete them and try again.
You might be able to run with the "-q" option to zoom in on
errors, warnings and messages output by the plugins.
TIP: Read and work through "Maven
in 5 minutes"
Before doing anything.
Read and work through "Maven in 5 minutes"
http://maven.apache.org/guides/getting-
started/maven-in-five-minutes.html
This is a good check if you have installed maven correctly
and if maven can connect to the internet. Since it is all done
from the command line, any problems you encounter will be
related to maven.
TIP: Compile without running tests
mvn clean compile -DskipTests=true
This helps you focus on the maven
dependency problems, and you won’t be
distracted by any other error messages.
Tip: Download issues
Maven shows you the urls it tries to download,
try them manually by entering the URL in your
browser.
Check your proxy settings, in case Maven is
blocked by your firewall.
If a url fails, and you aren't blocked try and
force a download again with
mvn clean -DskipTests=true
TIP: Set proxy settings for maven
● find the file in %M2_HOME%conf
● edit the settings.xml file
Helpful Links:
● http://seleniumsimplified.com/2013/08/16/maven-proxies-troubleshooting-
404-errors/
● http://www.mkyong.com/maven/how-to-enable-proxy-setting-in-maven/
● http://stackoverflow.com/questions/4828567/maven-proxy-settings
● http://stackoverflow.com/questions/2354001/make-maven-proxy-server-
settings-configurable-based-on-location?rq=1
TIP: Read the maven FAQs
http://maven.apache.org/users/getting-help.
html
Read the maven "how to I get help" section
http://maven.apache.org/users/getting-help.
html
TIP: Read some other hints and tips
see - Algorithm for troubleshooting “Maven
doesn't work for me” problems
http://stackoverflow.
com/questions/2690343/algorithm-for-
troubleshooting-maven-doesnt-work-for-me-
problems
TIP: Force update of dependencies
mvn clean compile -U -DskipTests=true
TIP: Delete your local repository
cache
from %UserProfile%.m2repository
delete whichever folders you want from the
cache to force a download, then do a ...
mvn clean compile -DskipTests=true
TIP: Force a purge of local repository
mvn dependency:purge-local-repository
http://maven.apache.org/plugins/maven-
dependency-plugin/purge-local-repository-
mojo.html
TIP: Look at the effective pom and
settings
mvn help:effective-pom
Shows you the full pom, with the fields,
defaults, inheritence and paths.
mvn help:effective-settings
Shows the settings with full output
TIP: Use the dependency tree
A bit more advanced but...
mvn dependency:tree
Can show you all dependencies and versions, if
you have ordering clashes then this might
reveal them.
Final Notes
1. Run Maven from the command line
2. Read the error messages
3. Google for the error messages.
○ Other people will have faced the same problem.
4. Experiment with these tips
Do all of this, Before you ask for help. That way you will
learn more about how maven works, and won’t be so
dependent on other people.
Alan Richardson
uk.linkedin.com/in/eviltester
Independent Test Consultant based in
the UK. He offers training and
consultancy in Selenium WebDriver,
Exploratory and Technical web testing.
Contact Alan for training and
consultancy tailored to your needs:
http://compendiumdev.co.uk/contact
Blogs and Websites
● CompendiumDev.co.uk
● SeleniumSimplified.com
● EvilTester.com
● JavaForTesters.com
● Twitter: @eviltester
Online Training Courses
● Technical Web Testing 101
○ Unow.be/at/udemy101
● Intro to Selenium
○ Unow.be/at/udemystart
● Selenium 2 WebDriver API
○ Unow.be/at/udemyapi
Videos
youtube.com/user/EviltesterVideos
Books
Selenium Simplified
Unow.be/rc/selsimp
Java For Testers
leanpub.com/javaForTesters

Más contenido relacionado

Más de Alan Richardson

Más de Alan Richardson (20)

The Future of Testing Webinar
The Future of Testing WebinarThe Future of Testing Webinar
The Future of Testing Webinar
 
Devfest 2019-slides
Devfest 2019-slidesDevfest 2019-slides
Devfest 2019-slides
 
Secrets and Mysteries of Automated Execution Keynote slides
Secrets and Mysteries of Automated Execution Keynote slidesSecrets and Mysteries of Automated Execution Keynote slides
Secrets and Mysteries of Automated Execution Keynote slides
 
Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604Automating Pragmatically - Testival 20190604
Automating Pragmatically - Testival 20190604
 
Joy of Coding Conference 2019 slides - Alan Richardson
Joy of Coding Conference 2019 slides - Alan RichardsonJoy of Coding Conference 2019 slides - Alan Richardson
Joy of Coding Conference 2019 slides - Alan Richardson
 
Programming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStringsProgramming katas for Software Testers - CounterStrings
Programming katas for Software Testers - CounterStrings
 
Technology Based Testing
Technology Based TestingTechnology Based Testing
Technology Based Testing
 
About Consultant Alan Richardson Compendium Developments Evil Tester
About Consultant Alan Richardson Compendium Developments Evil TesterAbout Consultant Alan Richardson Compendium Developments Evil Tester
About Consultant Alan Richardson Compendium Developments Evil Tester
 
Shift left-testing
Shift left-testingShift left-testing
Shift left-testing
 
Automating and Testing a REST API
Automating and Testing a REST APIAutomating and Testing a REST API
Automating and Testing a REST API
 
Technical and Testing Challenges: Using the "Protect The Square" Game
Technical and Testing Challenges: Using the "Protect The Square" GameTechnical and Testing Challenges: Using the "Protect The Square" Game
Technical and Testing Challenges: Using the "Protect The Square" Game
 
TDD - Test Driven Development - Java JUnit FizzBuzz
TDD - Test Driven Development - Java JUnit FizzBuzzTDD - Test Driven Development - Java JUnit FizzBuzz
TDD - Test Driven Development - Java JUnit FizzBuzz
 
If you want to automate, you learn to code
If you want to automate, you learn to codeIf you want to automate, you learn to code
If you want to automate, you learn to code
 
How To Test With Agility
How To Test With AgilityHow To Test With Agility
How To Test With Agility
 
Your Automated Execution Does Not Have to be Flaky
Your Automated Execution Does Not Have to be FlakyYour Automated Execution Does Not Have to be Flaky
Your Automated Execution Does Not Have to be Flaky
 
What is Testability vs Automatability? How to improve your Software Testing.
What is Testability vs Automatability? How to improve your Software Testing.What is Testability vs Automatability? How to improve your Software Testing.
What is Testability vs Automatability? How to improve your Software Testing.
 
What is Agile Testing? A MindMap
What is Agile Testing? A MindMapWhat is Agile Testing? A MindMap
What is Agile Testing? A MindMap
 
Evil Tester's Guide to Agile Testing
Evil Tester's Guide to Agile TestingEvil Tester's Guide to Agile Testing
Evil Tester's Guide to Agile Testing
 
The Evil Tester Show - Episode 001 Halloween 2017
The Evil Tester Show - Episode 001 Halloween 2017The Evil Tester Show - Episode 001 Halloween 2017
The Evil Tester Show - Episode 001 Halloween 2017
 
What is Regression Testing?
What is Regression Testing?What is Regression Testing?
What is Regression Testing?
 

Último

CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
giselly40
 

Último (20)

Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
The Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptxThe Codex of Business Writing Software for Real-World Solutions 2.pptx
The Codex of Business Writing Software for Real-World Solutions 2.pptx
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdfUnderstanding Discord NSFW Servers A Guide for Responsible Users.pdf
Understanding Discord NSFW Servers A Guide for Responsible Users.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 

Maven troubleshooting tips and FAQs

  • 1. Maven Troubleshooting Tips and FAQs Alan Richardson www.compendiumdev.co.uk www.eviltester.com www.seleniumsimplified.com www.javafortesters.com @eviltester
  • 2. Maven is Great … when you get it working … most problems occur trying to get it working … at the point that you know least These Tips and FAQs can help you when you get stuck.
  • 3. TIP: Debug maven issues from the command line, not from the IDE Use the command line to debug maven problems, that way it is just Maven and Java that you are working with. This way you can see the error messages generated.
  • 4. TIP: Read the error messages If maven is complaining about corrupt jars then chances are something went wrong when it was downloading the dependencies, delete them and try again. If your compile is complaining that it can't find classes from libraries in your class path then maven didn't download the dependencies, delete them and try again. You might be able to run with the "-q" option to zoom in on errors, warnings and messages output by the plugins.
  • 5. TIP: Read and work through "Maven in 5 minutes" Before doing anything. Read and work through "Maven in 5 minutes" http://maven.apache.org/guides/getting- started/maven-in-five-minutes.html This is a good check if you have installed maven correctly and if maven can connect to the internet. Since it is all done from the command line, any problems you encounter will be related to maven.
  • 6. TIP: Compile without running tests mvn clean compile -DskipTests=true This helps you focus on the maven dependency problems, and you won’t be distracted by any other error messages.
  • 7. Tip: Download issues Maven shows you the urls it tries to download, try them manually by entering the URL in your browser. Check your proxy settings, in case Maven is blocked by your firewall. If a url fails, and you aren't blocked try and force a download again with mvn clean -DskipTests=true
  • 8. TIP: Set proxy settings for maven ● find the file in %M2_HOME%conf ● edit the settings.xml file Helpful Links: ● http://seleniumsimplified.com/2013/08/16/maven-proxies-troubleshooting- 404-errors/ ● http://www.mkyong.com/maven/how-to-enable-proxy-setting-in-maven/ ● http://stackoverflow.com/questions/4828567/maven-proxy-settings ● http://stackoverflow.com/questions/2354001/make-maven-proxy-server- settings-configurable-based-on-location?rq=1
  • 9. TIP: Read the maven FAQs http://maven.apache.org/users/getting-help. html Read the maven "how to I get help" section http://maven.apache.org/users/getting-help. html
  • 10. TIP: Read some other hints and tips see - Algorithm for troubleshooting “Maven doesn't work for me” problems http://stackoverflow. com/questions/2690343/algorithm-for- troubleshooting-maven-doesnt-work-for-me- problems
  • 11. TIP: Force update of dependencies mvn clean compile -U -DskipTests=true
  • 12. TIP: Delete your local repository cache from %UserProfile%.m2repository delete whichever folders you want from the cache to force a download, then do a ... mvn clean compile -DskipTests=true
  • 13. TIP: Force a purge of local repository mvn dependency:purge-local-repository http://maven.apache.org/plugins/maven- dependency-plugin/purge-local-repository- mojo.html
  • 14. TIP: Look at the effective pom and settings mvn help:effective-pom Shows you the full pom, with the fields, defaults, inheritence and paths. mvn help:effective-settings Shows the settings with full output
  • 15. TIP: Use the dependency tree A bit more advanced but... mvn dependency:tree Can show you all dependencies and versions, if you have ordering clashes then this might reveal them.
  • 16. Final Notes 1. Run Maven from the command line 2. Read the error messages 3. Google for the error messages. ○ Other people will have faced the same problem. 4. Experiment with these tips Do all of this, Before you ask for help. That way you will learn more about how maven works, and won’t be so dependent on other people.
  • 17. Alan Richardson uk.linkedin.com/in/eviltester Independent Test Consultant based in the UK. He offers training and consultancy in Selenium WebDriver, Exploratory and Technical web testing. Contact Alan for training and consultancy tailored to your needs: http://compendiumdev.co.uk/contact Blogs and Websites ● CompendiumDev.co.uk ● SeleniumSimplified.com ● EvilTester.com ● JavaForTesters.com ● Twitter: @eviltester Online Training Courses ● Technical Web Testing 101 ○ Unow.be/at/udemy101 ● Intro to Selenium ○ Unow.be/at/udemystart ● Selenium 2 WebDriver API ○ Unow.be/at/udemyapi Videos youtube.com/user/EviltesterVideos Books Selenium Simplified Unow.be/rc/selsimp Java For Testers leanpub.com/javaForTesters