Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error reading assemblies: No assembly descriptors found #24

Closed
antonio-pedro99 opened this issue Jun 22, 2024 · 16 comments
Closed

Error reading assemblies: No assembly descriptors found #24

antonio-pedro99 opened this issue Jun 22, 2024 · 16 comments
Assignees

Comments

@antonio-pedro99
Copy link
Member

I am trying to set up the project locally, and facing the following error

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-assembly-plugin:2.2-beta-5:single (default-cli) on project metrics-reporter: Error reading assemblies: No assembly descriptors found. -> [Help 1]
[ERROR] 
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR] 
[ERROR] For more information about the errors and possible solutions, please read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException

From where can I get the assembly descriptor?

@mimaison
Copy link
Contributor

Hi @antonio-pedro99,

The initial import used the maven assembly plugin to generate a JAR with dependencies. It looks like the plugin was removed in 9b8756d by @scholzj. He did keep the version definition but commented it out: https://github.com/strimzi/metrics-reporter/blob/main/pom.xml#L110.

I'm not sure if it was done for a specific reason or if it's only temporary. In the meantime, you can uncomment the version definition and add the following to the plugins section of the pom.xml file:

<plugin>
    <groupId>org.apache.maven.plugins</groupId>
    <artifactId>maven-assembly-plugin</artifactId>
    <version>${maven.assembly.version}</version>
    <executions>
        <execution>
            <phase>package</phase>
            <goals><goal>single</goal></goals>
        </execution>
    </executions>
    <configuration>
        <descriptorRefs>
            <descriptorRef>jar-with-dependencies</descriptorRef>
        </descriptorRefs>
    </configuration>
</plugin>

@scholzj
Copy link
Member

scholzj commented Jun 24, 2024

It is working on the CIs. So I'm not sure this is a problem of something missing but more some kind of environment issue or some issue with what is being run?

@mimaison
Copy link
Contributor

mimaison commented Jun 24, 2024

Is the CI running assembly:single?
This is the command the README mentions to build the project (and the command I use too to get an uber JAR)

@scholzj
Copy link
Member

scholzj commented Jun 24, 2024

I guess it does not. And I'm not sure what would such command be even expected to do TBH.

@mimaison
Copy link
Contributor

As mentioned the assembly plugin can be used to produce an uber JAR.

@scholzj
Copy link
Member

scholzj commented Jun 24, 2024

I know what the assembly plugin does, but I never saw it used in that way. I think it should be removed from the README.

@mimaison
Copy link
Contributor

I think we want to produce an uber JAR for this project. So what do you suggest we do?

@scholzj
Copy link
Member

scholzj commented Jun 24, 2024

I'm not sure we want to produce Uber JAR. I do not think we tend to do it for other similar projects. We would normally produce the regular JARs and if needed a ZIP / TGZ archive with all the required dependencies.

@mimaison
Copy link
Contributor

Doing my homework and checking other Strimzi projects do, it seems we want to do something similar to what is done in https://github.com/strimzi/kafka-kubernetes-config-provider.

So builds should produce source archives, and archives of the metrics-reporter JAR + JAR dependencies (with the license and readme).

@scholzj
Copy link
Member

scholzj commented Jun 26, 2024

@mimaison Sounds like a plan. Should I do it?

@mimaison
Copy link
Contributor

Maybe let's see if @OwenCorrigan76 or @antonio-pedro99 would be interested in contributing this?
If not, be my guest! Messing with CI/pom is not my favorite pastime :)

@OwenCorrigan76
Copy link
Contributor

OwenCorrigan76 commented Jun 26, 2024

@scholzj @mimaison I'd like to look at this if that's ok guys. Not sure how to go about it so there will be questions if that's also ok.

@scholzj
Copy link
Member

scholzj commented Jun 26, 2024

@OwenCorrigan76 Sure. Feel free to ping me for help or review.

@OwenCorrigan76
Copy link
Contributor

OwenCorrigan76 commented Jun 27, 2024

Using similar to other Strimzi projects, this is the contents of metrics-reporter-1.0.0-SNAPSHOT.zip

metrics-reporter-1.0.0-SNAPSHOT/
metrics-reporter-1.0.0-SNAPSHOT/libs/
metrics-reporter-1.0.0-SNAPSHOT/LICENSE
metrics-reporter-1.0.0-SNAPSHOT/README.md
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient_tracer_otel-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient_tracer_common-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient_tracer_otel_agent-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient_hotspot-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient_httpserver-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.prometheus.simpleclient_common-0.16.0.jar
metrics-reporter-1.0.0-SNAPSHOT/libs/io.strimzi.metrics-reporter-1.0.0-SNAPSHOT.jar

And this is the contents of metrics-reporter-1.0.0-SNAPSHOT.jar:

