Update pom.xml to show compiler warnings (#54) * Update pom.xml to show compiler warnings * JDO-817: First version removing compiler warnings * JDO-817: removing compiler warnings Raw use og parameterzied class * JDO-817 removing compiler warnings: unused import * JDO-817 removing compiler warnings: declaration can have final modifier * JDO-817 removing compiler warnings: field may be final * JDO-817 removing compiler warnings: call toString on an array * JDO-817 removing compiler warnings: Duplicate branch in switch * JDO-817 removing compiler warnings: Redundant String operation * JDO-817 removing compiler warnings: redundant type cast * JDO-817 removing compiler warnings: unnecessary interface modifier, unnecessary semicoln * JDO-817 removing compiler warnings: unnecessary call to toString + unnecessary conversion to String * JDO-817 removing compiler warnings: getCompanyModelInstances methods return correct generic list * JDO-817: corrected namoing of instance variables * JDO-817 removing compiler warnings: QueryElementHolder becomes generic class * JDO-817 removing compiler warnings: @SuppressWarnings for set methods in fieldtypes classes * JDO-817 removing compiler warnings: using pm.newQuery() with class argument * JDO-817 removing compiler warnings: SuppressWarnings when creating a query from singleStringJDOQL * JDO-817: removing compiler warnings add profile warnings to configure compiler-plugin * JDO-817 removing compiler warnings: replace for/while loops with enhanced for loop * JDO-817 removing compiler warnings: empty catch block, empty finally, throw inside finally * JDO-817 removing compiler warnings: unchecked assignment / cast * JDO-817 removing compiler warnings: raw use of parameterized class * JDO-817 removing compiler warnings: static variable should be qualified by type name * JDO-817 removing compiler warnings: remove unused imports * JDO-817 removing compiler warnings: static variable should be qualified by type name * JDO-817 removing compiler warnings: serializable class has no definition of serialVersionUID * JDO-817 removing compiler warnings: miscellaneous warnings * JDO-817 removing compiler warnings: rawtypes warning * JDO-817 removing compiler warnings: Replace StringBuffer by StringBuilder * JDO-817 removing compiler warnings: type can be replaced by <> * JDO-817 removing compiler warnings: identical catch branches in try * JDO-817 removing compiler warnings: try finally replaceable with try with resources * JDO-817 removing compiler warnings: if can be replaced with switch; redundant throws clause * JDO-817 removing compiler warnings: use -Xlint:all,-try,-rawtypes as default * JDO-817 removing compiler warnings: added a new paragraph about wraings to the readme * JDO-817 removing compiler warnings: "raw use of parameterized class" in api submodule * JDO-817 removing compiler warnings: method close w/o throws clause in Query and Extent * JDO-817 removing compiler warnings: „redundant cast“ in api submodule * DO-817 removing compiler warnings: „serializable class has no definition of serialVersionUID“ in api submodule * JDO-817 removing compiler warnings: "raw use of parameterized class" in api submodule * JDO-817 removing compiler warnings: "raw use of parameterized class" in api submodule * JDO-817 removing compiler warnings: „static method declared final“ in api submodule * JDO-817 removing compiler warnings: „while loop replaceable with enhanced for loop“ in api submodule * JDO-817 removing compiler warnings: „anonymous can be replaced by lambda“ in api submodule * JDO-817 removing compiler warnings: „field can be final" in api submodule * JDO-817: Change pom version to 3.3-SNAPSHOT Co-authored-by: Michael Bouschen <Michael.Bouschen@akquinet.de>
The Apache JDO project includes the following subprojects:
jdo-api-{version}.jar, which defines the JDO API for Java 1.8 and later.pom.xml that ties the projects together.Apache JDO releases may be downloaded from the Apache JDO downloads page. Minor updates of releases are only available as source from the GitHub repository. Follow the instructions below to build the API from source.
For complete rules for certifying a JDO implementation, see RunRules.html in the tck project directory.
Raise any issues with the content of this project over in Apache JIRA.
You can check out the source for this project using the Clone or Download option above. For example you can type either of the following:
git clone git@github.com:apache/db-jdo.git
or
git clone https://github.com/apache/db-jdo.git
which will create a folder db-jdo with all code in it. You can read up on GIT here.
You must install the software listed in the following sections to build the API, and successfully run the TCK. Other dependencies, such as the reference implementation, DataNucleus, and the Apache Derby database, are downloaded automatically by Maven. Note that Apache JDO uses the Apache Commons Logging package for logging.
You must have Maven (version 2+) to build the projects from source and to execute the TCK. You can download Maven from here
Note that Maven uses the user.home system property for the location of the Maven local repository: ${user.home}/.m2/repository. Under Windows this system property is C:\Documents and Settings\{user} no matter what the HOME variable is set to. As a workaround you may set the system property by adding -Duser.home=%HOME% to the environment variable MAVEN_OPTS.
The JNDI test cases in tck need a JNDI implementation. The TCK is configured to use Sun‘s JNDI implementation. To use your own implementation, put the implementation jar files into lib/ext and update jndi.properties in the TCK directory src/conf.
To download Oracle’s implementation, go here. Accept the license agreement and download File System Service Provider, 1.2 Beta 3 and then unpack the downloaded zip into lib/ext. It includes the jars fscontext.jar and providerutil.jar.
To build Apache JDO with all subprojects (api, exectck, tck) go to the root directory of the branch you are working in
mvn clean install
This will build the artifacts jdo-api and jdo-exectck and will then run the TCK.
To build just the API, change to the “api” directory of the branch you are working in and run
mvn clean install
This will build the jdo-api artifact and install it in your local Maven repository.
Firstly build from the top level project as described above. To run the JDO TCK on an Implementation Under Test, edit tck/pom.xml and add the iut dependencies to the profile called iut. Also check the following files under tck/src/main/resources/conf and change the content to the needs of the Implementation Under Test: iut-jdoconfig.xml, iut-log4j.properties, iut-persistence.xml and iut-pmf.properties.
Change to the “tck” directory of the branch you are working in and run
mvn -Djdo.tck.impl="iut" clean install
and this will run the TCK (via the “jdo-exectck” plugin) on the Implementation Under Test on all supported databases and identity types.
The jdo-exectck Maven plugin (built from the exectck directory) has various options so you can run other implementations or only run particular tests.
The jdo-exectck Maven plugin has the following custom goals
The jdo-exectck Maven plugin has the following options
${user.dir}/datanucleus.txtExample 1 : Installs the database schema for datastore identity for all supported databases.
mvn -Djdo.tck.identitytypes=datastoreidentity jdo-exectck:installSchema
Example 2 : Runs the test configurations specified in alltests.conf and cfg1.conf on the JDORI, using all supported identity types and databases.
mvn -Djdo.tck.cfglist="alltests.conf cfg1.conf" jdo-exectck:runtck
While running the TCK, maven uses the following configuration files in src/conf:
There is a profile called warnings that configures the maven-compiler-plugin to show compiler warnings and passes -Xlint:all,-try,-rawtypes as argument to javac. Activate the warnings profile to enable compiler warnings. Please note, the tck enables the profile jdori per default and this default is disabled when specifying the profile warnings. So if you want to run the tck with the jdori with warnings enabled please use the following:
mvn -Pwarnings,jdori clean install
You can pass different compiler arguments using the -D option:
mvn -Pwarnings,jdori -DcompilerArgument=-Xlint:all clean install