jfrog / jenkins-artifactory-plugin

Jenkins artifactory plugin
http://jenkins-ci.org/
115 stars 186 forks source link

"Illegal key size" when building Maven projects #932

Open afolgado opened 1 month ago

afolgado commented 1 month ago

Describe the bug When building Maven projects, the following error throws:

ERROR org.apache.maven.cli.MavenCli - Internal error: java.lang.RuntimeException: Unable to load build info properties from file: <project_workspace>@tmp/artifactory/buildInfo5975272843518464698.properties: Illegal key size -> [Help 1]
org.apache.maven.InternalErrorException: Internal error: java.lang.RuntimeException: Unable to load build info properties from file: <project_workspace>@tmp/artifactory/buildInfo5975272843518464698.properties
    at org.apache.maven.DefaultMaven.execute (DefaultMaven.java:120)
    at org.apache.maven.cli.MavenCli.execute (MavenCli.java:954)
    at org.apache.maven.cli.MavenCli.doMain (MavenCli.java:288)
    at org.apache.maven.cli.MavenCli.main (MavenCli.java:192)
    [...]
Caused by: java.lang.RuntimeException: Unable to load build info properties from file: /opt/jenkins/workspace/AF_HerramientasEstandares/hello-world/hello-world-maven/HelloWorld_PREPRO@tmp/artifactory/buildInfo5975272843518464698.properties
    at org.jfrog.build.extractor.BuildInfoExtractorUtils.searchAdditionalPropertiesFile (BuildInfoExtractorUtils.java:118)
    at org.jfrog.build.extractor.BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile (BuildInfoExtractorUtils.java:70)
    at org.jfrog.build.extractor.maven.resolver.ResolutionHelper.init (ResolutionHelper.java:31)
    at org.jfrog.build.extractor.maven.ArtifactoryProjectBuilder.build (ArtifactoryProjectBuilder.java:37)
    [...]
Caused by: java.security.InvalidKeyException: Illegal key size
    at javax.crypto.Cipher.checkCryptoPerm (Cipher.java:1039)
    at javax.crypto.Cipher.implInit (Cipher.java:805)
    at javax.crypto.Cipher.chooseProvider (Cipher.java:864)
    at javax.crypto.Cipher.init (Cipher.java:1396)
    at javax.crypto.Cipher.init (Cipher.java:1327)
    at org.jfrog.build.extractor.clientConfiguration.util.encryption.Encryptor.decrypt (Encryptor.java:29)
    at org.jfrog.build.extractor.clientConfiguration.util.encryption.PropertyEncryptor.decryptProperties (PropertyEncryptor.java:50)
    at org.jfrog.build.extractor.clientConfiguration.util.encryption.PropertyEncryptor.decryptPropertiesFromFile (PropertyEncryptor.java:39)
    at org.jfrog.build.extractor.BuildInfoExtractorUtils.searchAdditionalPropertiesFile (BuildInfoExtractorUtils.java:110)
    at org.jfrog.build.extractor.BuildInfoExtractorUtils.mergePropertiesWithSystemAndPropertyFile (BuildInfoExtractorUtils.java:70)
    at org.jfrog.build.extractor.maven.resolver.ResolutionHelper.init (ResolutionHelper.java:31)
    at org.jfrog.build.extractor.maven.ArtifactoryProjectBuilder.build (ArtifactoryProjectBuilder.java:37)
    [...]

To Reproduce Launch maven build like this:

java -classpath <maven_home>/boot/* -Dmaven.home=<maven_home> -Dmaven.conf=<maven_home>/conf -DbuildInfoConfig.propertiesFile=<project_workspace>@tmp/artifactory/buildInfo5975272843518464698.properties -DbuildInfoConfig.artifactoryResolutionEnabled=true -Dm3plugin.lib=<project_workspace>@tmp/artifactory/cache/artifactory-plugin/4.0.6 -Dclassworlds.conf=<project_workspace>@tmp/artifactory/classworlds319286975383297032conf -Dmaven.multiModuleProjectDirectory=<project_workspace> -Djansi.force=true -Xmx2048m org.codehaus.plexus.classworlds.launcher.Launcher -f pom.xml clean install

Expected behavior It should execute Maven goals, produce its artifacts and capture build info without errors.

Versions

Additional context Because of the exception thrown, my guess is that this error is caused by this feature introduced in version 4.0.1: https://github.com/jfrog/build-info/pull/766