I'm working on a project with a parent maven module that contains no sources and 4 child modules.
It's supposed to be a Spring Application, the class having SpringApplication.run(XXX.class, args); is in a child module.
As I work with intelliJ community I don't have the spring plugin that could help me launch easely the application.
If I clean install the project everything builds correctly.
To start the application i try to right click on the class booting Spring and then click on run.
As intelliJ tries to build the app i get the following message :
Failed to execute goal on project XXX : Could not resolve dependencies
for project XXX:XXX:jar:0.0.28: Failed to collect dependencies at
XXX:XXX:jar:0.0.28: Failed to read artifact descriptor for
XXX:jar:0.0.28: Could not transfer artifact XXX:YYY:pom:${ZZZ_version_module} from/to
releases (http://nexus...): Authorization failed for
http://nexus.../.../.../$%257BZZZ_version_module%257D/...-$%257BZZZ_version_module%257D.pom
403 Forbidden
From what i understand the problem is that when building, intelliJ only build the child module, so it cannot turn the variablized version in my pom.xml ${ZZZ_version_module} into the right version using properties from the parent pom.
Because of my work, I cannot use any plugin in intelliJ or any other dependency in my pom that could help me.
Do any one have any solution to run the SpringApplication ?
Parent pom.xml
<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.springframework.boot</groupId>
<artifactId>spring-boot-starter-parent</artifactId>
<version>2.4.3</version>
</parent>
<groupId>ABC</groupId>
<artifactId>XYZ</artifactId>
<version>${ZZZ_version_module}</version>
<packaging>pom</packaging>
<name>...</name>
<description>...</description>
<properties>
<ZZZ_version_module>0.0.28</ZZZ_version_module>
...
</properties>
</project>
Child pom.xml :
<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>ABC</groupId>
<artifactId>XYZ</artifactId>
<version>${ZZZ_version_module}</version>
</parent>
<artifactId>...</artifactId>
<name>...</name>
<description>...</description>
</project>
(Sorry for the broken english)
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.
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>
I am working on spring boot application(with rest calls included) and i want to host it on heroku. Application works perfectly in my local machine.
Below is the Project Structure
.git
foldera
|
Mainclass
Pom.xml
folderb
|
other javacode
pom.xml
folderc
|
other javacode
pom.xml
Pom.xml(within root folder)
pom.xml of root folder is shown below
<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>2.1.1.RELEASE</version>
</parent>
<groupId>root</groupId>
<artifactId>pomroot</artifactId>
<version>0.0.1-SNAPSHOT</version>
<name>Server Spring Boot</name>
<description>Spring boot server for svmapp</description>
<properties>
<java.version>1.8</java.version>
</properties>
<modules>
<module>./foldera</module>
</modules>
</project>
I am using ./foldera to refer to subfolder using module tag. but this is not working.
All the folders are maven folders and added to the classpath. Now what i need is that from parent folder i want to refer to the Pom.xml of folder a.
How to achieve this?
I have a question about my maven configuration on my MAC Intellij. I get an error that ${a-web.version} "properties in parent definition are prohibited" within parent tag in child POM.xml and that properties is defined in parent POM.xml.
But this same configuration works well on my Windows Intellij.
Below is my parent POM.xml.
<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>***</groupId>
<artifactId>a-web</artifactId>
<packaging>pom</packaging>
<version>${a-web.version}</version>
<name>a-web project</name>
<url>http://***</url>
<properties>
<a-web.version>1.0.0</a-web.version>
</properties>
<modules>
<module>a-core</module>
<module>a-web</module>
</modules>
</project>
And this is my child POM.xml that configure a parent block.
<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>
<parent>
<artifactId>a-web</artifactId>
<groupId>***</groupId>
<version>${a-web.version}</version>
<relativePath>../</relativePath>
</parent>
<artifactId>aweb-web</artifactId>
<version>${a-web.version}</version>
<packaging>war</packaging>
<name>aweb-web</name>
</project>
I've tried many methods from stackoverflow, but no one can fix it. I want to know why this Maven config have different behaviour in Mac and windows and how to fix it.
I have run into a very similar situation when the project started using parent version properties in the commit I have just pulled. The project would not build and felt "ill-imported". An attempt to show effective pom failed with no details presented by IDEA.
As #khmarbaise pointed out in the comments[1], there are some restrictions for properties usage in maven <parent> declarations - the most notable is maven 3.5+ is required. The IDEA might not be using maven new enough (the bundled one in the latest IDEA I have installed was too old) so I had to switch to local install using Settings > Build, Execution, Deployment > Build Tools > Maven > Maven Home Directory. Once pointed to newer version, it did not start to work immediately - some of the restart/rebuild/reimport routines caused the new setting to be effective and the project to successfully import and build again.
Despite the maven version requirement was enforced in pom, it have not caused IDEA to complain the maven version it uses is old. The lack of any details that IDEA fails to inspect the project with the maven it uses did not helped either. Now when everything else works, it still says "Properties in parent definition are prohibited" in pom files.
[1] https://maven.apache.org/maven-ci-friendly.html
Setting property revision in parent pom.xml and then inherit it into children, fixed the issue for me.
<groupId>com.java</groupId>
<artifactId>test</artifactId>
<version>${revision}</version>
<packaging>pom</packaging>
<name>Test</name>
<description>Demo project for Spring Boot</description>
<modules>
<module>backend</module>
<module>frontend</module>
</modules>
<properties>
<revision>1.0.0-SNAPSHOT</revision>
</properties>
In the child's pom.xml:
<parent>
<artifactId>com.java</artifactId>
<groupId>test</groupId>
<version>${revision}</version>
</parent>
<artifactId>backend</artifactId>
I use Maven 3.6.1
Work for me in Idea 18.2:
1) Don't use embeded Maven. Install Maven from official site! It's help me (^_^)
2) You can try to add groupId in child pom, put <groupId>com.iqiyi.lego.web</groupId> before line <artifactId>legoweb-web</artifactId>.
Try this code:
<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>
<parent>
<artifactId>lego-web</artifactId>
<groupId>com.iqiyi.lego.web</groupId>
<version>${lego-web.version}</version>
<relativePath>../</relativePath>
</parent>
**<groupId>com.iqiyi.lego.web</groupId>**
<artifactId>legoweb-web</artifactId>
<version>${lego-web.version}</version>
<packaging>war</packaging>
<name>legoweb-web</name>
</project>
because your maven version is lower than 3.5.2, try to use version that >=3.5.2,when the ide intellij idea bundled maven version is lower than 3.5.2,try to download zip set to use your own maven instead of the bundled one.
by the way,although maven lower than 3.5.2 show error in intellij idea,but it works ok,you can "mvn package" success.
I think it's because when you push the compiled jar to central maven or private maven such as nexus, you can find the version in META-INF/maven/xxxxx/pom.xml of sub project is
<version>${lego-web.version}</version>
not real value <version>1.0.0</version>.so when you want to release a single jar, you cannot get the true version
It is the IntelliJ IDEA bug.
At least in the IntelliJ IDEA 2019.2 (Ultimate Edition)
Build #IU-192.5728.98, built on July 23, 2019