Hi,

> I am kind of new to Maven.
> 
> I have following JDK and Maven version

(...)

> 1.       I am getting following error when I try to  create from File --> New 
> --> Maven Project --> Entering Group Id and Artifact Id --> Finish.
> 
> Could not resolve archetype 
> org.apache.maven.archetypes:maven-archetype-quickstart:1.1 from any of the 
> configured repositories.
> Could not write artifact lastUpdated status
> C:\Users\i716181\.m2\repository\org\apache\maven\archetypes\maven-archetype-quickstart\1.1\m2e-lastUpdated.properties
>  (Access is denied).
> 
> 
> 
> 2.       I tried to create a simple project and then convert to Maven. This 
> is successful but when I try to add dependency for selenium using the Add 
> dependency wizard - I get this error
> 
> "Failed to read artifact descriptor for 
> org.seleniumhq.selenium:selenium-java:jar:3.12.0

(...)

> Caused by: org.eclipse.aether.resolution.ArtifactResolutionException: Could 
> not transfer artifact org.seleniumhq.selenium:selenium-java:pom:3.12.0 
> from/to central (https://repo.maven.apache.org/maven2): 
> sun.security.validator.ValidatorException: PKIX path building failed: 
> sun.security.provider.certpath.SunCertPathBuilderException: unable to find 
> valid certification path to requested target

This is the root cause of your problem:
According to your stack trace I assume that you're inside of a corporate 
network. Do you have to use a proxy to connect to the internet via HTTP(S)? If 
yes, see [1]

Additionally I assume that your company uses an internal root CA for outgoing 
SSL traffic, right?

Java uses its own CA trust store (the file "cacerts" in the installation) and 
unfortunately doesn't use the ones built-in into Windows. The same applies to 
Firefox if you have it installed...

To let Java applications connect to the outside world via SSL, save this 
certificate to a file on your hard disc and install it into your Java 
installation by entering the following command on a command line with 
administrative privileges:

%> keytool -importcert -keystore cacerts -storepass changeit -alias 
<choose_alias_name> -file <your_certificate_file>

("changeit" is the default password for the keystore, btw.)

Attention:
If you install a JDK, you normally also have a JRE installed on your machine, 
and therefore you have the cacerts file twice on your machine:
%JAVA_HOME%\jre\lib\security
%JRE_HOME%\lib\security



[1] http://maven.apache.org/guides/mini/guide-proxies.html


HTH

Thorsten

Attachment: signature.asc
Description: Message signed with OpenPGP

Reply via email to