Skip to content

Commit 66d5a43

Browse files
Copilottrask
andcommitted
Update cloudfoundry-resources module to follow style guide
Co-authored-by: trask <[email protected]>
1 parent 91c5a19 commit 66d5a43

File tree

14 files changed

+299
-25
lines changed

14 files changed

+299
-25
lines changed

META-INF/MANIFEST.MF

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
Manifest-Version: 1.0
2+
Created-By: Maven JAR Plugin 3.4.2
3+
Build-Jdk-Spec: 1.5
4+
Build-Tool-Jdk-Spec: 21
5+
Automatic-Module-Name: org.jacoco.agent.rt
6+
Implementation-Title: JaCoCo Java Agent
7+
Implementation-Vendor: Mountainminds GmbH & Co. KG
8+
Implementation-Version: 0.8.13
9+
Premain-Class: org.jacoco.agent.rt.internal_0e20598.PreMain
10+
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
artifactId=org.jacoco.agent.rt
2+
groupId=org.jacoco
3+
version=0.8.13
Lines changed: 109 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2009, 2025 Mountainminds GmbH & Co. KG and Contributors
4+
This program and the accompanying materials are made available under
5+
the terms of the Eclipse Public License 2.0 which is available at
6+
http://www.eclipse.org/legal/epl-2.0
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
Evgeny Mandrikov - initial API and implementation
12+
-->
13+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
14+
<modelVersion>4.0.0</modelVersion>
15+
16+
<parent>
17+
<groupId>org.jacoco</groupId>
18+
<artifactId>org.jacoco.build</artifactId>
19+
<version>0.8.13</version>
20+
<relativePath>../org.jacoco.build</relativePath>
21+
</parent>
22+
23+
<artifactId>org.jacoco.agent.rt</artifactId>
24+
<!-- do not set packaging to eclipse-plugin, because otherwise maven-shade-plugin will not work -->
25+
26+
<name>JaCoCo :: Agent RT</name>
27+
<description>JaCoCo Java Agent</description>
28+
29+
<properties>
30+
<maven.deploy.skip>true</maven.deploy.skip>
31+
<maven.javadoc.skip>true</maven.javadoc.skip>
32+
</properties>
33+
34+
<dependencies>
35+
<dependency>
36+
<groupId>${project.groupId}</groupId>
37+
<artifactId>org.jacoco.core</artifactId>
38+
</dependency>
39+
</dependencies>
40+
41+
<build>
42+
<sourceDirectory>src</sourceDirectory>
43+
44+
<plugins>
45+
<plugin>
46+
<groupId>org.apache.maven.plugins</groupId>
47+
<artifactId>maven-shade-plugin</artifactId>
48+
<executions>
49+
<execution>
50+
<phase>package</phase>
51+
<goals>
52+
<goal>shade</goal>
53+
</goals>
54+
<configuration>
55+
<shadedArtifactAttached>true</shadedArtifactAttached>
56+
<shadedClassifierName>all</shadedClassifierName>
57+
<minimizeJar>true</minimizeJar>
58+
<relocations>
59+
<relocation>
60+
<pattern>org.jacoco.agent.rt.internal</pattern>
61+
<shadedPattern>${jacoco.runtime.package.name}</shadedPattern>
62+
</relocation>
63+
<relocation>
64+
<pattern>org.jacoco.core</pattern>
65+
<shadedPattern>${jacoco.runtime.package.name}.core</shadedPattern>
66+
</relocation>
67+
<relocation>
68+
<pattern>org.objectweb.asm</pattern>
69+
<shadedPattern>${jacoco.runtime.package.name}.asm</shadedPattern>
70+
</relocation>
71+
</relocations>
72+
<filters>
73+
<filter>
74+
<artifact>*:*</artifact>
75+
<excludes>
76+
<exclude>META-INF/MANIFEST.MF</exclude>
77+
</excludes>
78+
</filter>
79+
<filter>
80+
<artifact>org.jacoco:org.jacoco.core</artifact>
81+
<excludes>
82+
<exclude>about.html</exclude>
83+
</excludes>
84+
</filter>
85+
<filter>
86+
<artifact>org.ow2.asm:*</artifact>
87+
<excludes>
88+
<exclude>module-info.class</exclude>
89+
</excludes>
90+
</filter>
91+
</filters>
92+
<transformers>
93+
<transformer implementation="org.apache.maven.plugins.shade.resource.ManifestResourceTransformer">
94+
<manifestEntries>
95+
<Premain-Class>${jacoco.runtime.package.name}.PreMain</Premain-Class>
96+
<Automatic-Module-Name>${project.artifactId}</Automatic-Module-Name>
97+
<Implementation-Title>${project.description}</Implementation-Title>
98+
<Implementation-Vendor>${project.organization.name}</Implementation-Vendor>
99+
<Implementation-Version>${project.version}</Implementation-Version>
100+
</manifestEntries>
101+
</transformer>
102+
</transformers>
103+
</configuration>
104+
</execution>
105+
</executions>
106+
</plugin>
107+
</plugins>
108+
</build>
109+
</project>
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
artifactId=org.jacoco.core
2+
groupId=org.jacoco
3+
version=0.8.13
Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="UTF-8"?>
2+
<!--
3+
Copyright (c) 2009, 2025 Mountainminds GmbH & Co. KG and Contributors
4+
This program and the accompanying materials are made available under
5+
the terms of the Eclipse Public License 2.0 which is available at
6+
http://www.eclipse.org/legal/epl-2.0
7+
8+
SPDX-License-Identifier: EPL-2.0
9+
10+
Contributors:
11+
Evgeny Mandrikov - initial API and implementation
12+
-->
13+
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
14+
<modelVersion>4.0.0</modelVersion>
15+
16+
<parent>
17+
<groupId>org.jacoco</groupId>
18+
<artifactId>org.jacoco.build</artifactId>
19+
<version>0.8.13</version>
20+
<relativePath>../org.jacoco.build</relativePath>
21+
</parent>
22+
23+
<artifactId>org.jacoco.core</artifactId>
24+
25+
<name>JaCoCo :: Core</name>
26+
<description>JaCoCo Core</description>
27+
28+
<dependencies>
29+
<dependency>
30+
<groupId>org.ow2.asm</groupId>
31+
<artifactId>asm</artifactId>
32+
</dependency>
33+
<dependency>
34+
<groupId>org.ow2.asm</groupId>
35+
<artifactId>asm-commons</artifactId>
36+
</dependency>
37+
<dependency>
38+
<groupId>org.ow2.asm</groupId>
39+
<artifactId>asm-tree</artifactId>
40+
</dependency>
41+
</dependencies>
42+
43+
<build>
44+
<sourceDirectory>src</sourceDirectory>
45+
46+
<plugins>
47+
<plugin>
48+
<groupId>org.apache.felix</groupId>
49+
<artifactId>maven-bundle-plugin</artifactId>
50+
<executions>
51+
<execution>
52+
<phase>process-classes</phase>
53+
<goals>
54+
<goal>manifest</goal>
55+
</goals>
56+
</execution>
57+
</executions>
58+
</plugin>
59+
<plugin>
60+
<groupId>org.apache.maven.plugins</groupId>
61+
<artifactId>maven-jar-plugin</artifactId>
62+
<configuration>
63+
<archive>
64+
<manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
65+
</archive>
66+
</configuration>
67+
</plugin>
68+
</plugins>
69+
</build>
70+
</project>

