The supplied phased action failed with an exception.
A problem occurred configuring root project 'mcp-reborn'.
Could not resolve all dependencies for configuration ':classpath'.
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven(http://files.minecraftforge.net/maven)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/7.4/dsl/org.gradle.api.artifacts.repositories.UrlArtifactRepository.html#org.gradle.api.artifacts.repositories.UrlArtifactRepository:allowInsecureProtocol for more details. MCP-Reborn-1.16 line 0 Gradle Error Marker
can someone help with this error?
Related
After updating to Gradle 7.3.0 I having this message error :
Using insecure protocols with repositories, without explicit opt-in, is unsupported. Switch Maven repository 'maven4(http://dl.bintray.com/glomadrian/maven)' to redirect to a secure protocol (like HTTPS) or allow insecure protocols. See https://docs.gradle.org/8.0-milestone-1/dsl/org.gradle.api.artifacts.repositories.UrlArtifactReposit... for more details
any suggestions?
so what solve it ,it's just adding -4- to Maven , something like Maven4 instead of just Maven in the app build Gradle Mavens declarations.
this is my first question on SO I'll try my best to make it good.
My team deploys multiple Java Cloud Functions (GCP) using a few common classes (with maven to manage dependencies). Right now those classes are duplicated in each function and have to be updated everywhere at each code edit. Each Cloud Function is deployed from source.
To avoid duplicating those classes I packaged them in a jar, everything runs fine locally. I added this jar as a local dependency in each Cloud Function pom file and tried to deploy from jar by building a jar with all dependencies and providing it in the --source option of gcloud deploy. This causes a timeout error from what seems to be the jar uploading.
Error trace :
DEBUG: Starting new HTTPS connection (1): storage.googleapis.com:443
DEBUG: Caught socket error, retrying: ('Connection aborted.', timeout('The write operation timed out',))
What I tried so far :
Setting a higher deployment timeout with gcloud config set app/cloud_build_timeout 10000 but this doesn't seem to apply to the uploading step as it fails always after a few minutes.
Uploading my local dependency to a private nexus repository to deploy my functions from source as before, but the pull failed on a Wagon error when I run mvn package and I didn't find any solution either : WagonTransporterFactory: Unsupported transport protocol
Detailed error :
[ERROR] Failed to execute goal on project get-content: Could not resolve dependencies for project project:cf:jar:1.0: Failed to collect dependencies at project:pipeline:jar:0.0.1: Failed to read artifact descriptor for project:pipeline:jar:0.0.1: Could not transfer artifact project:pipeline:pom:0.0.1 from/to project-nexus (XXX): Cannot access XXX with type default using the available connector factories: BasicRepositoryConnectorFactory: Cannot access XXX using the registered transporter factories: WagonTransporterFactory: Unsupported transport protocol -> [Help 1]
I beleive this is only due to my jar with dependencies being to large for upload as I actually deployed the jar without dependency by mistake first (deploy succeded but class definition missing during execution). My question is how can I deploy my Cloud Function with one local/private dependency ?
Note :
I can't upload my dependency to a public maven repository
Each Cloud Function depends also on public maven dependencies which seems to be too large to package in a single jar for deployment
I solved this by switching from Maven to Gradle.
The problem was that Maven stores the repository authentification parameters in a local file ~/.m2/settings.xml that Google Build can't access when building my Cloud Function for deployment.
I switched to Gradle to provide the authenfication in the gradle.build file directly following this question.
I'm trying to setup the sample app to load 100 docs in MarkLogic server using the spring batch git documentation but I get this error everytime I try to run my job:
*** What went wrong:
Execution failed for task ':runYourJob'.
> Could not resolve all files for configuration ':testRuntimeClasspath'.
> Could not download marklogic-xcc.jar (com.marklogic:marklogic-xcc:9.0.2)
> Could not get resource 'https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar'.
> Could not GET 'https://repo.jfrog.org/artifactory/libs-release-bintray/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar?referrer'.
> PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target**
The URL for the basic setup is here: https://github.com/marklogic-community/marklogic-spring-batch/wiki/Getting-Started
I'm using IntelliJ as the IDE & also tried to download & add the .jar to the classpath dependency. I'd appreciate any help here. I'm not sur if this could be a gradle issue.
EDIT: This error is common while building any marklogic gradle app & not specific to spring. I'm using MarkLogic 10 & gradle version 5.4.1 on adoptOpenJDK11 in a windows 10 machine.
Could not get resource 'https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/marklogic-xcc-9.0.2.jar'
The location https://jcenter.bintray.com/com/marklogic/marklogic-xcc/9.0.2/ does not contain the requested jar marklogic-xcc-9.0.2.jar. Make sure to point to a valid maven repository containing that jar.
The root cause of your error is that a dependency is missing in the build.gradle.
My Spring framework MVC version is:
MarkLogic Java API 5.3.0
JDK 11
Spring Framework 5.2.7
Spring Batch 4.2.4
If you clone the whole project and have not upgraded any dependencies:
Add line 24 in the core:build.gradle
Load gradle change in IntelliJ and clean deploy the project.
Upon the successful gradle build, an App server (in my case, App name is ml-spring-batch # 7010) is scaffolded:
In IntelliJ, execute gradle task against samples ONLY. In cmd, run task: gradle runYourJob. Upon the gradle task completion, 100 documents are loaded in the content database.
I have a remote repository with an https URL and a self-signed certificate. In Maven I could set MAVEN_OPTS properties to bypass certificate validation. How can I achive this with gradle?
I tried modifying the file gradle.properties but I can’t find the exact properties:
systemProp.http.ssl.insecure=true
systemProp.http.ssl.allowall=true
systemProp.http.ssl.ignore.validity.dates=true
Gradle "Trust All" Plugin
This plugin was born out of necessity for a quick-and-dirty way to use a Maven repository over HTTPS with a self-signed certificate.
When working with such a repository in gradle you may get an error:
Error transferring file: sun.security.validator.ValidatorException:
PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException:
unable to find valid certification path to requested target
Usual Java way to handle such scenario would be to download site certificate, import it into a keystore, and use that keystore via the -Djavax.net.ssl.trustStore=... JVM options.
Sometimes, you just need an easier way — disable certificate validation altogether! There are many reasons not to do that, one of them being that this approach makes connections vulnerable to man-in-the-middle attacks.
Consider this code a proof-of-concept and accept full responsibility that by using it you're ultimately making an informed bad decision.
Origin
The code to disable certificate validation comes from this StackOverflow answer, although there are many similar code snippets floating around the web.
Using "Trust All" Plugin
To use gradle-trust-all, build the jar file and include it in your project:
$ git clone https://github.com/arteme/gradle-trust-all.git
$ cd gradle-trust-all
$ gradle build
$ cp build/libs/gradle-trust-all.jar /path/to/your/project/gradle/folder/
Then in your project's build.gradle file add it as a buildscript dependency and activate the plugin:
buildscript {
dependencies {
classpath files('gradle/gradle-trust-all.jar')
}
}
apply plugin: 'trust-all'
That is it. Now certificate validation in gradle is disabled.
https://github.com/arteme/gradle-trust-all
I'm getting an exception (java.net.ConnectException: Connection refused: connect.) when trying to compile a maven project using the jaxb2 plugin to generate the class by a wsdl provided by a url.
However, I can get this wsdl when get it by a browser.
Any ideas?
Thanks.
While you might be able to resolve the connection issues given the comments above, the error message shows a fundamental problem in your build. If your maven build downloads the WSDL each time it compiles, you don't have repeatable builds, as the WSDL can change each time it's accessed. While it might be convenient to alway load the latest WSDL, I'd recommend downloading the WSDL and add it to your src tree. Then your build will not break, if the WSDL changes. You need to take take, however, to manually update the WSDL if you want to support a newer version.
The instructions on how to setup a proxy in jaxb2: https://github.com/highsource/maven-jaxb2-plugin/wiki/Configuring-Proxies/c32d4e2af4ab9c1fd5b3d67fb559ec32affab745
I just put <useActiveProxyAsHttpproxy>true</useActiveProxyAsHttpproxy> in my configuration tag of plugin.
Also, I prev set the proxy on my maven settings.xml
I had the same error in a java project built with maven and. On compilation the plugin tries to get some sources on the net and my company had set up a proxy. So you have to configure correctly your settings.xml and add
<useActiveProxyAsHttpproxy>true</useActiveProxyAsHttpproxy>
to the configuration tag of the plugin causing the error in the pom.xml