Skip to content

Commit

Permalink
build: work in progress
Browse files Browse the repository at this point in the history
  • Loading branch information
khalilou88 committed Oct 16, 2024
1 parent 84fabd6 commit 0e3472a
Show file tree
Hide file tree
Showing 19 changed files with 45 additions and 17 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<properties>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<properties>
<packaging>jar</packaging>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<repositories>
<repository>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<properties>
<maven.compiler.source>${java.version}</maven.compiler.source>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<properties>
<skipITs>true</skipITs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<properties>
<skipITs>true</skipITs>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,12 +8,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<dependencies>
<dependency>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,14 @@
<name><%= projectName %></name>
<description>This project was generated with nx-maven</description>

<% if(parentProject) { -%>
<parent>
<groupId><%= parentGroupId %></groupId>
<artifactId><%= parentProjectName %></artifactId>
<version><%= parentProjectVersion %></version>
<relativePath><%= relativePath %></relativePath>
</parent>
<% } -%>

<% if(framework === 'spring-boot') { -%>
<properties>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@
},
"parentProject": {
"type": "string",
"description": "ArtifactId of the parent project, or leave it blank for the root project"
"description": "ArtifactId of the parent project"
},
"aggregatorProject": {
"type": "string",
Expand Down
26 changes: 10 additions & 16 deletions packages/nx-maven/src/utils/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -511,25 +511,19 @@ export function getParentProjectValues(
projectRoot: string,
parentProject: string,
) {
let pomXmlContent;
let parentProjectRoot;
if (!parentProject) {
parentProjectRoot = mavenRootDirectory;
pomXmlContent = readXmlTree(
tree,
joinPathFragments(parentProjectRoot, 'pom.xml'),
);
} else {
parentProjectRoot = getProjectRootFromTree(
tree,
mavenRootDirectory,
parentProject,
);
return ['', '', '', ''];
}

const parentProjectPomPath = path.join(parentProjectRoot, 'pom.xml');
const parentProjectRoot = getProjectRootFromTree(
tree,
mavenRootDirectory,
parentProject,
);

pomXmlContent = readXmlTree(tree, parentProjectPomPath);
}
const parentProjectPomPath = path.join(parentProjectRoot, 'pom.xml');

const pomXmlContent = readXmlTree(tree, parentProjectPomPath);

const relativePath = joinPathFragments(
path.relative(projectRoot, parentProjectRoot),
Expand Down

0 comments on commit 0e3472a

Please sign in to comment.