Gradle failing to resolve PrimeFaces theme dependency: peer not authenticated - ssl

I have a Gradle Java project in which I'm using JSF with PrimeFaces.
In order to change it's theme, I added the required dependency in my build.gradle file, which most important parts are configured as follows:
apply plugin: 'war'
apply plugin: 'eclipse-wtp'
sourceCompatibility = 1.8
version = '1.0'
jar {
manifest {
attributes 'Implementation-Title': 'Arch Project',
'Implementation-Version': version
}
}
repositories {
mavenCentral()
jcenter()
maven { url 'https://repository.primefaces.org' }
maven { url 'https://repository.jboss.org/nexus/content/groups/public' }
}
configurations {
provided
}
sourceSets {
main.compileClasspath += configurations.provided
test.compileClasspath += configurations.provided
test.runtimeClasspath += configurations.provided
}
dependencies {
/* Cryptography API for BCrypt algorithm. */
compile 'de.svenkubiak:jBCrypt:0.4'
/* Primefaces. */
compile 'org.primefaces:primefaces:5.3'
/* Primefaces pepper grinder theme. */
compile 'org.primefaces.themes:pepper-grinder:1.0.10'
... another few dependencies
}
However, when I run gradle build on the console I get the following error:
C:\Users\bruno.gasparotto\git\archproject\archproject>gradle build
:compileJava
FAILURE: Build failed with an exception.
* What went wrong:
Could not resolve all dependencies for configuration ':compile'.
> Could not resolve org.primefaces.themes:pepper-grinder:1.0.10.
Required by:
:archproject:1.0
> Could not HEAD 'https://repository.primefaces.org/org/primefaces/themes/pepper-grinder/1.0.10/pepper-grinder-1.0.10.pom'.
> peer not authenticated
What I've tried and didn't work so far:
Changed the dependency from pepper-grinder to all-themes.
Replaced https with http on PrimeFaces repo configuration in my build.gradle file.
Also, it's important to mention that:
The url https://repository.primefaces.org/org/primefaces/themes/pepper-grinder/1.0.10/pepper-grinder-1.0.10.pom is available if I try to access it through the browser.
I am NOT behind a proxy.
If I remove the pepper-grinder dependency, it works just fine.
The same setup used to work more than year ago, so I believe something new is happening.
Any ideas?
Thanks is advance.

Related

How to cache gradle plugin dependencies?

I'm having a gradle script to execute Kotlin code with the gradle application plugin:
plugins {
id 'org.jetbrains.kotlin.jvm' version '1.4.10'
id 'application'
}
repositories {
mavenCentral()
}
dependencies {
implementation platform("org.jetbrains.kotlin:kotlin-bom")
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
// Some other deps
}
sourceSets {
main.kotlin.srcDirs += '.'
}
application {
mainClassName = 'MainKt'
}
What I would like to achieve: During the docker container startup I would like to load all the necessary dependencies with gradle build --build-cache command and be able to run gradle run --offline in the offline mode when the image is ready.
What do I have at the moment: I'm getting No cached version of org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable:1.4.10 available for offline mode. error because plugin dependencies are not being cached during the build phase.
Any ideas what I can do to force gradle to cache not only listed dependencies but also dependencies required by plugins?
Adding the plugin dependency to the dependency list explicitly helped me to resolve this issue:
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8"
implementation "org.jetbrains.kotlin:kotlin-scripting-compiler-embeddable" // <-- this solves the problem
// Some other deps
}
I hope this answer will be helpful! Although the use-case is pretty narrow.

how to fix "react-native-spinkit:unspecified"

What went wrong:
A problem occurred configuring project ':app'.
Could not resolve all dependencies for configuration ':app:_debugApk'.
A problem occurred configuring project ':react-native-spinkit'.
Could not resolve all dependencies for configuration ':react-native-spinkit:classpath'.
Could not resolve com.android.tools.build:gradle:2.0.0.
Required by:
Myproject:react-native-spinkit:unspecified
Could not resolve com.android.tools.build:gradle:2.0.0.
Could not get resource 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0/gradle-2.0.0.pom'.
Could not HEAD 'https://repo1.maven.org/maven2/com/android/tools/build/gradle/2.0.0/gradle-2.0.0.pom'. Received status code 403 from server: Forb
idden
android/build.gradle:
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
mavenLocal()
jcenter()
maven {
url "https://maven.google.com"
}
// Add jitpack repository (added by react-native-spinkit)
maven { url "https://jitpack.io" }
maven {
// All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
url "$rootDir/../node_modules/react-native/android"
}
}
}
The issue seems to be related to the version not supported com.android.tools.build:gradle:2.2.3.
You can try two thing here -
1) upgrade the versions to latest and try to build again.
2) Try to change version as given below to check if its working with version 2.0.0 or not
classpath 'com.android.tools.build:gradle:2.2.3'
with
classpath 'com.android.tools.build:gradle:2.0.0'.
Hope it solves your problem !

How to build kotlinx.coroutines in Kotlin/Native (test version 0.23.4-native-1)

