Skip to content

Commit

Permalink
Use parent pom 4.77 (#219)
Browse files Browse the repository at this point in the history
* pom.xml update

* deleted Backup file of pom.xml

* Added null check in CopyArtifact.java and handle IllegalArgumentException

* fixing my earlier issue

* Fixing my earlier issue

* Removed .vscode file

* Reduce difference due to spaces

---------

Co-authored-by: Mark Waite <mark.earl.waite@gmail.com>
  • Loading branch information
shivajee98 and MarkEWaite committed Jan 21, 2024
1 parent 2df1477 commit 25d996b
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>org.jenkins-ci.plugins</groupId>
<artifactId>plugin</artifactId>
<version>4.76</version>
<version>4.77</version>
<relativePath />
</parent>

Expand Down
11 changes: 9 additions & 2 deletions src/main/java/hudson/plugins/copyartifact/CopyArtifact.java
Original file line number Diff line number Diff line change
Expand Up @@ -379,10 +379,17 @@ private boolean upgradeIfNecessary(AbstractProject<?,?> job) throws IOException
if (isUpgradeNeeded()) {
Jenkins jenkins = Jenkins.getInstanceOrNull();
if (jenkins == null) {
LOGGER.log(Level.SEVERE, "upgrading copyartifact is required for {0} but Jenkins instance is unavailable", job.getDisplayName());
LOGGER.log(Level.SEVERE, "Upgrading copyartifact is required for {0} but Jenkins instance is unavailable", job.getDisplayName());

Check warning on line 382 in src/main/java/hudson/plugins/copyartifact/CopyArtifact.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 382 is not covered by tests
return false;
}
int i = projectName.lastIndexOf('/');

int i;
if (projectName != null) {

Check warning on line 387 in src/main/java/hudson/plugins/copyartifact/CopyArtifact.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Partially covered line

Line 387 is only partially covered, one branch is missing
i = projectName.lastIndexOf('/');
} else {
throw new IllegalArgumentException("projectName cannot be null");

Check warning on line 390 in src/main/java/hudson/plugins/copyartifact/CopyArtifact.java

View check run for this annotation

ci.jenkins.io / Code Coverage

Not covered line

Line 390 is not covered by tests
}

if (i != -1 && projectName.indexOf('=', i) != -1 && /* not matrix */jenkins.getItem(projectName, job.getParent(), Job.class) == null) {
project = projectName.substring(0, i);
parameters = projectName.substring(i + 1);
Expand Down

0 comments on commit 25d996b

Please sign in to comment.