about.html

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
<?xml version="1.0" encoding="UTF-8" ?>
2+
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
3+
<html>
4+
<head>
5+
<title>About</title>
6+
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
7+
</head>
8+
<body lang="EN-US">
9+
<h2>About This Content</h2>
10+
11+
<p>
12+
2025/04/02
13+
</p>
14+
15+
<h3>License</h3>
16+
17+
<p>
18+
All Content in this distribution is made available by Mountainminds GmbH &amp; Co.
19+
KG, Munich. Unless otherwise indicated below, the Content is provided to you
20+
under the terms and conditions of the Eclipse Public License Version 2.0
21+
(&quot;EPL&quot;). A copy of the EPL is available at
22+
<a href="https://www.eclipse.org/legal/epl-2.0/">https://www.eclipse.org/legal/epl-2.0/</a>.
23+
For purposes of the EPL, "Program" will mean the Content.
24+
</p>
25+
26+
<h3>Third Party Content</h3>
27+
28+
<p>
29+
The Content includes items that have been sourced from third parties as set
30+
out below.
31+
</p>
32+
33+
<h4>ASM</h4>
34+
35+
<p>
36+
<a href="https://asm.ow2.io/">ASM 9.8</a> is subject to the terms and
37+
conditions of the following license:
38+
</p>
39+
40+
<pre>
41+
ASM: a very small and fast Java bytecode manipulation framework
42+
Copyright (c) 2000-2011 INRIA, France Telecom
43+
All rights reserved.
44+
45+
Redistribution and use in source and binary forms, with or without
46+
modification, are permitted provided that the following conditions
47+
are met:
48+
1. Redistributions of source code must retain the above copyright
49+
notice, this list of conditions and the following disclaimer.
50+
2. Redistributions in binary form must reproduce the above copyright
51+
notice, this list of conditions and the following disclaimer in the
52+
documentation and/or other materials provided with the distribution.
53+
3. Neither the name of the copyright holders nor the names of its
54+
contributors may be used to endorse or promote products derived from
55+
this software without specific prior written permission.
56+
57+
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
58+
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
59+
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
60+
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
61+
LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
62+
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
63+
SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
64+
INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
65+
CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
66+
ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
67+
THE POSSIBILITY OF SUCH DAMAGE.
68+
</pre>
69+
70+
71+
</body>
72+
</html>