This question is a continuation of this thread:
https://github.com/Kotlin/kotlinx.coroutines/issues/246#issuecomment-407023156
I am trying to use org.jetbrains.kotlinx:kotlinx-coroutines-core-native:0.23.4-native-1 in a Kotlin/Native project targeting iOS.
build.gradle:
buildscript {
repositories {
mavenCentral()
maven { url "https://dl.bintray.com/jetbrains/kotlin-native-dependencies" }
}
dependencies {
classpath 'org.jetbrains.kotlin:kotlin-native-gradle-plugin:0.8'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.2.51"
}
}
apply plugin: 'kotlin-platform-native'
repositories {
jcenter()
mavenCentral()
maven { url "https://kotlin.bintray.com/kotlinx" }
}
sourceSets {
main {
component {
target 'ios_arm32', 'ios_arm64', 'ios_x64'
outputKinds = [KLIBRARY]
}
}
}
dependencies {
expectedBy project(':common')
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:0.23.4-native-1"
}
The kotlinx:kotlinx-coroutines-core-native dependency doesn't seem to work, as the produces build errors like:
error: unresolved reference: coroutines
import kotlinx.coroutines.experimental.*
^
If I manually include the artifact dependencies such as org.jetbrains.kotlinx:kotlinx-coroutines-core-native_release_ios_x64:0.10.3-native, then I get a complier exception:
exception: java.lang.IllegalStateException: Could not find "atomicfu-native"
This error persists, even if I also add org.jetbrains.kotlinx:atomicfu-native:0.10.3-native dependency.
Here is a list of things to check for (I have been through this, and finally made it work) :
Enable Gradle metadata. It's required to retrieve the coroutines dependencies. To do so, add this line in your "settings.gradle" file, after all the "include" instructions :
enableFeaturePreview('GRADLE_METADATA')
use gradle 4.7 (newer version are incompatible with the meta data of the current coroutines library, they require something with 0.4 version and the current published one uses 0.3)
In the iOS module :
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core-native:0.23.4-native-1"
In your common module :
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:0.23.4"
If you have a js module, it may fail due to the gradle metadata feature. You can fix it by adding this before each of your "repositories" blocks (https://github.com/srs/gradle-node-plugin/issues/301)
repositories.whenObjectAdded {
if (it instanceof IvyArtifactRepository) {
metadataSources {
artifact()
}
}
}
Hope this will be enough !

How to build my xtext language with gradle for android

I've written a test-DSL in xtext and generated an IntelliJ plugin.
I have a small Android-test project and in Android Studio my DSL-editor shows up and also generates the output files as expected.
Now I try to configure gradle to also generate the files, but this fails with an error.
I found the Android Integration section for the xtext-builder. This seems out-dated (e.g. it refers to org.xtext.android, which does not exist - also the link there is broken).
Anyway, in the xtext-gradle-plugin github repo there is an org.xtext.android.builder plugin: I guess this is the correct one.
My project build.gradle file looks like this (relevant parts only):
buildscript {
repositories {
maven {
url "https://plugins.gradle.org/m2/" // needed for org.xtext:xtext-android-gradle-plugin
}
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath "org.xtext:xtext-android-gradle-plugin:1.0.14"
}
}
allprojects {
repositories {
jcenter()
mavenLocal() // This is required so that the mydsl language is found
}
}
when I activate the org.xtext.android.builder plugin in the build.gradle file of in my app module:
apply plugin: 'com.android.application'
apply plugin: "org.xtext.android.builder" // causes the Error!
I get this error:
Error:Unable to find method 'com.android.build.gradle.api.BaseVariant.getJavaCompiler()Lorg/gradle/api/tasks/compile/AbstractCompile;'...
I guess there's some version mismatch or something is not up-to-date.
Any ideas?
This was a bug (#73) in the xtext-gradle-plugin. It was fixed in Version 1.0.16.

Upgrading to Android Gradle Plugin 1.3 fails build due to check failure in Espresso tests

Before upgrading to Android Gradle Plugin 1.3, the custom lint scope was only Android source files.
After I upgraded to 1.3.1, my tests files started getting checked and as a scenario fails my custom lint rule, the build fails.
There is no documentation about this. I read some warnings have become fatal but nothing around test files getting scanned.
Anyone facing such an issue?
EDIT:
top level build.gradle
buildscript {
repositories {
mavenCentral()
maven { url 'http://download.crashlytics.com/maven' }
maven { url "https://plugins.gradle.org/m2/" }
}
dependencies {
classpath 'com.android.tools.build:gradle:1.3.1'
classpath 'org.sonarqube.gradle:gradle-sonarqube-plugin:1.0'
}
}
allprojects {
repositories {
flatDir {
dirs './prebuilt-libs'
}
mavenCentral()
}
}
task wrapper(type: Wrapper) {
gradleVersion = '2.4'
}
Error:
HardCoding: Detects HardCoded "abc" string
../../src/androidTest/java/com/xyz/mobile/trips/test.java:108: HardCoding Found. (This is my custom lint rule)
hasExtra(CODE, "abc")