META-INF/MANIFEST.MF
io/
io/strimzi/
io/strimzi/kafka/
io/strimzi/kafka/metrics/
META-INF/maven/
META-INF/maven/io.strimzi/
META-INF/maven/io.strimzi/metrics-reporter/
io/strimzi/kafka/metrics/YammerPrometheusMetricsReporter.class
io/strimzi/kafka/metrics/KafkaPrometheusMetricsReporter.class
io/strimzi/kafka/metrics/KafkaMetricsCollector.class
io/strimzi/kafka/metrics/PrometheusMetricsReporterConfig$Listener.class
io/strimzi/kafka/metrics/PrometheusMetricsReporterConfig$ListenerValidator.class
io/strimzi/kafka/metrics/PrometheusMetricsReporterConfig.class
io/strimzi/kafka/metrics/MetricFamilySamplesBuilder.class
io/strimzi/kafka/metrics/YammerMetricsCollector.class
META-INF/maven/io.strimzi/metrics-reporter/pom.xml
META-INF/maven/io.strimzi/metrics-reporter/pom.properties

Does this look like all of the dependencies are present for the Metrics Reporter?

This is everything that was in the previously used uber jar:

META-INF/MANIFEST.MF
io/
io/strimzi/
io/strimzi/kafka/
io/strimzi/kafka/metrics/
io/strimzi/kafka/metrics/YammerPrometheusMetricsReporter.class
io/strimzi/kafka/metrics/KafkaPrometheusMetricsReporter.class
io/strimzi/kafka/metrics/KafkaMetricsCollector.class
io/strimzi/kafka/metrics/PrometheusMetricsReporterConfig$Listener.class
io/strimzi/kafka/metrics/PrometheusMetricsReporterConfig$ListenerValidator.class
io/strimzi/kafka/metrics/PrometheusMetricsReporterConfig.class
io/strimzi/kafka/metrics/MetricFamilySamplesBuilder.class
io/strimzi/kafka/metrics/YammerMetricsCollector.class
META-INF/maven/
META-INF/maven/io.prometheus/
META-INF/maven/io.prometheus/simpleclient/
META-INF/maven/io.prometheus/simpleclient/pom.properties
META-INF/maven/io.prometheus/simpleclient/pom.xml
io/prometheus/
io/prometheus/client/
io/prometheus/client/CKMSQuantiles$Quantile.class
io/prometheus/client/CKMSQuantiles$Sample.class
io/prometheus/client/CKMSQuantiles.class
io/prometheus/client/Collector$1.class
io/prometheus/client/Collector$Describable.class
io/prometheus/client/Collector$MetricFamilySamples$Sample.class
io/prometheus/client/Collector$MetricFamilySamples.class
io/prometheus/client/Collector$Type.class
io/prometheus/client/Collector.class
io/prometheus/client/CollectorRegistry$MetricFamilySamplesEnumeration.class
io/prometheus/client/CollectorRegistry.class
io/prometheus/client/Counter$Builder.class
io/prometheus/client/Counter$Child.class
io/prometheus/client/Counter.class
io/prometheus/client/CounterMetricFamily.class
io/prometheus/client/DoubleAdder.class
io/prometheus/client/Enumeration$1.class
io/prometheus/client/Enumeration$Builder.class
io/prometheus/client/Enumeration$Child.class
io/prometheus/client/Enumeration.class
io/prometheus/client/Environment.class
io/prometheus/client/Gauge$1.class
io/prometheus/client/Gauge$Builder.class
io/prometheus/client/Gauge$Child.class
io/prometheus/client/Gauge$TimeProvider.class
io/prometheus/client/Gauge$Timer.class
io/prometheus/client/Gauge.class
io/prometheus/client/GaugeMetricFamily.class
io/prometheus/client/Histogram$1.class
io/prometheus/client/Histogram$Builder.class
io/prometheus/client/Histogram$Child$Value.class
io/prometheus/client/Histogram$Child.class
io/prometheus/client/Histogram$Timer.class
io/prometheus/client/Histogram.class
io/prometheus/client/Info$1.class
io/prometheus/client/Info$Builder.class
io/prometheus/client/Info$Child.class
io/prometheus/client/Info.class
io/prometheus/client/Predicate.class
io/prometheus/client/SampleNameFilter$1.class
io/prometheus/client/SampleNameFilter$AllowAll.class
io/prometheus/client/SampleNameFilter$Builder.class
io/prometheus/client/SampleNameFilter.class
io/prometheus/client/SimpleCollector$Builder.class
io/prometheus/client/SimpleCollector.class
io/prometheus/client/SimpleTimer$TimeProvider.class
io/prometheus/client/SimpleTimer.class
io/prometheus/client/Striped64$Cell.class
io/prometheus/client/Striped64.class
io/prometheus/client/Summary$1.class
io/prometheus/client/Summary$Builder.class
io/prometheus/client/Summary$Child$Value.class
io/prometheus/client/Summary$Child.class
io/prometheus/client/Summary$Timer.class
io/prometheus/client/Summary.class
io/prometheus/client/SummaryMetricFamily.class
io/prometheus/client/Supplier.class
io/prometheus/client/TimeWindowQuantiles.class
io/prometheus/client/exemplars/
io/prometheus/client/exemplars/CounterExemplarSampler.class
io/prometheus/client/exemplars/DefaultExemplarSampler$Clock.class
io/prometheus/client/exemplars/DefaultExemplarSampler$SystemClock.class
io/prometheus/client/exemplars/DefaultExemplarSampler.class
io/prometheus/client/exemplars/Exemplar.class
io/prometheus/client/exemplars/ExemplarConfig.class
io/prometheus/client/exemplars/ExemplarSampler.class
io/prometheus/client/exemplars/HistogramExemplarSampler.class
io/prometheus/client/exemplars/Tracer.class
META-INF/maven/io.prometheus/simpleclient_tracer_otel/
META-INF/maven/io.prometheus/simpleclient_tracer_otel/pom.properties
META-INF/maven/io.prometheus/simpleclient_tracer_otel/pom.xml
io/prometheus/client/exemplars/tracer/
io/prometheus/client/exemplars/tracer/otel/
io/prometheus/client/exemplars/tracer/otel/OpenTelemetrySpanContextSupplier.class
META-INF/maven/io.prometheus/simpleclient_tracer_common/
META-INF/maven/io.prometheus/simpleclient_tracer_common/pom.properties
META-INF/maven/io.prometheus/simpleclient_tracer_common/pom.xml
io/prometheus/client/exemplars/tracer/common/
io/prometheus/client/exemplars/tracer/common/SpanContextSupplier.class
META-INF/maven/io.prometheus/simpleclient_tracer_otel_agent/
META-INF/maven/io.prometheus/simpleclient_tracer_otel_agent/pom.properties
META-INF/maven/io.prometheus/simpleclient_tracer_otel_agent/pom.xml
io/prometheus/client/exemplars/tracer/otel_agent/
io/prometheus/client/exemplars/tracer/otel_agent/OpenTelemetryAgentSpanContextSupplier.class
META-INF/maven/io.prometheus/simpleclient_hotspot/
META-INF/maven/io.prometheus/simpleclient_hotspot/pom.properties
META-INF/maven/io.prometheus/simpleclient_hotspot/pom.xml
io/prometheus/client/hotspot/
io/prometheus/client/hotspot/BufferPoolsExports.class
io/prometheus/client/hotspot/ClassLoadingExports.class
io/prometheus/client/hotspot/DefaultExports.class
io/prometheus/client/hotspot/GarbageCollectorExports.class
io/prometheus/client/hotspot/MemoryAllocationExports$AllocationCountingNotificationListener.class
io/prometheus/client/hotspot/MemoryAllocationExports.class
io/prometheus/client/hotspot/MemoryPoolsExports.class
io/prometheus/client/hotspot/StandardExports$StatusReader.class
io/prometheus/client/hotspot/StandardExports.class
io/prometheus/client/hotspot/ThreadExports.class
io/prometheus/client/hotspot/VersionInfoExports.class
META-INF/maven/io.prometheus/simpleclient_httpserver/
META-INF/maven/io.prometheus/simpleclient_httpserver/pom.properties
META-INF/maven/io.prometheus/simpleclient_httpserver/pom.xml
io/prometheus/client/exporter/
io/prometheus/client/exporter/HTTPServer$1.class
io/prometheus/client/exporter/HTTPServer$Builder.class
io/prometheus/client/exporter/HTTPServer$HTTPMetricHandler.class
io/prometheus/client/exporter/HTTPServer$LocalByteArray.class
io/prometheus/client/exporter/HTTPServer$NamedDaemonThreadFactory.class
io/prometheus/client/exporter/HTTPServer.class
io/prometheus/client/exporter/SampleNameFilterSupplier.class
META-INF/maven/io.prometheus/simpleclient_common/
META-INF/maven/io.prometheus/simpleclient_common/pom.properties
META-INF/maven/io.prometheus/simpleclient_common/pom.xml
io/prometheus/client/exporter/common/
io/prometheus/client/exporter/common/TextFormat$1.class
io/prometheus/client/exporter/common/TextFormat.class

This is the assembly.xml file:

          xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
          xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.2 http://maven.apache.org/xsd/assembly-1.1.2.xsd">
    <id>zip</id>
    <includeBaseDirectory>true</includeBaseDirectory>

    <formats>
        <format>tar.gz</format>
        <format>zip</format>
        <format>dir</format>
    </formats>
    <fileSets>
        <fileSet>
            <directory>${project.basedir}</directory>
            <includes>
                <include>README*</include>
                <include>LICENSE*</include>
            </includes>
            <fileMode>0644</fileMode>
        </fileSet>
    </fileSets>
    <dependencySets>
        <dependencySet>
            <scope>runtime</scope>
            <outputDirectory>libs</outputDirectory>
            <fileMode>0644</fileMode>
            <outputFileNameMapping>${artifact.groupId}.${artifact.artifactId}-${artifact.version}${dashClassifier?}.${artifact.extension}</outputFileNameMapping>
        </dependencySet>
    </dependencySets>
</assembly>

@mimaison
Copy link
Contributor

That looks about right. Can you open a PR so we can take a look?

@mimaison
Copy link
Contributor

Fixed in #27, closing

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants