Git Product home page Git Product logo

Comments (11)

paulosuzart avatar paulosuzart commented on June 19, 2024 8

I get

[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade (default) 
on project syi-platform: Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:3.1.0:shade for parameter resource: Cannot find 'resource' in class 
com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer -> [Help 1]

Using whatever version of shade. Not sure if it is related. Any ideas?

from maven-shaded-log4j-transformer.

vdsysvd avatar vdsysvd commented on June 19, 2024 5

I solved the same issue adding the id tag inside the execution section
<executions> <execution> <id>shade-jar</id> <phase>package</phase> <goals> <goal>shade</goal>....

from maven-shaded-log4j-transformer.

nmichalares avatar nmichalares commented on June 19, 2024 2

May not be the right spot for this, but I was led here with the same error as what's mentioned above:
Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:3.2.0:shade for parameter resource: Cannot find 'resource' in class com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer

I am seeing this error pop up when I bring in spring boot parent.

<parent>
    <groupId>org.springframework.boot</groupId>
    <artifactId>spring-boot-starter-parent</artifactId>
    <version>2.1.0.RELEASE</version>
    <relativePath /> <!-- lookup parent from repository -->
</parent>

<dependencies>
    <dependency>
            <groupId>com.amazonaws</groupId>
            <artifactId>aws-lambda-java-log4j2</artifactId>
            <version>1.1.0</version>
        </dependency>
        <dependency>
            <groupId>org.springframework.cloud</groupId>
            <artifactId>spring-cloud-function-adapter-aws</artifactId>
            <version>2.0.0.BUILD-SNAPSHOT</version>
        </dependency>
    </dependencies>
<dependencies>

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>org.springframework.cloud</groupId>
                <artifactId>spring-cloud-function-dependencies</artifactId>
                <version>2.0.0.BUILD-SNAPSHOT</version>
                <type>pom</type>
                <scope>import</scope>
            </dependency>
        </dependencies>
    </dependencyManagement>

<build>
        <plugins>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-shade-plugin</artifactId>
                <version>3.2.0</version>
                <configuration>
                    <createDependencyReducedPom>false</createDependencyReducedPom>
                    <shadedArtifactAttached>true</shadedArtifactAttached>
                </configuration>
                <executions>
                    <execution>
                        <phase>package</phase>
                        <goals>
                            <goal>shade</goal>
                        </goals>
                        <configuration>
                            <transformers>
                                <transformer
                                        implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer">
                                </transformer>
                            </transformers>
                        </configuration>
                    </execution>
                </executions>
                <dependencies>
                    <dependency>
                        <groupId>com.github.edwgiz</groupId>
                        <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
                        <version>2.8.1</version>
                    </dependency>
                </dependencies>
            </plugin>
            <plugin>
                <groupId>org.apache.maven.plugins</groupId>
                <artifactId>maven-deploy-plugin</artifactId>
                <configuration>
                    <skip>true</skip>
                </configuration>
            </plugin>
            <plugin>
                <groupId>org.springframework.boot</groupId>
                <artifactId>spring-boot-maven-plugin</artifactId>
                <configuration>
                    <mainClass>ACTUAL_MAIN_CLASS</mainClass>
                </configuration>
                <dependencies>
                    <dependency>
                        <groupId>org.springframework.boot.experimental</groupId>
                        <artifactId>spring-boot-thin-layout</artifactId>
                        <version>1.0.17.RELEASE</version>
                    </dependency>
                </dependencies>
            </plugin>
        </plugins>
    </build>

from maven-shaded-log4j-transformer.

PyvesB avatar PyvesB commented on June 19, 2024

@paulosuzart what does you pom.xml look like?

from maven-shaded-log4j-transformer.

mrosner17 avatar mrosner17 commented on June 19, 2024

@PyvesB I think I am seeing the same issue as paulosuzart.
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade (default) on project promoscombos: Unable to parse configuration of mojo org.apache.maven.plugins:maven-shade-plugin:2.4.3:shade for parameter resource: Cannot find 'resource' in class com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer -> [Help 1]
Here is what I have in my pom.xml:

<?xml version="1.0" encoding="UTF-8"?>
<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/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
	<dependency>
		<groupId>com.amazonaws</groupId>
		<artifactId>aws-lambda-java-log4j2</artifactId>
		<version>1.0.0</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-api</artifactId>
		<version>2.8.1</version>
	</dependency>
	<dependency>
		<groupId>org.apache.logging.log4j</groupId>
		<artifactId>log4j-core</artifactId>
		<version>2.8.1</version>
	</dependency>

      <plugins>
        <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-shade-plugin</artifactId>
            <version>2.4.3</version>
            <configuration>
                <createDependencyReducedPom>false</createDependencyReducedPom>
            </configuration>
            <executions>
                <execution>
                    <phase>package</phase>
                    <goals>
                        <goal>shade</goal>
                    </goals>
                    <configuration>
                    	<transformers>
				            <transformer implementation="com.github.edwgiz.mavenShadePlugin.log4j2CacheTransformer.PluginsCacheFileTransformer">
				            </transformer>
				          </transformers>
                        <artifactSet>
                            <excludes>
                                <exclude>org.apache.tomcat.embed:*</exclude>
                            </excludes>      
                        </artifactSet>
                    </configuration>
                    
                </execution>
            </executions>
            <dependencies>
		      <dependency>
		        <groupId>com.github.edwgiz</groupId>
		        <artifactId>maven-shade-plugin.log4j2-cachefile-transformer</artifactId>
		        <version>2.8.1</version>
		      </dependency>
		    </dependencies>
        </plugin>
    </plugins>

from maven-shaded-log4j-transformer.

ncremaschini avatar ncremaschini commented on June 19, 2024

updates about this?

from maven-shaded-log4j-transformer.

mrosner17 avatar mrosner17 commented on June 19, 2024

I got around it by using SLF4J. Still have bugs, but at least I am getting something to log to Cloudwatch.

from maven-shaded-log4j-transformer.

Ghilteras avatar Ghilteras commented on June 19, 2024

Got into this as well, looks like I cannot use aws-lambda-java-libs with shade

from maven-shaded-log4j-transformer.

MarkusKramer avatar MarkusKramer commented on June 19, 2024

For me, the issue was caused by having a parent pom. Removing the parent solved it for me.

from maven-shaded-log4j-transformer.

NicholasPurdy avatar NicholasPurdy commented on June 19, 2024

@ncremaschini I too am trying to get the custom AWS lambda appender to work with Spring Boot. For now, I am using a Logback configuration that can log stack traces as a single CloudWatch event. You can find it on my GitHub page.

from maven-shaded-log4j-transformer.

kkishoreathena avatar kkishoreathena commented on June 19, 2024

@vdsysvd could you throw some light on why this worked?

from maven-shaded-log4j-transformer.

Related Issues (6)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.