Dependency 'org.aspectj:aspectjweaver:1.9.5' not found - Allure/Java 11/Compilation error

2,953 views
Skip to first unread message

garvita girotra

unread,
Aug 10, 2020, 3:09:54 AM8/10/20
to Selenium Users
Hi,

I switched to Java 11 from Java 8. Earlier i was using aspectj version 1.8.10 which does not support Java 11, so i updated it to 1.9.5.

I am getting compile error that Dependency 'org.aspectj:aspectjweaver:1.9.5' not found in pom.xml.

Here is my pom.xml:

Enter cod<?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>

<groupId>project</groupId>
<artifactId>tests</artifactId>
<version>0.1-SNAPSHOT</version>
<properties>
<aspectj.version>1.9.5</aspectj.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>
<dependencies>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-testng</artifactId>
<version>2.7.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testng</groupId>
<artifactId>testng</artifactId>
<version>6.14.3</version>
</dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-java</artifactId>
<version>3.11.0</version>
</dependency>
<dependency>
<dependency>
<groupId>org.seleniumhq.selenium</groupId>
<artifactId>selenium-server</artifactId>
<version>3.11.0</version>
</dependency>
<dependency>
<groupId>io.qameta.allure</groupId>
<artifactId>allure-java-commons</artifactId>
<version>2.7.0</version>
</dependency>
</dependencies>

<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<release>11</release>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>3.0.0-M1</version>
<configuration>
<useSystemClassLoader>false</useSystemClassLoader>
<argLine>
-javaagent:"${settings.localRepository}/org/aspectj/aspectjweaver/${aspectj.version}/aspectjweaver-${aspectj.version}.jar"
</argLine>
<suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
<version>${aspectj.version}</version> // Here i get error dependency 1.9.5 not found
</dependency>
</dependencies>
</plugin>
</plugins>
</build>
</project>
.
Any help is appreciated. Thanks !!



Ankit Mundra

unread,
Aug 11, 2020, 12:42:01 AM8/11/20
to Selenium Users
Hi

I think your pom.xml seems to be incorrect. You have created a dependencies tag inside plugins block. Whereas it is expecting the aspectj in the main dependencies tag just after the properties. Try to move the dependency to the project dependency instead of the plugin dependency. And check if that works.

⇜Krishnan Mahadevan⇝

unread,
Aug 11, 2020, 1:35:33 AM8/11/20
to Selenium Users
Ankit,

That dependency is fine. Allure relies on AspectJ to be included as a JavaAgent to be able to extract out data, because allure employs Aspect Oriented Programming approach to retrieve data from its custom annotations.

Garvita,
It's not clear as to what is the error you are seeing.

What happens when you run mvn dependency:resolve and when you run mvn dependency:resolve-plugins ?


Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c9dc0134-51a9-45fd-80cf-bcc7d26bafe0n%40googlegroups.com.

garvita girotra

unread,
Sep 13, 2020, 7:21:22 AM9/13/20
to Selenium Users
Hi Krishnan,

When i set version 1.9.5 here, 
<properties>
<aspectj.version>1.9.5</aspectj.version>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
</properties>

Then i get this :

</systemPropertyVariables>
                <suiteXmlFiles>
<suiteXmlFile>testng.xml</suiteXmlFile>
</suiteXmlFiles>
</configuration>
<dependencies>
<dependency>
<groupId>org.aspectj</groupId>
<artifactId>aspectjweaver</artifactId>
                    <version>${aspectj.version}</version>  // this comes red.
                </dependency>
</dependencies>
</plugin>
</plugins>
</build>

${aspectj.version} is red for aspectjweaver. When i mousehover, it says Dependency 'org.aspectj:aspectjweaver:1.9.5' not found . Same is for version 1.9.2, 1.9.3, 1.9.4.
To unsubscribe from this group and stop receiving emails from it, send an email to seleniu...@googlegroups.com.

⇜Krishnan Mahadevan⇝

unread,
Sep 15, 2020, 5:25:16 AM9/15/20
to Selenium Users
Thats just the intellij error. Can be ignored if your overall maven dependency is working fine from the command prompt.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribblings @ https://rationaleemotions.com/

To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/8a10bee1-f523-47a0-a494-5255e0e60112o%40googlegroups.com.
Reply all
Reply to author
Forward
0 new messages