Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit 5b431b4

Browse filesBrowse files
gnodetslawekjaranowski
authored andcommitted
Change installAtEnd default value
1 parent d373a82 commit 5b431b4
Copy full SHA for 5b431b4

File tree

Expand file treeCollapse file tree

4 files changed

+10
-4
lines changed
Filter options
Expand file treeCollapse file tree

4 files changed

+10
-4
lines changed

‎src/it/MINSTALL-108/verify.groovy

Copy file name to clipboardExpand all lines: src/it/MINSTALL-108/verify.groovy
+2-2Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@
2020
File buildLog = new File( basedir, 'build.log' )
2121
assert buildLog.exists()
2222
/* UNTIL MINSTALL-108 will be fixed the result
23-
* should not be <installAtEnd default-value="false">false</installAtEnd>
23+
* should not be <installAtEnd default-value="true">false</installAtEnd>
2424
*/
25-
assert buildLog.text.contains ( '<installAtEnd default-value="false">true</installAtEnd>')
25+
assert buildLog.text.contains ( '<installAtEnd default-value="true">true</installAtEnd>')

‎src/main/java/org/apache/maven/plugins/install/InstallMojo.java

Copy file name to clipboardExpand all lines: src/main/java/org/apache/maven/plugins/install/InstallMojo.java
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ public class InstallMojo implements org.apache.maven.api.plugin.Mojo {
6767
*
6868
* @since 2.5
6969
*/
70-
@Parameter(property = "installAtEnd", defaultValue = "false")
70+
@Parameter(property = "installAtEnd", defaultValue = "true")
7171
private boolean installAtEnd;
7272

7373
/**

‎src/test/java/org/apache/maven/plugins/install/InstallMojoPomPackagingTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/apache/maven/plugins/install/InstallMojoPomPackagingTest.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,7 @@
3737
import org.apache.maven.api.di.Singleton;
3838
import org.apache.maven.api.plugin.Mojo;
3939
import org.apache.maven.api.plugin.testing.InjectMojo;
40+
import org.apache.maven.api.plugin.testing.MojoParameter;
4041
import org.apache.maven.api.plugin.testing.MojoTest;
4142
import org.apache.maven.api.plugin.testing.stubs.MojoExecutionStub;
4243
import org.apache.maven.api.plugin.testing.stubs.ProjectStub;
@@ -85,6 +86,7 @@ public void setUp() throws Exception {
8586

8687
@Test
8788
@InjectMojo(goal = "install")
89+
@MojoParameter(name = "installAtEnd", value = "false")
8890
public void testInstallIfPackagingIsPom(InstallMojo mojo) throws Exception {
8991
assertNotNull(mojo);
9092
Project project = (Project) getVariableValueFromObject(mojo, "project");

‎src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java

Copy file name to clipboardExpand all lines: src/test/java/org/apache/maven/plugins/install/InstallMojoTest.java
+5-1Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@
3939
import org.apache.maven.api.plugin.Mojo;
4040
import org.apache.maven.api.plugin.MojoException;
4141
import org.apache.maven.api.plugin.testing.InjectMojo;
42+
import org.apache.maven.api.plugin.testing.MojoParameter;
4243
import org.apache.maven.api.plugin.testing.MojoTest;
4344
import org.apache.maven.api.plugin.testing.stubs.MojoExecutionStub;
4445
import org.apache.maven.api.plugin.testing.stubs.ProducedArtifactStub;
@@ -95,6 +96,7 @@ public void testInstallTestEnvironment(InstallMojo mojo) {
9596

9697
@Test
9798
@InjectMojo(goal = "install")
99+
@MojoParameter(name = "installAtEnd", value = "false")
98100
public void testBasicInstall(InstallMojo mojo) throws Exception {
99101
assertNotNull(mojo);
100102
Project project = (Project) getVariableValueFromObject(mojo, "project");
@@ -115,6 +117,7 @@ public void testBasicInstall(InstallMojo mojo) throws Exception {
115117

116118
@Test
117119
@InjectMojo(goal = "install")
120+
@MojoParameter(name = "installAtEnd", value = "false")
118121
public void testBasicInstallWithAttachedArtifacts(InstallMojo mojo) throws Exception {
119122
assertNotNull(mojo);
120123
Project project = (Project) getVariableValueFromObject(mojo, "project");
@@ -145,7 +148,8 @@ public void testInstallIfArtifactFileIsNull(InstallMojo mojo) throws Exception {
145148
Project project = (Project) getVariableValueFromObject(mojo, "project");
146149
assertFalse(artifactManager.getPath(project.getMainArtifact().get()).isPresent());
147150

148-
assertThrows(MojoException.class, mojo::execute, "Did not throw mojo execution exception");
151+
MojoException e = assertThrows(MojoException.class, mojo::execute, "Did not throw mojo execution exception");
152+
assertEquals("The packaging for this project did not assign a file to the build artifact", e.getMessage());
149153
}
150154

151155
@Test

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.