I'm not the first to have these symptoms.. but none of the causes I found so far seem to be the same as I am experiencing.
After I deployed my Laravel app some of the assets return a 404 status. I have checked the permissions for these files.
Other files in the same folder also loaded with the asset() method load just fine.
I have set up my app in a folder at the same level as public_html and copied the contents of public/ to my public_html/subdomain folder.
The issue can be seen here: Staging area
This is my file structure for public_html/subdomain/:
|-- cgi-bin
|-- css
| |-- account.css
| |-- admin_custom.css
| |-- app.css
| |-- home.css
| `-- nav.css
|-- favicon.ico
|-- images
| |-- venray-bloeit-logo-black.png
| |-- venray-bloeit-logo-white.png
| `-- wave_footer.png
|-- index.php
|-- js
| |-- account.js
| |-- admin
| | |-- accounts.js
| | |-- admin.js
| | `-- dashboard.js
| |-- app.js
| |-- nav.js
| `-- plugins
| |-- backstretch.min.js
| |-- jquery-3.2.1.min.js
| `-- tinymce
| |-- jquery.tinymce.min.js
|
|-- robots.txt
|-- vendor
| |-- adminlte
| | |-- css
| | | `-- auth.css
| | |-- dist
| | | |-- css
| | | | |-- AdminLTE.css
| | | | |-- AdminLTE.min.css
| | | | `-- skins
| | | | |-- skin-black-light.css
| | | `-- js
| | | |-- adminlte.js
| | | `-- adminlte.min.js
| | |-- plugins
| | | `-- iCheck
| | | |-- icheck.js
| | | `-- icheck.min.js
| | `-- vendor
| | `-- jquery.min.map
| `-- notify
| |-- danger.mp3
| |-- info.mp3
| |-- notify.css
| `-- notify.js
`-- web.config
Related
I have Gradle project A which has another dependency module B (maven).
In Gradle project A dependency tree I can see below
+--- org.seleniumhq.selenium:selenium-api:3.141.59 -> 4.1.4
| | | +--- org.seleniumhq.selenium:selenium-chrome-driver:3.141.59 -> 4.1.4 (*)
| | | +--- org.seleniumhq.selenium:selenium-edge-driver:3.141.59 -> 4.1.4 (*)
I have few questions here:
So with above dep tree (i.e. 3.141.59 -> 4.1.4 (*) ), which version is the used one? I know (*) - dependencies omitted (listed previously)
If the used one here is 3.141.59, how should I use 4.1.4 instead?
Note : I can see in maven module B version is having 3.141.59.
Dep tree doesn't show clearly where does 4.1.4 version come from. As per the below tree snippets it comes under org.seleniumhq.selenium:selenium-server:3.141.59
:
| +--- org.seleniumhq.selenium:selenium-server:3.141.59
| | | +--- org.seleniumhq.selenium:selenium-java:3.141.59 -> 4.1.4
| | | | +--- org.seleniumhq.selenium:selenium-api:4.1.4
| | | | +--- org.seleniumhq.selenium:selenium-chrome-driver:4.1.4
| | | | | +--- com.google.auto.service:auto-service-annotations:1.0.1
| | | | | +--- com.google.auto.service:auto-service:1.0.1
| | | | | | +--- com.google.auto.service:auto-service-annotations:1.0.1
| | | | | | +--- com.google.auto:auto-common:1.2
| | | | | | | \--- com.google.guava:guava:31.0.1-jre -> 31.1-jre (*)
| | | | | | \--- com.google.guava:guava:31.0.1-jre -> 31.1-jre (*)
| | | | | +--- com.google.guava:guava:31.1-jre (*)
| | | | | +--- org.seleniumhq.selenium:selenium-api:4.1.4
| | | | | +--- org.seleniumhq.selenium:selenium-chromium-driver:4.1.4
| | | | | | +--- com.google.auto.service:auto-service-annotations:1.0.1
| | | | | | +--- com.google.auto.service:auto-service:1.0.1 (*)
| | | | | | +--- com.google.guava:guava:31.1-jre (*)
| | | | | | +--- org.seleniumhq.selenium:selenium-json:4.1.4
| | | | | | | \--- org.seleniumhq.selenium:selenium-api:4.1.4
| | | | | | \--- org.seleniumhq.selenium:selenium-remote-driver:4.1.4
In the dep tree what's the difference between
org.seleniumhq.selenium:selenium-java:3.141.59 -> 4.1.4
and
org.seleniumhq.selenium:selenium-java:3.141.59 -> 4.1.4 (*)
I am currently developing a Spring Boot application in the Eclipse IDE with a Connection class which needs to know which data source to connect to. I decided to let it know this property from Spring's application.properties, through the #Value annotation:
#Value("${project.datasource}")
private final DataSource DATA_SOURCE;
where DataSource is an enum representing the possible data sources. However, in this method, I get a "Blank final field DATA_SOURCE may not have been initialized" error:
private DBConnection() throws SQLException {
ConnectionConfig config = new ConnectionConfig(DATA_SOURCE);
connection = DriverManager.getConnection(config.getUrl(), config.getUSERNAME(), config.getPASSWORD());
}
Inserting a default value doesn't work, either:
#Value("${project.datasource:POSTGRE_LOCAL}")
still gives the same error.
I tried to install the Spring Tools 4 plugin for Eclipse to check if this was just Eclipse not understanding the #Value annotation's implications, but it seems like this isn't the case. How do I solve this problem? Am I misunderstanding the implications myself?
application.properties:
project.datasource = POSTGRE_LOCAL
Project tree:
| .classpath
| .gitignore
| .project
| HELP.md
| mvnw
| mvnw.cmd
| pom.xml
|
+---.mvn
| \---wrapper
| maven-wrapper.jar
| maven-wrapper.properties
|
+---.settings
| org.eclipse.core.resources.prefs
| org.eclipse.jdt.core.prefs
| org.eclipse.m2e.core.prefs
| org.springframework.ide.eclipse.prefs
|
+---src
| +---main
| | +---java
| | | \---org
| | | \---ingsw21
| | | \---backend
| | | +---connection
| | | | DBConnection.java
| | | |
| | | +---controllers
| | | | UserController.java
| | | |
| | | +---DAOs
| | | | DAOUtente.java
| | | |
| | | +---DAOSQL
| | | | DAOSQLUtente.java
| | | |
| | | +---entities
| | | | Utente.java
| | | |
| | | +---enums
| | | | DataSource.java
| | | |
| | | \---exceptions
| | | BadRequestWebException.java
| | | DataAccessException.java
| | |
| | \---resources
| | application.properties
| |
| \---test
| \---java
| \---org
| \---ingsw21
| \---backend
| \---BackEnd
| BackEndApplicationTests.java
|
\---target
+---classes
| | application.properties
| |
| \---org
| \---ingsw21
| \---backend
| +---connection
| | DBConnection$ConnectionConfig.class
| | DBConnection.class
| |
| +---controllers
| | UserController.class
| |
| +---DAOs
| | DAOUtente.class
| |
| +---DAOSQL
| | DAOSQLUtente.class
| |
| +---entities
| | Utente.class
| |
| +---enums
| | DataSource.class
| |
| \---exceptions
| BadRequestWebException.class
| DataAccessException.class
|
\---test-classes
\---org
You cannot add #Value to a final field.
#Value("${project.datasource}")
private DataSource DATA_SOURCE;
should work just fine.
Reverse the "$" and "{". The expression syntax is "${...}".
I have tried to test my code with robolectric. Problem is that it has duplicated References. e.g.
java.lang.RuntimeException: java.lang.RuntimeException: Duplicate class org.apache.maven.artifact.Artifact found in modules maven-ant-tasks-2.1.3.jar (org.apache.maven:maven-ant-tasks:2.1.3) and maven-artifact-2.2.1.jar (org.apache.maven:maven-artifact:2.2.1)
I have used the gradel artifact app:dependencies to get the following report. Here the important parts:
+--- org.robolectric:robolectric:4.3
| +--- org.robolectric:annotations:4.3
| +--- org.robolectric:junit:4.3
| | +--- org.robolectric:annotations:4.3
| | +--- org.robolectric:sandbox:4.3
| | | +--- org.robolectric:annotations:4.3
| | | +--- org.robolectric:utils:4.3
| | | | +--- org.robolectric:annotations:4.3
| | | | +--- org.robolectric:pluginapi:4.3
| | | | | +--- org.robolectric:annotations:4.3
| | | | | +--- org.apache.ant:ant:1.8.0
| | | | | | \--- org.apache.ant:ant-launcher:1.8.0
| | | | | \--- org.apache.maven:maven-ant-tasks:2.1.3
| | | | | +--- org.apache.ant:ant:1.8.0 (*)
| | | | | +--- classworlds:classworlds:1.1-alpha-2
| | | | | +--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1
| | | | | | +--- org.codehaus.plexus:plexus-utils:1.0.4 -> 1.5.15
| | | | | | \--- classworlds:classworlds:1.1-alpha-2
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | +--- org.apache.maven:maven-artifact:2.2.1
| | | | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | +--- org.apache.maven:maven-artifact-manager:2.2.1
| | | | | | +--- org.apache.maven:maven-repository-metadata:2.2.1
| | | | | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | | +--- org.apache.maven:maven-artifact:2.2.1 (*)
| | | | | | +--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | | | +--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6
| | | | | | | \--- org.codehaus.plexus:plexus-utils:1.4.2 -> 1.5.15
| | | | | | \--- backport-util-concurrent:backport-util-concurrent:3.1
| | | | | +--- org.apache.maven:maven-model:2.2.1
| | | | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | +--- org.apache.maven:maven-project:2.2.1
| | | | | | +--- org.apache.maven:maven-settings:2.2.1
| | | | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | | | +--- org.apache.maven:maven-profile:2.2.1
| | | | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | | +--- org.apache.maven:maven-artifact-manager:2.2.1 (*)
| | | | | | +--- org.apache.maven:maven-plugin-registry:2.2.1
| | | | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | | +--- org.apache.maven:maven-artifact:2.2.1 (*)
| | | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | | +--- org.apache.maven:maven-error-diagnostics:2.2.1
| | | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | | +--- org.apache.maven:maven-settings:2.2.1 (*)
| | | | | +--- org.apache.maven.wagon:wagon-file:1.0-beta-6
| | | | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | | | +--- org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-6
| | | | | | +--- org.apache.maven.wagon:wagon-http-shared:1.0-beta-6
| | | | | | | +--- nekohtml:xercesMinimal:1.9.6.2
| | | | | | | +--- nekohtml:nekohtml:1.9.6.2
| | | | | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | | +--- org.robolectric:utils-reflector:4.3
| | | | | +--- org.ow2.asm:asm:7.0
| | | | | +--- org.ow2.asm:asm-commons:7.0
| | | | | | +--- org.ow2.asm:asm:7.0
| | | | | | +--- org.ow2.asm:asm-tree:7.0
| | | | | | | \--- org.ow2.asm:asm:7.0
| | | | | | \--- org.ow2.asm:asm-analysis:7.0
| | | | | | \--- org.ow2.asm:asm-tree:7.0 (*)
| | | | | \--- org.ow2.asm:asm-util:7.0
| | | | | +--- org.ow2.asm:asm:7.0
| | | | | +--- org.ow2.asm:asm-tree:7.0 (*)
| | | | | \--- org.ow2.asm:asm-analysis:7.0 (*)
| | | | +--- com.google.auto.service:auto-service:1.0-rc4
| | | | | +--- com.google.auto:auto-common:0.8
| | | | | | \--- com.google.guava:guava:19.0 -> 27.0.1-jre
| | | | | | +--- com.google.guava:failureaccess:1.0.1
| | | | | | +--- com.google.guava:listenablefuture:9999.0-empty-to-avoid-conflict-with-guava
| | | | | | +--- com.google.code.findbugs:jsr305:3.0.2
| | | | | | +--- org.checkerframework:checker-qual:2.5.2
| | | | | | +--- com.google.errorprone:error_prone_annotations:2.2.0
| | | | | | +--- com.google.j2objc:j2objc-annotations:1.1
| | | | | | \--- org.codehaus.mojo:animal-sniffer-annotations:1.17
| | | | | \--- com.google.guava:guava:23.5-jre -> 27.0.1-jre (*)
| | | | +--- javax.inject:javax.inject:1
| | | | \--- javax.annotation:javax.annotation-api:1.3.2
| | | +--- org.robolectric:shadowapi:4.3
| | | | \--- org.robolectric:annotations:4.3
| | | +--- org.robolectric:utils-reflector:4.3 (*)
| | | +--- javax.annotation:javax.annotation-api:1.3.2
| | | +--- javax.inject:javax.inject:1
| | | +--- org.ow2.asm:asm:7.0
| | | +--- org.ow2.asm:asm-commons:7.0 (*)
| | | \--- com.google.guava:guava:27.0.1-jre (*)
| | +--- org.robolectric:pluginapi:4.3 (*)
| | +--- org.robolectric:shadowapi:4.3 (*)
| | \--- org.robolectric:utils-reflector:4.3 (*)
| +--- org.robolectric:pluginapi:4.3 (*)
| +--- org.robolectric:resources:4.3
| | +--- org.robolectric:utils:4.3 (*)
| | +--- org.robolectric:annotations:4.3
| | +--- org.robolectric:pluginapi:4.3 (*)
| | \--- com.google.guava:guava:27.0.1-jre (*)
| +--- org.robolectric:sandbox:4.3 (*)
| +--- org.robolectric:utils:4.3 (*)
| +--- org.robolectric:utils-reflector:4.3 (*)
| +--- org.robolectric:plugins-maven-dependency-resolver:4.3
| | +--- org.robolectric:pluginapi:4.3 (*)
| | +--- org.robolectric:utils:4.3 (*)
| | +--- org.apache.ant:ant:1.8.0 (*)
| | \--- org.apache.maven:maven-ant-tasks:2.1.3 (*)
| +--- javax.inject:javax.inject:1
| +--- javax.annotation:javax.annotation-api:1.3.2
| +--- org.robolectric:shadows-framework:4.3
| | +--- org.robolectric:annotations:4.3
| | +--- org.robolectric:resources:4.3 (*)
| | +--- org.robolectric:pluginapi:4.3 (*)
| | +--- org.robolectric:shadowapi:4.3 (*)
| | +--- org.robolectric:utils:4.3 (*)
| | +--- org.robolectric:utils-reflector:4.3 (*)
| | +--- androidx.test:monitor:1.2.0 -> 1.3.0-alpha02 (*)
| | +--- com.almworks.sqlite4java:sqlite4java:0.282
| | +--- com.ibm.icu:icu4j:53.1
| | +--- com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1
| | | +--- org.hamcrest:hamcrest-core:1.3
| | | +--- org.hamcrest:hamcrest-library:1.3 (*)
| | | \--- com.google.protobuf:protobuf-java:2.6.1
| | \--- androidx.annotation:annotation:1.0.0
| +--- org.bouncycastle:bcprov-jdk15on:1.52
| \--- androidx.test:monitor:1.2.0 -> 1.3.0-alpha02 (*)
How to resolve the reference error? It seems to me that robolectric has the same class in diffrent dependencies?
I use the following build script:
apply plugin: 'com.android.application'
apply plugin: 'idea'
idea {
module {
downloadJavadoc = true
downloadSources = true
}
}
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
useLibrary 'org.apache.http.legacy'
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
defaultConfig {
applicationId "com.example.sampleapp"
minSdkVersion 16
targetSdkVersion 28
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
testOptions {
unitTests {
includeAndroidResources = true
}
}
}
dependencies {
androidTestImplementation 'androidx.test:rules:1.2.0'
androidTestImplementation 'androidx.test:core:1.2.1-alpha02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
androidTestImplementation 'org.robolectric:robolectric:4.3'
// Mail-Versand
implementation 'com.sun.mail:android-mail:1.6.2'
implementation 'com.sun.mail:android-activation:1.6.2'
implementation 'androidx.appcompat:appcompat:1.0.2'//
implementation 'com.github.woxthebox:draglistview:1.6.6'
}
How to fix that?
Issue on github is open: https://github.com/robolectric/robolectric/issues/5235
Finally get the test running. I've excluded all libs with duplicated classes:
testImplementation ("org.robolectric:robolectric:4.3"){
exclude group: 'org.apache.maven', module: 'maven-artifact'
exclude group: 'org.apache.maven', module: 'maven-artifact-manager'
exclude group: 'org.apache.maven', module: 'maven-model'
exclude group: 'org.apache.maven', module: 'maven-plugin-registry'
exclude group: 'org.apache.maven', module: 'maven-profile'
exclude group: 'org.apache.maven', module: 'maven-project'
exclude group: 'org.apache.maven', module: 'maven-settings'
exclude group: 'org.apache.maven', module: 'maven-error-diagnostics'
exclude group: "org.apache.maven.wagon"
}
Not all possibilities tested but a simple test worked already.
This probably could be written in more general way:
testImplementation ("org.robolectric:robolectric:4.3") {
exclude group "org.apache.maven.wagon"
exclude group "org.apache.maven"
}
or even:
testImplementation ("org.robolectric:robolectric:4.3") {
exclude group: "org.apache.maven", name: "maven-ant-tasks"
}
because it is maven-ant-tasks of pluginapi, which pulls in org.apache.maven dependencies.
I've encountered the same issue and the thing that helped me was that I had defined the Roboelectric dependency twice in Gradle file one with androidTestImplementation and the other with testImplementation so when I removed the first part problem solved!!!
The solution for me was to ensure that I was not requiring Robolectric in my androidTestImplementation dependencies.
Once I fixed that, I did not have any conflicts to fix.
To list dependencies with gradle:
gradlew dependencies
This will show the all of the dependencies in your current projects configurations.
For example:
testCompile - Classpath for compiling the test sources.
+--- org.robolectric:shadows-support-v4:3.1.2
| +--- org.robolectric:robolectric:3.1.2
| | +--- org.robolectric:robolectric-annotations:3.1.2
| | +--- org.robolectric:robolectric-resources:3.1.2
| | | +--- org.robolectric:robolectric-utils:3.1.2
| | | | +--- org.ow2.asm:asm:5.0.1
| | | | +--- org.ow2.asm:asm-commons:5.0.1
| | | | | \--- org.ow2.asm:asm-tree:5.0.1
| | | | | \--- org.ow2.asm:asm:5.0.1
| | | | +--- org.robolectric:robolectric-annotations:3.1.2
| | | | \--- com.google.android.apps.common.testing.accessibility.framework:accessibility-test-framework:2.1
| | | | +--- org.hamcrest:hamcrest-core:1.3
| | | | +--- org.hamcrest:hamcrest-library:1.3
| | | | | \--- org.hamcrest:hamcrest-core:1.3
| | | | \--- com.google.protobuf:protobuf-java:2.6.1
| | | +--- org.robolectric:robolectric-annotations:3.1.2
| | | +--- com.ximpleware:vtd-xml:2.11
| | | \--- com.google.guava:guava:19.0
| | +--- org.robolectric:robolectric-utils:3.1.2 (*)
| | +--- org.ow2.asm:asm:5.0.1
| | +--- org.ow2.asm:asm-util:5.0.1
| | | \--- org.ow2.asm:asm-tree:5.0.1 (*)
| | +--- org.ow2.asm:asm-commons:5.0.1 (*)
| | +--- org.ow2.asm:asm-analysis:5.0.1
| | | \--- org.ow2.asm:asm-tree:5.0.1 (*)
| | +--- org.bouncycastle:bcprov-jdk16:1.46
| | +--- com.ximpleware:vtd-xml:2.11
| | +--- com.thoughtworks.xstream:xstream:1.4.8
| | | +--- xmlpull:xmlpull:1.1.3.1
| | | \--- xpp3:xpp3_min:1.1.4c
| | +--- org.apache.ant:ant:1.8.0
| | | \--- org.apache.ant:ant-launcher:1.8.0
| | +--- org.apache.maven:maven-ant-tasks:2.1.3
| | | +--- org.apache.ant:ant:1.8.0 (*)
| | | +--- classworlds:classworlds:1.1-alpha-2
| | | +--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1
| | | | +--- junit:junit:3.8.1 -> 4.12 (*)
| | | | +--- org.codehaus.plexus:plexus-utils:1.0.4 -> 1.5.15
| | | | \--- classworlds:classworlds:1.1-alpha-2
| | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | +--- org.apache.maven:maven-artifact:2.2.1
| | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | +--- org.apache.maven:maven-artifact-manager:2.2.1
| | | | +--- org.apache.maven:maven-repository-metadata:2.2.1
| | | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | +--- org.apache.maven:maven-artifact:2.2.1 (*)
| | | | +--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6
| | | | | \--- org.codehaus.plexus:plexus-utils:1.4.2 -> 1.5.15
| | | | \--- backport-util-concurrent:backport-util-concurrent:3.1
| | | +--- org.apache.maven:maven-model:2.2.1
| | | | \--- org.codehaus.plexus:plexus-utils:1.5.15
| | | +--- org.apache.maven:maven-project:2.2.1
| | | | +--- org.apache.maven:maven-settings:2.2.1
| | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.apache.maven:maven-profile:2.2.1
| | | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.apache.maven:maven-model:2.2.1 (*)
| | | | +--- org.apache.maven:maven-artifact-manager:2.2.1 (*)
| | | | +--- org.apache.maven:maven-plugin-registry:2.2.1
| | | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | | +--- org.codehaus.plexus:plexus-interpolation:1.11
| | | | +--- org.codehaus.plexus:plexus-utils:1.5.15
| | | | +--- org.apache.maven:maven-artifact:2.2.1 (*)
| | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | +--- org.apache.maven:maven-error-diagnostics:2.2.1
| | | | \--- org.codehaus.plexus:plexus-container-default:1.0-alpha-9-stable-1 (*)
| | | +--- org.apache.maven:maven-settings:2.2.1 (*)
| | | +--- org.apache.maven.wagon:wagon-file:1.0-beta-6
| | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | +--- org.apache.maven.wagon:wagon-http-lightweight:1.0-beta-6
| | | | +--- org.apache.maven.wagon:wagon-http-shared:1.0-beta-6
| | | | | +--- nekohtml:xercesMinimal:1.9.6.2
| | | | | +--- nekohtml:nekohtml:1.9.6.2
| | | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | | \--- org.apache.maven.wagon:wagon-provider-api:1.0-beta-6 (*)
| | \--- org.robolectric:shadows-core-v23:3.1.2
| | +--- org.robolectric:robolectric-annotations:3.1.2
| | +--- org.robolectric:robolectric-resources:3.1.2 (*)
| | +--- org.robolectric:robolectric-utils:3.1.2 (*)
| | +--- com.almworks.sqlite4java:sqlite4java:0.282
| | \--- com.ibm.icu:icu4j:53.1
| \--- org.robolectric:shadows-core-v23:3.1.2 (*)
Notice, the shadows-support-v4 artifact brings in robolectric artifact which brings in the dependency: org.robolectric:shadows-core-v23:3.1.2.
If we go to the build.gradle file, we notice there are provided dependencies that are not brought in: https://github.com/robolectric/robolectric/blob/f68ba6bcb51fb25a28805a3c5f7ffcee2d9560d5/robolectric-shadows/shadows-core/build.gradle#L16.
Actual pom file: http://repo1.maven.org/maven2/org/robolectric/robolectric/3.1.2/robolectric-3.1.2.pom. Provided dependencies are not added to the POM but the runtime dependencies are.
How can I go deeper and list all of the dependencies of the dependencies including any provided dependencies?
I answered this here: https://github.com/robolectric/robolectric/issues/2646
For those that are still having this problem, download all the dependencies and transitive dependencies up front for your CI:
subprojects { project ->
task downloadDependencies(type: Copy) {
description "Downloads all dependencies."
group "build"
from {
// Use of closure defers evaluation until execution time
project.configurations
.findAll { configuration -> configuration.canBeResolved }
.collect { configuration -> configuration.resolvedConfiguration.lenientConfiguration.files }
}
into "$project.buildDir/dependencies"
}
}
Example:
Step 1: gradlew downloadDependencies
Step 2: gradlew assembleDebug testDebug
I'm trying to add a Test Kitchen for a bunch of cookbooks that we use to provision a Jenkins CI instance.
We use Berkshelf to manage dependencies. The file structure is as follows:
| .gitignore
| .kitchen.yml
| Berksfile
| Berksfile.lock
| bootstrap.sh
| chefignore
| metadata.rb
| provision.sh
| readme.md
| solo.json
| solo.rb
| tree.txt
| VERSION
|
+---.kitchen
| | default-ubuntu-1404.yml
| |
| +---kitchen-vagrant
| | \---kitchen-chef-jenkins-default-ubuntu-1404
| | | Vagrantfile
| | |
| | \---.vagrant
| | \---machines
| | \---default
| | \---virtualbox
| | action_set_name
| | id
| | index_uuid
| | private_key
| | synced_folders
| |
| \---logs
| default-centos-71.log
| default-ubuntu-1404.log
| kitchen.log
|
+---site-cookbooks
| +---ant
| | | .gitignore
| | | .kitchen.yml
| | | Berksfile
| | | CHANGELOG.md
| | | chefignore
| | | CONTRIBUTING.md
| | | LICENSE
| | | metadata.rb
| | | README.md
| | | TESTING.md
| | | Thorfile
| | |
| | +---attributes
| | | default.rb
| | |
| | +---providers
| | | library.rb
| | |
| | +---recipes
| | | default.rb
| | | install_package.rb
| | | install_source.rb
| | |
| | +---resources
| | | library.rb
| | |
| | \---templates
| | \---default
| | ant_home.sh.erb
| |
| +---haxe_cookbook
| | | CHANGELOG.md
| | | metadata.rb
| | | README.md
| | |
| | \---recipes
| | default.rb
| |
| \---mbp-jenkins
| | Berksfile
| | Berksfile.lock
| | CHANGELOG.md
| | chefignore
| | metadata.rb
| | README.md
| |
| +---recipes
| | default.rb
| |
| +---resources
| | | commons-net-3.3.jar
| | |
| | +---css
| | | style.css
| | |
| | +---images
| | | logo-mbp.png
| | | web.png
| | |
| | \---js
| | scripts.js
| |
| \---templates
| +---default
| | | config.xml
| | |
| | \---secrets
| | hudson.console.AnnotatedLargeText.consoleAnnotator
| | hudson.model.Job.serverCookie
| | hudson.util.Secret
| | jenkins.security.ApiTokenProperty.seed
| | jenkins.slaves.JnlpSlaveAgentProtocol.secret
| | master.key
| | org.acegisecurity.ui.rememberme.TokenBasedRememberMeServices.mac
| | org.jenkinsci.main.modules.instance_identity.InstanceIdentity.KEY
| |
| \---emails
| build-complete.html.groovy
| build-started.html.groovy
|
\---test
\---integration
\---default
Executing:
kitchen converge default-ubuntu-1404
Results in the following error:
[2015-08-24T09:13:24+00:00] ERROR: Cookbook mbp-jenkins not found. If you're loading mbp-jenkins from another cookbook, make sure you configure the dependency in your metadata
[2015-08-24T09:13:24+00:00] FATAL: Chef::Exceptions::ChildConvergeError: Chef run process exited unsuccessfully (exit code 1)
Which suggests that chef-solo can't find the cookbook mbp-jenkins. I would expect it to find it though as we define the cookbook paths in the solo.rb file as follows:
root = File.absolute_path(File.dirname(__FILE__))
file_cache_path 'cache'
cookbook_path [root + "/cookbooks", root + "/site-cookbooks",root + "/berks-cookbooks"]
Not really sure what is going wrong here so any suggestions would be appreciated
Update:
I have tried using the chef zero provisioner, that however gives me the output:
================================================================================
Error Resolving Cookbooks for Run List:
================================================================================
Missing Cookbooks:
------------------
No such cookbook: mbp-jenkins
Expanded Run List:
------------------
* mbp-jenkins::default
Have you tried using the chef_zero provisioner instead? I suspect your problem is because chef solo does not run Berkshelf, which would explain the missing cookbooks.
For example see:
How to customise a tomcat recipe in Chef
Update
The issue appears to be that the cookbooks in the site-cookbooks directory is not be copied over to the target machine.
Seems to me the simplest and best fix is to include the local cookbooks in your Berksfile as follows:
source 'https://supermarket.chef.io'
cookbook 'ant', path: 'site-cookbooks/ant'
cookbook 'haxe_cookbook', path: 'site-cookbooks/haxe_cookbook'
cookbook 'mbp-jenkins', path: 'site-cookbooks/mbp-jenkins'
metadata