Getting issue "Cannot resolve com.sun:tools:1.4.2" when first building maven template
hungdao-testing opened this issue · comments
When first pulling and resolve dependency by maven, I got error
Cannot resolve com.sun:tools:1.4.2
Here is my local machine configuration
Apache Maven 3.8.1
Maven home: /usr/local/Cellar/maven/3.8.1/libexec
Java version: 11.0.9.1, vendor: AdoptOpenJDK, runtime: /Library/Java/JavaVirtualMachines/adoptopenjdk-11.jdk/Contents/Home
Try to add exclusion for cubano dependency to fix. Not sure this is good approach to do it or not
<dependency>
<groupId>org.concordion</groupId>
<artifactId>cubano-concordion</artifactId>
<version>1.1.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>com.sun</groupId>
</exclusion>
</exclusions>
</dependency>
For more details, this is my full POM
<?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>org.concordion</groupId>
<artifactId>cubano-template</artifactId>
<version>1.0</version>
<description>A framework to kickstart your Concordion project</description>
<name>Cubano Template</name>
<url>https://github.com/concordion/cubano-template</url>
<issueManagement>
<system>Github</system>
<url>https://github.com/concordion/cubano-template/issues</url>
</issueManagement>
<licenses>
<license>
<name>The Apache Software License, Version 2.0</name>
<url>http://www.apache.org/licenses/LICENSE-2.0.html</url>
<distribution>repo</distribution>
</license>
</licenses>
<scm>
<url>https://github.com/concordion/cubano-template.git</url>
<developerConnection>git@github.com:concordion/cubano-template.git</developerConnection>
</scm>
<dependencies>
<dependency>
<groupId>org.concordion</groupId>
<artifactId>cubano-concordion</artifactId>
<version>1.1.0</version>
<scope>test</scope>
<exclusions>
<exclusion>
<artifactId>tools</artifactId>
<groupId>com.sun</groupId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.hamcrest</groupId>
<artifactId>hamcrest-junit</artifactId>
<version>2.0.0.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.google.guava</groupId>
<artifactId>guava</artifactId>
<version>30.1.1-jre</version>
<scope>test</scope>
</dependency>
</dependencies>
<build>
<plugins>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.8.1</version>
<configuration>
<source>1.8</source>
<target>1.8</target>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-surefire-plugin</artifactId>
<version>2.22.2</version>
<configuration>
<systemPropertyVariables>
<concordion.output.dir>target/concordion</concordion.output.dir>
</systemPropertyVariables>
<includes>
<include>**/Example.java</include>
</includes>
</configuration>
</plugin>
</plugins>
</build>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
</properties>
</project>
Caused by MarkusBernhardt/proxy-vole#48, Fixed by adding javadelight-nashorn-sandbox
to pom.xml. See javadelight/delight-nashorn-sandbox#62.