Jacoco coverage in gradle multimodule with arquillian - gradle

I have a multimodule project in gradle with the follow structure
root-project:
rest-module
cdi-module
ejb-module
From rest-module I call to the others modules, and tests are working fine, but when I run sonarqube task, I only obtain coverage from rest-module and the others is empty. Also I look for "jacoco.exec" file and only exits in rest module.
My configuration of arquillian is:
<arquillian xmlns="http://jboss.org/schema/arquillian"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://jboss.org/schema/arquillian http://jboss.org/schema/arquillian/arquillian_1_0.xsd">
<defaultProtocol type="Servlet 3.0" />
<container qualifier="wildfly-managed" default="true">
<configuration>
<property name="allowConnectingToRunningServer">true</property>
<property name="jbossHome">C:\wildfly-11.0.0.Final</property>
<property name="javaVmArguments">-Xms800m -Xmx800m -XX:MaxPermSize=1024m</property>
<property name="outputToConsole">true</property>
</configuration>
</container>
<extension qualifier="jacoco">
<property name="appendAsmLibrary">true</property>
</extension>
<extension qualifier="reporter">
<property name="report">html</property>
</extension>
and the dependies on my subprojets are:
plugins {
id 'war'
id 'java'
id 'jacoco'
id 'project-report'
}
sourceSets {
test.runtimeClasspath += configurations.jacocoAnt
main {
output.resourcesDir = "build/classes"
}
test {
output.resourcesDir = "build/classes"
}
}
dependencies {
testImplementation ("org.jboss.arquillian.junit:arquillian-junit-container:1.4.0.Final")
testImplementation ("org.jboss.arquillian.protocol:arquillian-protocol-servlet:1.4.0.Final")
testImplementation ("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-gradle-depchain:3.1.3")
testImplementation ("org.jboss.shrinkwrap.resolver:shrinkwrap-resolver-api-gradle-embedded-archive:3.1.3")
testImplementation ("org.wildfly.arquillian:wildfly-arquillian-container-managed:2.1.0.Final"
testImplementation (group: 'org.ow2.asm', name: 'asm', version: '5.0.1')
//testImplementation "org.jboss.arquillian.extension:arquillian-jacoco-with-asm:1.1.0"
testImplementation ("org.jacoco:org.jacoco.core:0.8.5"){
exclude group: "asm", module: "asm"
}
testImplementation ("org.jboss.arquillian.extension:arquillian-jacoco:1.1.0"){
exclude group: "asm", module: "asm"
}
}

Related

log file is not generating using log4j2 in spring boot

I am using Log4j2 for logging with Spring Boot , but it is not creating the log file. Given below is my configuration for Log4j2 and dependencies i added. i tried all possible solution.
Log4j2 configuration -
Configuration:
name: Default
Properties:
Property:
name: log-path
value: "logs"
Appenders:
Console:
name: Console_Appender
target: SYSTEM_OUT
PatternLayout:
pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"
File:
name: File_Appender
fileName: ${log-path}/logfile.log
PatternLayout:
pattern: "[%-5level] %d{yyyy-MM-dd HH:mm:ss.SSS} [%t] %c{1} - %msg%n"
Loggers:
Root:
level: debug
AppenderRef:
- ref: Console_Appender
Logger:
- name: com.example
level: debug
AppenderRef:
- ref: File_Appender
level: error
dependencies used in build.gradle file:
configurations {
all*.exclude group:'org.springframework.boot', module: 'spring-boot-starter-logging'
all*.exclude module: 'logback-classic'
compileOnly {
extendsFrom annotationProcessor
}
developmentOnly
runtimeClasspath {
extendsFrom developmentOnly
}
}
dependencies {
compile 'org.springframework.boot:spring-boot-starter'
compile 'org.springframework.boot:spring-boot-starter-web'
compile 'org.springframework.boot:spring-boot-starter-log4j2'
developmentOnly 'org.springframework.boot:spring-boot-devtools'
}
Application file :
#SpringBootApplication
public class DemoApplication {
private static final Logger logger = LogManager.getLogger(DemoApplication.class);
public static void main(String[] args) {
SpringApplication.run(DemoApplication.class, args);
logger.debug("This is a debug message");
logger.info("This is an info message");
logger.warn("This is a warn message");
logger.error("This is an error message");
logger.fatal("This is a fatal message");
}
}
After start appplication file getting logging in console but file is not generating.
Please Use below configuration file
<?xml version="1.0" encoding="UTF-8"?>
<Configuration status="WARN" monitorInterval="30">
<Properties>
<Property name="basePath">{base_path}</Property>
</Properties>
<Appenders>
<RollingFile name="fileLogger"
fileName="${basePath}/LogFileName.log"
filePattern="${basePath}/LogFileName_%d{yyyy-MM-dd}.log">
<PatternLayout>
<pattern>%d{yyyy-MMM-dd HH:mm:ss.SSS} %5p [%50.50c] : %M - %m%n
</pattern>
</PatternLayout>
<Policies>
<TimeBasedTriggeringPolicy interval="1"
modulate="true" />
</Policies>
</RollingFile>
<Console name="console" target="SYSTEM_OUT">
<PatternLayout
pattern="%d{yyyy-MMM-dd HH:mm:ss.SSS} %5p [%50.50c] : %M - %m%n" />
</Console>
</Appenders>
<Loggers>
<Logger name="{your_package}" level="debug" additivity="true">
<appender-ref ref="fileLogger" level="debug" />
</Logger>
<Logger name="org.springframework" level="info"
additivity="true">
<appender-ref ref="fileLogger" level="info" />
</Logger>
<Root level="info" additivity="false">
<appender-ref ref="console" />
</Root>
</Loggers>
</Configuration>
your log filename fileName: ${log-path}/logfile.log has log-path refers a property, however that property is not defined
you need to add property in log4j file
<Properties>
<Property name="log-path">{log-path}</Property>
</Properties>
To support yaml format, need additional dependencies. After adding these dependencies, it is working fine.
compile 'com.fasterxml.jackson.dataformat:jackson-dataformat-yaml'
compile 'com.fasterxml.jackson.core:jackson-databind'

SMS using twilio from mobile app not working

As per the guidelines in this tutorial.
I've completed everything. But it's not working. No errors are occurring. I don't know where to check for the issues. Please can someone help me with a solution or at least where to look for issues?
Please find below manifest file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:dist="http://schemas.android.com/apk/distribution"
package="uhnm.stroke.strokeapp_secondscreen">
<dist:module dist:instant="true" />
<uses-permission android:name="android.permission.INTERNET" />
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
android:usesCleartextTraffic="true">
<activity android:name=".NIHSSActivityPage4" android:windowSoftInputMode="adjustPan"/>
<activity android:name=".TeamsDisplay" android:windowSoftInputMode="adjustPan" />
<activity android:name=".imageActivity" android:windowSoftInputMode="adjustPan" />
<activity android:name=".timesActivity" />
<activity android:name=".configurationActivity" />
<activity android:name=".addConsultants" />
<activity android:name=".NIHSSActivityFinalPage"android:windowSoftInputMode="adjustPan" />
<activity android:name=".NIHSSActivityPage3" android:windowSoftInputMode="adjustPan" />
<activity android:name=".NIHSSActivityPage2" android:windowSoftInputMode="adjustPan" />
<activity android:name=".MainActivity" android:windowSoftInputMode="adjustPan" />
<activity android:name=".EnterBrainTracker" />
<activity android:name=".NIHSSActivity" android:windowSoftInputMode="adjustPan" />
<activity
android:name=".signIn"
android:windowSoftInputMode="adjustPan">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name=".MyFirebaseMessagingService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<meta-data
android:name="strokeapp.messaging.default_notification_channel_id"
android:value="#string/default_notification_channel_id" />
</application>
</manifest>
Here the app gradle file:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
//useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "uhnm.stroke.strokeapp_secondscreen"
minSdkVersion 16
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
packagingOptions
{
exclude 'META-INF/DEPENDENCIES'
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:multidex:1.0.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-database:19.2.0'
implementation 'com.google.firebase:firebase-storage:19.1.0'
implementation 'com.google.firebase:firebase-auth:19.1.0'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-messaging:20.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.2.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation group: "com.twilio.sdk", name: "twilio", version: "7.44.0"
implementation 'com.squareup.okhttp3:okhttp:4.2.1'
}

getting error after adding elegant button dependency

after adding this
implementation'com.cepheuen.elegant-number-button:lib:1.0.2'
getting the error every time i add this dependency
Manifest merger failed : Attribute application#theme value=(#style/Theme.AppCompat.Light.NoActionBar) from AndroidManifest.xml:13:9-65
is also present at [com.cepheuen.elegant-number-button:lib:1.0.2] AndroidManifest.xml:16:9-40 value=(#style/AppTheme).
Suggestion: add 'tools:replace="android:theme"' to <application> element at AndroidManifest.xml:7:5-27:19 to override.
which other dependency can be used for elegant button
build.gradle module app file
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.sharma.digimenu"
minSdkVersion 21
targetSdkVersion 27
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.2'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.firebaseui:firebase-ui-auth:4.0.0'
implementation 'com.firebaseui:firebase-ui-storage:4.0.0'
implementation 'com.firebaseui:firebase-ui-database:4.0.0'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
Do the following changes in Manifest.xml
<application
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
xmlns:tools="http://schemas.android.com/tools"
tools:replace="android:theme"
android:theme="#style/Theme.AppCompat.Light.NoActionBar">
<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".Home"
android:label="#string/title_activity_home"
android:theme="#style/Theme.AppCompat.Light.NoActionBar" />
<activity android:name=".FoodList"></activity>
</application>
Follow the instruction, add tools:replace="android:theme" to your <application> element.

gradle adding -source.jar to war

I am in the process of converting a number of projects from ant+ivy to Gradle.
One of the projects (address) produces a simple jar for inclusion into a webapp. I have set up the build.gradle to publish the jar and a sources jar to my private ivy repository.
address/build.gradle excerpt:
apply plugin: 'java'
apply plugin: 'publishing'
apply plugin: 'ivy-publish'
[...snip...]
task sourceJar(type: Jar) {
from sourceSets.main.java
classifier "source"
}
publishing {
repositories {
ivy {
url 'http://dev.example.com/ivy/'
layout "pattern", {
artifact "[organisation]/[module]/[type]s/[artifact]-[revision].[ext]"
}
}
}
publications {
ivy(IvyPublication) {
from components.java
artifact(sourceJar) {
type "source"
}
}
}
}
I publish this with gradlew publish. My webapp then has a dependency on the resulting jar:
compile 'com.example:address:1.0.0'
The problem I have is that when I do gradlew build on the webapp, the war's WEB-INF/lib includes address-source-1.0.0.jar along with the expected address-1.0.0.jar.
I cannot figure out why the source jar is being included in the war. It does not show up in gradlew dependencies.
Here is the ivy.xml being generated for the jar:
<?xml version="1.0" encoding="UTF-8"?>
<ivy-module version="2.0" xmlns:m="http://ant.apache.org/ivy/maven">
<info organisation="com.example" module="address" revision="1.0.0" status="integration" publication="20141027154452"/>
<configurations>
<conf name="default" visibility="public" extends="runtime"/>
<conf name="runtime" visibility="public"/>
</configurations>
<publications>
<artifact name="address" type="jar" ext="jar" conf="runtime"/>
<artifact name="address" type="source" ext="jar" conf="runtime" m:classifier="source"/>
</publications>
<dependencies>
<dependency org="org.springframework" name="spring-asm" rev="3.0.5.RELEASE" conf="runtime->default"/>
<dependency org="org.springframework" name="spring-beans" rev="3.0.5.RELEASE" conf="runtime->default"/>
<dependency org="org.springframework" name="spring-context" rev="3.0.5.RELEASE" conf="runtime->default"/>
<dependency org="org.springframework" name="spring-expression" rev="3.0.5.RELEASE" conf="runtime->default"/>
<dependency org="org.springframework" name="spring-core" rev="3.0.5.RELEASE" conf="runtime->default"/>
<dependency org="log4j" name="log4j" rev="1.2.14" conf="runtime->default"/>
<dependency org="org.slf4j" name="jcl-over-slf4j" rev="1.5.6" conf="runtime->default"/>
<dependency org="org.slf4j" name="slf4j-log4j12" rev="1.5.6" conf="runtime->default"/>
<dependency org="commons-lang" name="commons-lang" rev="2.4" conf="runtime->default"/>
<dependency org="org.slf4j" name="slf4j-api" rev="1.5.6" conf="runtime->default"/>
</dependencies>
</ivy-module>
I think the reason is that the source artifact is published in the runtime configuration as well, if you use a special configuration (e.g. sources) it should work:
publications {
ivyJava(IvyPublication) {
from components.java
configurations.create('sources')
artifact(sourceJar) {
conf "sources"
}
}
}
(configurations.create() is needed because of
GRADLE-3162)

Duplicate bean conflicts during integration tests (multiple, merged contexts?, re: surefire vs failsafe?)

I am experiencing some dependency injection errors during the integration-test phase of my application. I think it's happening because spring is firing up a context during unit testing, then caching all my mock bean instances used for unit tests, which then conflict with the beans fired up during the integration-test phase, causing DI in my classes to fail because Spring is finding multiple instances of the same beans (mock vs real instances).
Note: This issue is only present during the integration-test phase of the app. The app otherwise starts, runs, and unit tests normally (it's a webapp and I run it with maven 3 using the tomcat:run-war goal).
This is the basic composition of my integration tests. I wrote a bogus one yesterday just to try and isolate the issue (no DI involved in this test):
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration(locations="file:src/main/webapp/WEB-INF/spring/root-context.xml")
#DirtiesContext
public class ITNonsenseTest {
#Test
public void doNothing() {
System.out.println("hello, world");
Assert.assertTrue(true);
}
}
My integration tests all begin with the prefix "IT" and my unit tests all begin with the prefix "UT"
I am using apache surefire for unit tests, and apache failsafe for integration tests:
from my pom.xml:
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>${maven.nfire.plugin.version}</version>
<configuration>
<excludes>
<exclude>**/IT*.java</exclude>
</excludes>
<includes>
<include>**/UT*.java</include>
</includes>
<skipTests>
${skipUnitTests}
</skipTests>
</configuration>
<executions>
<execution>
<goals>
<goal>test</goal>
</goals>
</execution>
</executions>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-report-plugin</artifactId>
<version>${maven.nfire.plugin.version}</version>
</plugin>
<!-- For Integration Tests -->
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<version>${maven.nfire.plugin.version}</version>
<configuration>
<includes>
<include>**/IT*.java</include>
</includes>
<excludes>
<exclude>**/UT*.java</exclude>
</excludes>
<skipTests>
${skipIntegrationTests}
</skipTests>
</configuration>
<executions>
<execution>
<goals>
<goal>integration-test</goal>
<goal>verify</goal>
</goals>
</execution>
</executions>
</plugin>
Even when running my simple ITNonsenseTest above, the Spring context fails to initialize properly. Since many of the beans I'm trying to create already exist in the context (as mock bean instances from my Unit test phase), Spring is complaining about duplicates being found.
Is there a way to tear down the context after the unit test phase, and build a new context for the integration-test phase? Or am I just doing something completely wrong?
This is my root-context.xml file:
<?xml version="1.0" encoding="UTF-8"?>
<beans:beans xmlns:aop="http://www.springframework.org/schema/aop"
xmlns:beans="http://www.springframework.org/schema/beans"
xmlns:util="http://www.springframework.org/schema/util"
xmlns:context="http://www.springframework.org/schema/context"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation= "http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd
http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd
http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util.xsd
http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context.xsd">
<!-- Root Context: defines shared resources visible to all other web components -->
<context:property-placeholder location="file://${conf.dir}/*.properties" />
<context:component-scan base-package="com.myapp.models, com.myapp.dao, com.myapp.service" />
<beans:import resource="simplesm-context.xml" />
<beans:import resource="datasources.xml" />
<beans:import resource="rabbit-context.xml" />
<util:properties id="swaggerProps" location="classpath:swagger.properties" />
<util:properties id="encryptionProps" location="classpath:sharedEncryption.properties" />
<aop:aspectj-autoproxy />
<beans:bean name="cacheManager" class="com.google.code.ssm.spring.SSMCacheManager">
<beans:property name="caches">
<beans:set>
<beans:bean class="com.google.code.ssm.spring.SSMCache">
<beans:constructor-arg name="cache" index="0" ref="defaultCache" />
<beans:constructor-arg name="expiration" index="1" value="86400" />
<beans:constructor-arg name="allowClear" index="2" value="false" />
</beans:bean>
</beans:set>
</beans:property>
</beans:bean>
<beans:bean name="defaultCache" class="com.google.code.ssm.CacheFactory">
<!-- <beans:property name="cacheName" value="defaultCache" /> -->
<beans:property name="cacheClientFactory">
<beans:bean name="cacheClientFactory" class="com.google.code.ssm.providers.spymemcached.MemcacheClientFactoryImpl" />
</beans:property>
<beans:property name="addressProvider">
<beans:bean class="com.google.code.ssm.config.DefaultAddressProvider">
<beans:property name="address" value="${ureg.memcached.url}:${ureg.memcached.port}" />
</beans:bean>
</beans:property>
<beans:property name="configuration">
<beans:bean class="com.google.code.ssm.providers.CacheConfiguration">
<beans:property name="consistentHashing" value="true" />
</beans:bean>
</beans:property>
</beans:bean>
</beans:beans>
This is my project's dependencies' versioning info:
<properties>
<java-version>1.7</java-version>
<org.springframework-version>4.0.6.RELEASE</org.springframework-version>
<org.springframework.amqp.version>1.3.5.RELEASE</org.springframework.amqp.version>
<org.springframework.data.version>1.6.0.RELEASE</org.springframework.data.version>
<google.simple.spring.memcached.version>3.2.1</google.simple.spring.memcached.version>
<maven.nfire.plugin.version>2.17</maven.nfire.plugin.version>
</properties>
Lastly, I tried adding a #DirtiesContext to all of my Unit tests that use SpringJunit4ClassRunner, but I'm still seeing this error. All of my unit tests are structured in the following manner:
#RunWith(SpringJUnit4ClassRunner.class)
#ContextConfiguration
#DirtiesContext
public class UTAdditionalDataPointsServiceTest {
#Configuration
static class AdditionalDataPointsServiceUnitTestContextConfiguration {
#Bean
#Qualifier("props")
public Properties getProperties() {
return Mockito.mock(Properties.class);
}
#Bean
#Qualifier("npJdbcTemplate")
public NamedParameterJdbcTemplate getNamedParameterJdbcTemplate() {
return Mockito.mock(NamedParameterJdbcTemplate.class);
}
#Bean
#Qualifier("uJdbcTemplate")
public JdbcTemplate getJdbcTemplate() {
return Mockito.mock(JdbcTemplate.class);
}
#Bean
public AdditionalDataPointsDao getAdditionalDataPointsDao() {
return Mockito.mock(AdditionalDataPointsDaoImpl.class);
}
#Bean
public AdditionalDataPointService getAdditionalDataPointService() {
return Mockito.mock(AdditionalDataPointServiceImpl.class);
}
}
#Inject
AdditionalDataPointService adpService;
#Test
public void testGetAdditionalDataPoints() throws Exception {
List<AdditionalDataPoint> adpList = adpService.getAdditionalDataPoints(1);
org.junit.Assert.assertNotNull(adpList);
}
I'm fairly confident the issue is the mock instances cached in the context during the unit testing phase, because if i comment out the definition for a bean when theyre instantiated in my root-context.xml file, the errors for those duplicates go away.
The stack traces are always the same, along the lines of:
nested exception is org.springframework.beans.factory.NoUniqueBeanDefinitionException: No qualifying bean of type [java.util.Properties] is defined: expected single matching bean but found 2: realInstanceBeanName,mockInstanceBeanNameGetter
Configuring classesDirectory do the job for me. See Maven-failsafe-plugin fails to execute integration tests
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-failsafe-plugin</artifactId>
<configuration>
<classesDirectory>${project.build.outputDirectory}</classesDirectory>
</configuration>
</plugin>

Resources