|
| 1 | +# Apache Commons Lang |
| 2 | + |
| 3 | +TuxCare's Endless Lifecycle Support (ELS) for Apache Commons Lang provides security patches, and selected bug fixes, that are integral to the stable operation of applications using Commons Lang. |
| 4 | + |
| 5 | +## Supported Versions |
| 6 | + |
| 7 | +* Apache Commons Lang 2.4, 2.6, 3.4, 3.10, 3.12.0 |
| 8 | + |
| 9 | +## Connection to ELS for Apache Commons Lang Repository |
| 10 | + |
| 11 | +This guide outlines the steps needed to integrate the TuxCare ELS for Apache Commons Lang 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 Apache Commons Lang repository. Anonymous access is disabled. To receive username and password please contact [sales@tuxcare.com](mailto:sales@tuxcare.com). |
| 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 Apache Commons Lang 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 Apache Commons Lang 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 Apache Commons Lang 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 Apache Commons Lang 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 Apache Commons Lang repository. |
| 93 | + |
| 94 | +### Conclusion |
| 95 | + |
| 96 | +You've successfully integrated the TuxCare ELS for Apache Commons Lang repository into your project. You can now benefit from the secure and vetted Apache Commons Lang libraries it provides. |
| 97 | + |
| 98 | +## Vulnerability Exploitability eXchange (VEX) |
| 99 | + |
| 100 | +VEX is a machine-readable format that tells you if a known vulnerability is actually exploitable in your product. It reduces false positives, helps prioritize real risks. |
| 101 | + |
| 102 | +TuxCare provides VEX for Apache Commons Lang ELS versions: [security.tuxcare.com/vex/cyclonedx/els_lang_java/commons-lang/](https://security.tuxcare.com/vex/cyclonedx/els_lang_java/commons-lang/). |
| 103 | + |
| 104 | +## How to Upgrade to a Newer Version of TuxCare Packages |
| 105 | + |
| 106 | +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. |
| 107 | + |
| 108 | +<script setup> |
| 109 | +const mavencreds = |
| 110 | +`<?xml version="1.0" encoding="UTF-8"?> |
| 111 | +<settings xmlns="http://maven.apache.org/SETTINGS/1.1.0"> |
| 112 | + <servers> |
| 113 | + <server> |
| 114 | + <id>tuxcare-registry</id> |
| 115 | + <username>USERNAME</username> |
| 116 | + <password>PASSWORD</password> |
| 117 | + </server> |
| 118 | + </servers> |
| 119 | +</settings>` |
| 120 | + |
| 121 | +const gradlecreds = |
| 122 | +`tuxcare_registry_url=https://nexus.repo.tuxcare.com/repository/els_spring/ |
| 123 | ++tuxcare_registry_user=USERNAME |
| 124 | ++tuxcare_registry_password=PASSWORD` |
| 125 | + |
| 126 | +const mavenrepo = |
| 127 | +`<repositories> |
| 128 | + <repository> |
| 129 | + <id>tuxcare-registry</id> |
| 130 | + <url>https://nexus.repo.tuxcare.com/repository/els_spring/</url> |
| 131 | + </repository> |
| 132 | +</repositories>` |
| 133 | + |
| 134 | +const gradlerepo = |
| 135 | +`repositories { |
| 136 | + maven { |
| 137 | + url = uri(providers.gradleProperty("tuxcare_registry_url").get()) |
| 138 | + credentials { |
| 139 | + username = providers.gradleProperty("tuxcare_registry_user").get() |
| 140 | + password = providers.gradleProperty("tuxcare_registry_password").get() |
| 141 | + } |
| 142 | + authentication { basic(BasicAuthentication) } |
| 143 | + } |
| 144 | + mavenCentral() |
| 145 | +}` |
| 146 | + |
| 147 | +const mavendeps = |
| 148 | +`<dependencies> |
| 149 | + <dependency> |
| 150 | + <groupId>commons-lang</groupId> |
| 151 | + <artifactId>commons-lang</artifactId> |
| 152 | + <version>2.6-tuxcare.1</version> |
| 153 | + </dependency> |
| 154 | +</dependencies>` |
| 155 | + |
| 156 | +const gradledeps = |
| 157 | +`dependencies { |
| 158 | + implementation("commons-lang:commons-lang:2.6-tuxcare.1") |
| 159 | +}` |
| 160 | +</script> |
0 commit comments