Maven项目创建及依赖添加权限错误求助
Hey there, let's work through these Maven issues you're facing step by step:
Issue 1: Failed to resolve org.apache.maven.archetypes:maven-archetype-quickstart:1.1 + Permission denied when creating Maven project directly in Eclipse
Here are targeted fixes for both problems:
Fix the permission denied error
This usually happens because Eclipse doesn't have write access to its installation directory or your workspace folder. Try these:- Right-click the Eclipse icon and select Run as administrator to get elevated permissions.
- Move your Eclipse workspace to a non-system drive (e.g., from C: to D:), since system directories often have strict permission restrictions.
Fix archetype resolution failure
The most common cause is network issues accessing the default Maven Central Repository. Here's how to fix it:- Add a domestic Maven mirror (like Alibaba Cloud) to your
settings.xmlfile (located in~/.m2/or your Maven installation'sconffolder). Insert this inside the<mirrors>node:<mirror> <id>aliyunmaven</id> <mirrorOf>central</mirrorOf> <url>https://maven.aliyun.com/repository/public</url> </mirror> - If the mirror doesn't work, manually download the archetype:
Locateorg.apache.maven.archetypes:maven-archetype-quickstart:1.1in Maven Central, download the.jarand.pomfiles, and place them in your local repository path:~/.m2/repository/org/apache/maven/archetypes/maven-archetype-quickstart/1.1. - Alternatively, skip archetype selection temporarily: When creating the Maven project, check Create a simple project (skip archetype selection) to create a basic project first, then add necessary configurations later.
- Add a domestic Maven mirror (like Alibaba Cloud) to your
Issue 2: Failed to read artifact descriptor for selenium-java:3.12.0 after converting a regular project to Maven
Try these troubleshooting steps:
- Verify Maven mirror configuration
Make sure the mirror you added insettings.xmlcovers Selenium dependencies (the Alibaba Cloud mirror we mentioned earlier does this by default). - Clear local repository cache
Corrupted cache files often cause this error. Delete the folder~/.m2/repository/org/seleniumhq/selenium/selenium-java/3.12.0, then right-click your project in Eclipse → Maven → Update Project, check Force Update of Snapshots/Releases, and click OK to re-download the dependency. - Ensure Eclipse uses your external Maven installation
Sometimes Eclipse defaults to its built-in Maven instead of your configured 3.5.3 version. Go to Window → Preferences → Maven → Installations, add your Apache Maven 3.5.3 directory, and set it as the default. - Check JDK compatibility
Selenium 3.12.0 is compatible with JDK 1.8, but confirm your project uses the correct JDK: Right-click the project → Properties → Java Build Path → Libraries, ensure the JRE System Library is set to JDK 1.8.0_171.
内容的提问来源于stack exchange,提问作者vanibhat
相关产品推荐
相关产品推荐

