We are upgrading project from Java 8 to Java 11, and facing the below error:
The package javax.xml.namespace is accessible from more than one module: <unnamed>, java.xml
Apparently, this is due to same package which is existing in another jar file is creating a problem. In order to fix this issue, we have excluded the jar time temporarily and it is working fine.
Is there a way that we can ignore this error without removing the transient dependencies. Since we have 200+ services and excluding from each service is a mammoth effort.
My pom.xml as below:
<?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/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.xyz</groupId>
<artifactId>test</artifactId>
<version>1.0.0</version>
<packaging>jar</packaging>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.3.3.RELEASE</version>
</parent>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<project.reporting.outputEncoding>UTF-8</project.reporting.outputEncoding>
<mule.version>3.9.0</mule.version>
<mule.tools.version>1.2</mule.tools.version>
<apikit.version>3.9.0</apikit.version>
<munit.version>1.1.0</munit.version>
<mule.munit.support.version>3.7.1</mule.munit.support.version>
<java.version>11</java.version>
<junit.version>4.9</junit.version>
<jackson.version>2.8.5</jackson.version>
<httpcore.version>4.4.5</httpcore.version>
<spring.version>4.3.2.RELEASE</spring.version>
</properties>
<build>
<finalName>somename</finalName>
</build>
</project>
Related
I am using newest eclipse. I am very disappointed, after so many years, maven support in eclipse is far from perfect.
here is my pom:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>org.codingfarm.fwx</groupId>
<artifactId>fwx-parent</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<artifactId>fwx-sea</artifactId>
<packaging>pom</packaging>
<name>fwx-sea</name>
<description>Framework X Smart Entity API</description>
<modules>
<module>fwx-sea-api</module>
<module>fwx-sea-impl-mybatis</module>
</modules>
</project>
and eclipse complains this:
Non-parseable POM /home/ggfan/2-work/fwx-space/fwx-parent/fwx-sea/pom.xml: end tag name </modulefwx> must match start tag name <modules> from line 12 (position: END_TAG seen ...<module></module></modulefwx\n... #14:1)
It seems fine, I excluded the parent and tried on local. Cleaning project probably will fix it.
I'm having an issue where maven is not properly substituting properties into my repository URLs if and only if there is a parent pom defined. This is particularly a problem because the parent pom is IN the remote repository, so I need to have the parent pom defined.
minimum reproducible example:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.group</groupId>
<artifactId>parent-artifact</artifactId>
<version>1.0.0</version>
<relativePath/>
</parent>
<groupId>com.group</groupId>
<artifactId>project-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>project</name>
<description>test project</description>
<properties>
<nexus.url>https://nexus.myorganization.net</nexus.url>
</properties>
<repositories>
<repository>
<id>nexus-server</id>
<url>${nexus.url}/repository/maven-releases/</url>
</repository>
</repositories>
</project>
Using this pom, I get the error message Cannot access ${nexus.url}/repository/maven-snapshots/... so clearly it is not replacing the property with the actual value.
If I remove the <parent> section of the POM, then suddenly property substitution begins working just fine:
<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 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<groupId>com.group</groupId>
<artifactId>project-artifact</artifactId>
<version>1.0.0-SNAPSHOT</version>
<name>project</name>
<description>test project</description>
<properties>
<nexus.url>https://nexus.myorganization.net</nexus.url>
</properties>
<repositories>
<repository>
<id>nexus-server</id>
<url>${nexus.url}/repository/maven-releases/</url>
</repository>
</repositories>
<!-- adding this dependency so that Maven is forced to download from the repository -->
<dependencies>
<!-- some dependency here -->
</dependencies>
</project>
I know its working properly because I can see in maven's output the line Downloading from nexus-server: https://nexus.myorganization.net/repository/maven-releases/...
Any ideas?
Thanks to the commenters, the reason is because the property resolution does not occur until after the parent pom has been resolved, so that there are no property conflicts between current pom and parent pom.
More details provided at tickets MNG-2569 and MNG-624 (source).
I think you have a wrong tag in the definition of the parent.
Why is there a relativePath tag?
just remove the tag:
and try it again
I have a Spring Boot Multi Module Project (up vote a basic SpringBoot app. using Spring Initializer, embedded Tomcat, Thymeleaf template engine)
Here the pom of the parent application:
<?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>
<parent>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>1.5.3.RELEASE</version>
<relativePath /> <!-- lookup parent from repository -->
</parent>
<groupId>com.tdk-cloud</groupId>
<artifactId>tdk-cloud</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>pom</packaging>
<modules>
<module>tdk-core</module>
<module>tdk-batch</module>
<module>tdk-web</module>
</modules>
..
Here 1 of the libraries:
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tdk-cloud</groupId>
<artifactId>tdk-cloud</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.tdk.core</groupId>
<artifactId>tdk-core</artifactId>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
...
and here another module
<?xml version="1.0"?>
<project xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd" xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.tdk-cloud</groupId>
<artifactId>tdk-cloud</artifactId>
<version>0.0.1-SNAPSHOT</version>
</parent>
<groupId>com.tdk.web</groupId>
<artifactId>tdk-web</artifactId>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<java.version>1.8</java.version>
</properties>
<dependencies>
<dependency>
<groupId>com.tdk.core</groupId>
<artifactId>tdk-core</artifactId>
<version>0.0.1-SNAPSHOT</version>
</dependency>
...
But when I run mvn spring-boot:run in the com.tdk.web module I got this error:
[ERROR] Failed to execute goal on project tdk-web: Could not resolve dependencies for project com.tdkcloud.web:tdk-web:jar:0.0.1-SNAPSHOT: Could not find artifact com.tdkcloud.core:tdk-core:jar:0.0.1-SNAPSHOT -> [Help 1]
Error clearly says
Could not find artifact com.tdkcloud.core:tdk-core:jar:0.0.1-SNAPSHOT
first build tdk-core module, to make it available in your maven repo.
after that build tdk-web module.
I am doing a Maven project with Intellj Idea in which I am trying to use neo4j.
I have an error of "unable resolve symbol neo4j" on (import org.neo4j.driver.v1.*;).
I have brought in the neo4j jar files to the project and believe I have a correctly set up pom file. I will post both though with this question below.
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>com.example</groupId>
<artifactId>NeoImport</artifactId>
<version>0.0.1-SNAPSHOT</version>
<packaging>jar</packaging>
<name>NeoImport</name>
<description>Import</description>
<dependencies>
<dependency>
<groupId>org.neo4j.driver</groupId>
<artifactId>neo4j-java-driver</artifactId>
<version>1.0.3</version>
</dependency>
</dependencies>
<build>
<defaultGoal>install</defaultGoal>
</build>
</project>
Project Setup:
Thanks!
Hi I'm working on project which created in netbeans 8.0.1.
It is created in Maven.Now after completion when try to open created jar its not getting executed.
below is the pom.xml file.
Please advise.
<?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>com.elitechweb.asm</groupId>
<artifactId>Test</artifactId>
<version>1.0-SNAPSHOT</version>
<packaging>jar</packaging>
<properties>
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
<maven.compiler.source>1.7</maven.compiler.source>
<maven.compiler.target>1.7</maven.compiler.target>
</properties>
<build>
</build>
</project>
Added maven-install-plugin-2.3.1 jar file. and changes in POM.xml respective jar