How to specify maven properies when using mvnd? - Stack Overflow

I get this error when trying to run mvnd clean install:[ERROR] The project com.exmpale:my-project:SP

I get this error when trying to run mvnd clean install:

[ERROR]   The project com.exmpale:my-project:SP-21.053.00_-SNAPSHOT (/home/username/IdeaProjects/my-project/pom.xml) has 1 error
[ERROR]     Non-resolvable import POM: The following artifacts could not be resolved: .assertj:assertj-bom:pom:3.25.0 (absent): Could not transfer artifact .assertj:assertj-bom:pom:3.25.0 from/to public (
/repository/public/): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 5739, column 19 -> [Help 2]

I was able to resolve it for maven by adding .mvn/jvm.config in project root:

-Dmaven.wagon.http.ssl.ignore.validity.dates=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.insecure=true

For mvnd I tried adding these properties to:

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation=".0.0 .0.0.xsd" xmlns=".0.0" xmlns:xsi=";>
    <localRepository>/home/username/.m2/repository</localRepository>
    <profiles>
        <profile>
            <id>default</id>
            <properties>
                <maven.wagon.http.ssl.allowall>true</maven.wagon.http.ssl.allowall>
                <maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure>
                <maven.wagon.http.ssl.ignore.validity.dates>true</maven.wagon.http.ssl.ignore.validity.dates>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
    </profiles>
    <!-- other tags are omitted -->
</settings>

.mvn/maven.config in project root:

-Dmaven.wagon.http.ssl.ignore.validity.dates=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.insecure=true

.mvnd.properties in jvmArgs property:

mvnd.jvmArgs=-Dmaven.wagon.http.ssl.ignore.validity.dates=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.insecure=true

and passing them through terminal:

mvnd clean install -Dmaven.wagon.http.ssl.ignore.validity.dates=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.insecure=true

But nothing helped.

mvn --version

Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /opt/apache-maven-3.8.8
Java version: 1.8.0_282, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/jdk8u282-b08/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.7.1-amd64", arch: "amd64", family: "unix"

mvnd --version

Apache Maven Daemon (mvnd) 1.0.2 linux-amd64 native client (cccc1ec8a5b741c62b29f9fb04d37b1678a029bb)
Terminal: .jline.terminal.impl.PosixSysTerminal with pty .jline.terminal.impl.jni.linux.LinuxNativePty
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /home/username/maven-mvnd-1.0.2-linux-amd64/mvn
Java version: 1.8.0_282, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/jdk8u282-b08/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.7.1-amd64", arch: "amd64", family: "unix"

I get this error when trying to run mvnd clean install:

[ERROR]   The project com.exmpale:my-project:SP-21.053.00_-SNAPSHOT (/home/username/IdeaProjects/my-project/pom.xml) has 1 error
[ERROR]     Non-resolvable import POM: The following artifacts could not be resolved: .assertj:assertj-bom:pom:3.25.0 (absent): Could not transfer artifact .assertj:assertj-bom:pom:3.25.0 from/to public (https://nexus-ci
/repository/public/): PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target @ line 5739, column 19 -> [Help 2]

I was able to resolve it for maven by adding .mvn/jvm.config in project root:

-Dmaven.wagon.http.ssl.ignore.validity.dates=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.insecure=true

For mvnd I tried adding these properties to:

settings.xml

<?xml version="1.0" encoding="UTF-8"?>
<settings xsi:schemaLocation="http://maven.apache./SETTINGS/1.0.0 http://maven.apache./xsd/settings-1.0.0.xsd" xmlns="http://maven.apache./SETTINGS/1.0.0" xmlns:xsi="http://www.w3./2001/XMLSchema-instance">
    <localRepository>/home/username/.m2/repository</localRepository>
    <profiles>
        <profile>
            <id>default</id>
            <properties>
                <maven.wagon.http.ssl.allowall>true</maven.wagon.http.ssl.allowall>
                <maven.wagon.http.ssl.insecure>true</maven.wagon.http.ssl.insecure>
                <maven.wagon.http.ssl.ignore.validity.dates>true</maven.wagon.http.ssl.ignore.validity.dates>
            </properties>
            <activation>
                <activeByDefault>true</activeByDefault>
            </activation>
        </profile>
    </profiles>
    <!-- other tags are omitted -->
</settings>

.mvn/maven.config in project root:

-Dmaven.wagon.http.ssl.ignore.validity.dates=true
-Dmaven.wagon.http.ssl.allowall=true
-Dmaven.wagon.http.ssl.insecure=true

.mvnd.properties in jvmArgs property:

mvnd.jvmArgs=-Dmaven.wagon.http.ssl.ignore.validity.dates=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.insecure=true

and passing them through terminal:

mvnd clean install -Dmaven.wagon.http.ssl.ignore.validity.dates=true -Dmaven.wagon.http.ssl.allowall=true -Dmaven.wagon.http.ssl.insecure=true

But nothing helped.

mvn --version

Apache Maven 3.8.8 (4c87b05d9aedce574290d1acc98575ed5eb6cd39)
Maven home: /opt/apache-maven-3.8.8
Java version: 1.8.0_282, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/jdk8u282-b08/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.7.1-amd64", arch: "amd64", family: "unix"

mvnd --version

Apache Maven Daemon (mvnd) 1.0.2 linux-amd64 native client (cccc1ec8a5b741c62b29f9fb04d37b1678a029bb)
Terminal: .jline.terminal.impl.PosixSysTerminal with pty .jline.terminal.impl.jni.linux.LinuxNativePty
Apache Maven 3.9.9 (8e8579a9e76f7d015ee5ec7bfcdc97d260186937)
Maven home: /home/username/maven-mvnd-1.0.2-linux-amd64/mvn
Java version: 1.8.0_282, vendor: AdoptOpenJDK, runtime: /usr/lib/jvm/jdk8u282-b08/jre
Default locale: en_US, platform encoding: UTF-8
OS name: "linux", version: "6.7.1-amd64", arch: "amd64", family: "unix"
Share Improve this question edited Nov 19, 2024 at 3:56 Aleksey asked Nov 18, 2024 at 10:03 AlekseyAleksey 32 bronze badges 2
  • 1 Where have you put them? Please show your setup? – khmarbaise Commented Nov 18, 2024 at 11:24
  • @khmarbaise Thanks for answering, I've updated the question – Aleksey Commented Nov 19, 2024 at 3:51
Add a comment  | 

1 Answer 1

Reset to default 0

I wasn't able to resolve the issue, but I found a workaround:

  1. do mvn clean install to download all dependencies required to build the project

  2. do mvnd -nsu -o clean install to run mvnd in offline mode

  3. if you get errors indicating that some dependencies are missing, for example:

[ERROR] dependency: .mockito:mockito-core:jar:1.9.5 (provided)
[ERROR]     Cannot access public (https://nexus-ci/repository/public/) in offline mode and the artifact .mockito:mockito-core:jar:1.9.5 has not been downloaded from it before.

just download required dependency: mvn dependency:get -DgroupId=.mockito -DartifactId=mockito-core -Dversion=1.9.5

and do mvnd -nsu -o clean install again

发布者:admin,转转请注明出处:http://www.yc00.com/questions/1745627947a4636924.html

相关推荐

  • How to specify maven properies when using mvnd? - Stack Overflow

    I get this error when trying to run mvnd clean install:[ERROR] The project com.exmpale:my-project:SP

    6小时前
    10

发表回复

评论列表(0条)

  • 暂无评论

联系我们

400-800-8888

在线咨询: QQ交谈

邮件:admin@example.com

工作时间:周一至周五,9:30-18:30,节假日休息

关注微信