Skip to content

Build failed - Could not find artifact com.sun:tools:jar #320

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

Closed
gyoga99 opened this issue Mar 10, 2021 · 9 comments
Closed

Build failed - Could not find artifact com.sun:tools:jar #320

gyoga99 opened this issue Mar 10, 2021 · 9 comments

Comments

@gyoga99
Copy link

gyoga99 commented Mar 10, 2021

I added mvn plugin and dependencies as documented here.

https://awslabs.github.io/aws-lambda-powertools-java/utilities/sqs_large_message_handling/

I am using AdoptOpenJDK (build 11.0.8+10)

I am getting this error when I run mvn package

Execution default of goal org.codehaus.mojo:aspectj-maven-plugin:1.11:compile failed: Plugin org.codehaus.mojo:aspectj-maven-plugin:1.11 or one of its dependencies could not be resolved: Could not find artifact com.sun:tools:jar:11.0.8 at specified path

Can you please let me know if there is anything else I need to do?

@pankajagrawal16
Copy link
Contributor

Hi @gyoga99 I believe this is because of already referenced issue #50

Try using plugin as documented in issue.

                 <groupId>com.nickwongdev</groupId>
                <artifactId>aspectj-maven-plugin</artifactId>
                <version>1.12.1</version>

instead of


            <groupId>org.codehaus.mojo</groupId>
             <artifactId>aspectj-maven-plugin</artifactId>
             <version>1.11</version>

This is also reference in our docs here https://awslabs.github.io/aws-lambda-powertools-java/#install, but I do see that we can probably improve the docs to make it more explicit for all the utilities installation instructions well.

Let me know if this fixes your issue?

@gyoga99
Copy link
Author

gyoga99 commented Mar 11, 2021

Thanks @pankajagrawal16!
That issue got resolved now.
When I running my unit test class. I am seeing java.lang.NoClassDefFoundError for SqsLargeMessageAspect.class
Dependencies added in pom.xml-

software.amazon.lambda
powertools-sqs
1.3.0


com.amazonaws
amazon-sqs-java-extended-client-lib
1.1.0

@pankajagrawal16
Copy link
Contributor

Thanks @pankajagrawal16!
That issue got resolved now.
When I running my unit test class. I am seeing java.lang.NoClassDefFoundError for SqsLargeMessageAspect.class
Dependencies added in pom.xml-

software.amazon.lambda
powertools-sqs
1.3.0

com.amazonaws
amazon-sqs-java-extended-client-lib
1.1.0

Hmm this is Strange, What does you pom.xml looks like? Possible to share here ?

@gyoga99
Copy link
Author

gyoga99 commented Mar 11, 2021

I see this warning during mvn clean package

[INFO] Showing AJC message detail for messages of types: [error, warning, fail]
[WARNING] bad version number found in /.m2/repository/org/aspectj/aspectjrt/1.9.6/aspectjrt-1.9.6.jar expected 1.9.2 found 1.9.6
        <unknown source file>:<no line information>

[WARNING] advice defined in software.amazon.lambda.powertools.sqs.internal.SqsMessageBatchProcessorAspect has not been applied [Xlint:adviceDidNotMatch]
        /.m2/repository/software/amazon/lambda/powertools-sqs/1.3.0/powertools-sqs-1.3.0.jar!software/amazon/lambda/powertools/sqs/internal/SqsMessageBatchProcessorAspect.class:0 

pom.xml entries related to SQS Large message processing.

<plugin>
        <groupId>com.nickwongdev</groupId>
        <artifactId>aspectj-maven-plugin</artifactId>
        <version>1.12.1</version>
        <configuration>
          <source>1.8</source>
          <target>1.8</target>
          <complianceLevel>1.8</complianceLevel>
          <aspectLibraries>
            <aspectLibrary>
              <groupId>software.amazon.lambda</groupId>
              <artifactId>powertools-sqs</artifactId>
            </aspectLibrary>
          </aspectLibraries>
        </configuration>
        <executions>
          <execution>
            <goals>
              <goal>compile</goal>
            </goals>
          </execution>
        </executions>
      </plugin>

<dependency>
      <groupId>software.amazon.lambda</groupId>
      <artifactId>powertools-sqs</artifactId>
      <version>1.3.0</version>
    </dependency>
    <dependency>
      <groupId>com.amazonaws</groupId>
      <artifactId>amazon-sqs-java-extended-client-lib</artifactId>
      <version>1.1.0</version>
    </dependency>

@pankajagrawal16
Copy link
Contributor

Hi @gyoga99

Did you manage to solve this? You pom entries looks correct. Also the warning that you are seeing is strange, coz this should have worked.

Since this warning seems to be coming from your unit test, can you try adding below test scoped dependency to your pom as well ?

 <dependency>
            <groupId>org.aspectj</groupId>
            <artifactId>aspectjweaver</artifactId>
            <scope>test</scope>
        </dependency>

@pankajagrawal16
Copy link
Contributor

Hi @gyoga99

Did you manage to solve this?

@pankajagrawal16
Copy link
Contributor

Hi @gyoga99,

Wondering if the issue is solved now?

@gyoga99
Copy link
Author

gyoga99 commented May 31, 2021

@pankajagrawal16 I have not tried this. Will try and update you.

@gyoga99
Copy link
Author

gyoga99 commented May 31, 2021

Resolved this error. The issue was with mocking.

Thanks!

@gyoga99 gyoga99 closed this as completed May 31, 2021
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

2 participants