cloudfoundry-resources/build.gradle.kts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,8 @@ dependencies {
1414
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure-spi")
1515

1616
compileOnly("io.opentelemetry:opentelemetry-sdk-extension-autoconfigure")
17+
compileOnly("com.google.auto.service:auto-service-annotations")
18+
annotationProcessor("com.google.auto.service:auto-service")
1719

1820
implementation("com.fasterxml.jackson.core:jackson-core")
1921
implementation("io.opentelemetry.semconv:opentelemetry-semconv")

cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResource.java

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,8 @@
55

66
package io.opentelemetry.contrib.cloudfoundry.resources;
77

8+
import static io.opentelemetry.api.common.AttributeKey.stringKey;
9+
810
import com.fasterxml.jackson.core.JsonFactory;
911
import com.fasterxml.jackson.core.JsonParser;
1012
import com.fasterxml.jackson.core.JsonToken;
@@ -22,24 +24,22 @@ public final class CloudFoundryResource {
2224
private static final String ENV_VCAP_APPLICATION = "VCAP_APPLICATION";
2325

2426
// copied from CloudfoundryIncubatingAttributes
25-
private static final AttributeKey<String> CLOUDFOUNDRY_APP_ID =
26-
AttributeKey.stringKey("cloudfoundry.app.id");
27+
private static final AttributeKey<String> CLOUDFOUNDRY_APP_ID = stringKey("cloudfoundry.app.id");
2728
private static final AttributeKey<String> CLOUDFOUNDRY_APP_INSTANCE_ID =
28-
AttributeKey.stringKey("cloudfoundry.app.instance.id");
29+
stringKey("cloudfoundry.app.instance.id");
2930
private static final AttributeKey<String> CLOUDFOUNDRY_APP_NAME =
30-
AttributeKey.stringKey("cloudfoundry.app.name");
31-
private static final AttributeKey<String> CLOUDFOUNDRY_ORG_ID =
32-
AttributeKey.stringKey("cloudfoundry.org.id");
31+
stringKey("cloudfoundry.app.name");
32+
private static final AttributeKey<String> CLOUDFOUNDRY_ORG_ID = stringKey("cloudfoundry.org.id");
3333
private static final AttributeKey<String> CLOUDFOUNDRY_ORG_NAME =
34-
AttributeKey.stringKey("cloudfoundry.org.name");
34+
stringKey("cloudfoundry.org.name");
3535
private static final AttributeKey<String> CLOUDFOUNDRY_PROCESS_ID =
36-
AttributeKey.stringKey("cloudfoundry.process.id");
36+
stringKey("cloudfoundry.process.id");
3737
private static final AttributeKey<String> CLOUDFOUNDRY_PROCESS_TYPE =
38-
AttributeKey.stringKey("cloudfoundry.process.type");
38+
stringKey("cloudfoundry.process.type");
3939
private static final AttributeKey<String> CLOUDFOUNDRY_SPACE_ID =
40-
AttributeKey.stringKey("cloudfoundry.space.id");
40+
stringKey("cloudfoundry.space.id");
4141
private static final AttributeKey<String> CLOUDFOUNDRY_SPACE_NAME =
42-
AttributeKey.stringKey("cloudfoundry.space.name");
42+
stringKey("cloudfoundry.space.name");
4343
private static final Logger LOG = Logger.getLogger(CloudFoundryResource.class.getName());
4444
private static final JsonFactory JSON_FACTORY = new JsonFactory();
4545
private static final Resource INSTANCE = buildResource(System::getenv);

cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceDetector.java

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,14 @@
55

66
package io.opentelemetry.contrib.cloudfoundry.resources;
77

8+
import com.google.auto.service.AutoService;
89
import io.opentelemetry.api.incubator.config.DeclarativeConfigProperties;
910
import io.opentelemetry.sdk.autoconfigure.spi.internal.ComponentProvider;
1011
import io.opentelemetry.sdk.resources.Resource;
1112

12-
public class CloudFoundryResourceDetector implements ComponentProvider<Resource> {
13+
@SuppressWarnings("rawtypes")
14+
@AutoService(ComponentProvider.class)
15+
public final class CloudFoundryResourceDetector implements ComponentProvider<Resource> {
1316

1417
@Override
1518
public Class<Resource> getType() {

cloudfoundry-resources/src/main/java/io/opentelemetry/contrib/cloudfoundry/resources/CloudFoundryResourceProvider.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@
55

66
package io.opentelemetry.contrib.cloudfoundry.resources;
77

8+
import com.google.auto.service.AutoService;
89
import io.opentelemetry.sdk.autoconfigure.spi.ConfigProperties;
910
import io.opentelemetry.sdk.autoconfigure.spi.ResourceProvider;
1011
import io.opentelemetry.sdk.resources.Resource;
1112

12-
public class CloudFoundryResourceProvider implements ResourceProvider {
13+
@AutoService(ResourceProvider.class)
14+
public final class CloudFoundryResourceProvider implements ResourceProvider {
1315

1416
@Override
1517
public Resource createResource(ConfigProperties configProperties) {

0 commit comments

Comments
 (0)