|
| 1 | +# Hibernate |
| 2 | + |
| 3 | +TuxCare's Endless Lifecycle Support (ELS) for Hibernate provides security patches, and selected bug fixes, that are integral to the stable operation of applications running on Hibernate. |
| 4 | + |
| 5 | +## Supported Versions |
| 6 | + |
| 7 | +* Hibernate ORM 5.6.15.Final |
| 8 | + |
| 9 | +## Connection to ELS for Hibernate Repository |
| 10 | + |
| 11 | +This guide outlines the steps needed to integrate the TuxCare ELS for Hibernate repository into your Java application. The repository provides trusted Java libraries that can be easily integrated into your Maven and Gradle projects. |
| 12 | + |
| 13 | +### Step 1: Get user credentials |
| 14 | + |
| 15 | +You need username and password in order to use TuxCare ELS Hibernate repository. Anonymous access is disabled. To receive username and password please contact [[email protected]](mailto:[email protected]). |
| 16 | + |
| 17 | +### Step 2: Configure Registry |
| 18 | + |
| 19 | +1. Navigate to the directory depending on your operating system. |
| 20 | + * Windows |
| 21 | + ```text |
| 22 | + Maven: C:\Users\{username}\.m2 |
| 23 | + Gradle: C:\Users\{username}\.gradle |
| 24 | + ``` |
| 25 | + * macOS |
| 26 | + ```text |
| 27 | + Maven: /Users/{username}/.m2 |
| 28 | + Gradle: /Users/{username}/.gradle |
| 29 | + ``` |
| 30 | + * Linux |
| 31 | + ```text |
| 32 | + Maven: /home/{username}/.m2 |
| 33 | + Gradle: /home/{username}/.gradle |
| 34 | + ``` |
| 35 | + |
| 36 | +2. Add the TuxCare repository and plugin repository to your build configuration. |
| 37 | + |
| 38 | + :::tip |
| 39 | + For Maven, you may choose any valid `<id>` value instead of `tuxcare-registry`, but the same value must be used in both `settings.xml` and `pom.xml`. |
| 40 | + ::: |
| 41 | + |
| 42 | + <CodeTabs :tabs="[ |
| 43 | + { title: 'Maven (~/.m2/settings.xml)', content: mavencreds }, |
| 44 | + { title: 'Gradle (~/.gradle/gradle.properties)', content: gradlecreds } |
| 45 | + ]" /> |
| 46 | + |
| 47 | + Here `USERNAME` and `PASSWORD` are your credentials mentioned in the [Step 1](#step-1-get-user-credentials). |
| 48 | + |
| 49 | +### Step 3: Update Build Configuration |
| 50 | + |
| 51 | +Add the TuxCare Hibernate repository and plugins to your build configuration: |
| 52 | + |
| 53 | +<CodeTabs :tabs="[ |
| 54 | + { title: 'Maven (pom.xml)', content: mavenrepo }, |
| 55 | + { title: 'Gradle (build.gradle)', content: gradlerepo } |
| 56 | +]" /> |
| 57 | + |
| 58 | +* To fully switch from the official Hibernate repository, replace it with the TuxCare repository. |
| 59 | +* To keep both, add TuxCare after the official one. |
| 60 | + |
| 61 | +Example Maven and Gradle projects are available on GitHub. Remember to set the required environment variables. |
| 62 | +* [Maven](https://github.com/cloudlinux/securechain-java/tree/main/examples/maven) |
| 63 | +* [Gradle](https://github.com/cloudlinux/securechain-java/tree/main/examples/gradle) |
| 64 | + |
| 65 | +### Step 4: Update Dependencies |
| 66 | + |
| 67 | +Replace the Hibernate dependencies in your build file with the TuxCare-maintained versions to cover both direct and transitive dependencies. |
| 68 | + |
| 69 | +You can find a specific artifact version in your TuxCare account on [Nexus](https://nexus.repo.tuxcare.com/repository/els_spring/) (anonymous access is restricted). |
| 70 | + |
| 71 | +<CodeTabs :tabs="[ |
| 72 | + { title: 'Maven (pom.xml)', content: mavendeps }, |
| 73 | + { title: 'Gradle (build.gradle)', content: gradledeps } |
| 74 | +]" /> |
| 75 | + |
| 76 | +### Step 5: Verify and Build |
| 77 | + |
| 78 | +1. To confirm the TuxCare Hibernate repository is set up correctly, use your build tool to list the project's dependencies. It shows both direct and transitive dependencies in the classpath. |
| 79 | + |
| 80 | + <CodeTabs :tabs="[ |
| 81 | + { title: 'Maven', content: `mvn dependency:tree -Dverbose` }, |
| 82 | + { title: 'Gradle', content: `./gradlew dependencies --configuration runtimeClasspath` } |
| 83 | + ]" /> |
| 84 | + |
| 85 | +2. After reviewing the dependencies, include any library from the repository into your project and then run a build: |
| 86 | + |
| 87 | + <CodeTabs :tabs="[ |
| 88 | + { title: 'Maven', content: `mvn clean install` }, |
| 89 | + { title: 'Gradle', content: `./gradlew build` } |
| 90 | + ]" /> |
| 91 | + |
| 92 | +The build tool you're using should be able to identify and resolve dependencies from the TuxCare ELS for Hibernate repository. |
| 93 | + |
| 94 | +### Conclusion |
| 95 | + |
| 96 | +You've successfully integrated the TuxCare ELS for Hibernate repository into your project. You can now benefit from the secure and vetted Hibernate libraries it provides. |
| 97 | + |
| 98 | +## How to Upgrade to a Newer Version of TuxCare Packages |
| 99 | + |
| 100 | +If you have already installed a package with a `tuxcare.1` suffix and want to upgrade to a newer release (for example, `tuxcare.3`), you need to update version strings in your Maven or Gradle build file. |
| 101 | + |
| 102 | +<script setup> |
| 103 | +const mavencreds = |
| 104 | +`<?xml version="1.0" encoding="UTF-8"?> |
| 105 | +<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"> |
| 106 | + <servers> |
| 107 | + <server> |
| 108 | + <id>tuxcare-registry</id> |
| 109 | + <username>USERNAME</username> |
| 110 | + <password>PASSWORD</password> |
| 111 | + </server> |
| 112 | + </servers> |
| 113 | +</settings>` |
| 114 | + |
| 115 | +const gradlecreds = |
| 116 | +`tuxcare_registry_url=https://nexus.repo.tuxcare.com/repository/els_spring/ |
| 117 | +tuxcare_registry_user=USERNAME |
| 118 | +tuxcare_registry_password=PASSWORD` |
| 119 | + |
| 120 | +const mavenrepo = |
| 121 | +`<repositories> |
| 122 | + <repository> |
| 123 | + <id>tuxcare-registry</id> |
| 124 | + <url>https://nexus.repo.tuxcare.com/repository/els_spring/</url> |
| 125 | + </repository> |
| 126 | +</repositories>` |
| 127 | + |
| 128 | +const gradlerepo = |
| 129 | +`repositories { |
| 130 | + maven { |
| 131 | + url = uri(providers.gradleProperty("tuxcare_registry_url").get()) |
| 132 | + credentials { |
| 133 | + username = providers.gradleProperty("tuxcare_registry_user").get() |
| 134 | + password = providers.gradleProperty("tuxcare_registry_password").get() |
| 135 | + } |
| 136 | + authentication { basic(BasicAuthentication) } |
| 137 | + } |
| 138 | + mavenCentral() |
| 139 | +}` |
| 140 | + |
| 141 | +const mavendeps = |
| 142 | +`<dependencies> |
| 143 | + <dependency> |
| 144 | + <groupId>org.hibernate</groupId> |
| 145 | + <artifactId>hibernate-core</artifactId> |
| 146 | + <version>5.6.15.Final-tuxcare.1</version> |
| 147 | + </dependency> |
| 148 | +</dependencies>` |
| 149 | + |
| 150 | +const gradledeps = |
| 151 | +`dependencies { |
| 152 | + implementation("org.hibernate:hibernate-core:5.6.15.Final-tuxcare.1") |
| 153 | +}` |
| 154 | +</script> |
| 155 | + |
0 commit comments