Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MSHARED-1367] Improvement in unit tests #56

Merged
merged 1 commit into from
Mar 24, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,12 @@
<version>3.25.3</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.mockito</groupId>
<artifactId>mockito-core</artifactId>
<version>4.11.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.slf4j</groupId>
<artifactId>slf4j-simple</artifactId>
Expand Down
3 changes: 1 addition & 2 deletions src/main/java/org/apache/maven/archiver/MavenArchiver.java
Original file line number Diff line number Diff line change
Expand Up @@ -565,8 +565,7 @@ public void createArchive(
File pomPropertiesFile = new File(dir, "pom.properties");

new PomPropertiesUtil()
.createPomProperties(
session, workingProject, archiver, customPomPropertiesFile, pomPropertiesFile, forced);
.createPomProperties(workingProject, archiver, customPomPropertiesFile, pomPropertiesFile, forced);
}

// ----------------------------------------------------------------------
Expand Down
23 changes: 23 additions & 0 deletions src/main/java/org/apache/maven/archiver/PomPropertiesUtil.java
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,9 @@ private void createPropertiesFile(Properties properties, File outputFile, boolea
* @param forceCreation force creation true/false
* @throws org.codehaus.plexus.archiver.ArchiverException archiver exception.
* @throws java.io.IOException IO exception.
* @deprecated please use {@link #createPomProperties(MavenProject, Archiver, File, File, boolean)}
*/
@Deprecated
public void createPomProperties(
MavenSession session,
MavenProject project,
Expand All @@ -112,6 +114,27 @@ public void createPomProperties(
File pomPropertiesFile,
boolean forceCreation)
throws IOException {
createPomProperties(project, archiver, customPomPropertiesFile, pomPropertiesFile, forceCreation);
}

/**
* Creates the pom.properties file.
*
* @param project {@link org.apache.maven.project.MavenProject}
* @param archiver {@link org.codehaus.plexus.archiver.Archiver}
* @param customPomPropertiesFile optional custom pom properties file
* @param pomPropertiesFile The pom properties file.
* @param forceCreation force creation true/false
* @throws org.codehaus.plexus.archiver.ArchiverException archiver exception.
* @throws java.io.IOException IO exception.
*/
public void createPomProperties(
MavenProject project,
Archiver archiver,
File customPomPropertiesFile,
File pomPropertiesFile,
boolean forceCreation)
throws IOException {
final String groupId = project.getGroupId();
final String artifactId = project.getArtifactId();
final String version = project.getVersion();
Expand Down
Loading