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

[JENKINS-43950] Fix some exceptions breaking mvn clean hpi:run #63

Merged
merged 3 commits into from
Jan 30, 2018

Conversation

jglick
Copy link
Member

@jglick jglick commented May 23, 2017

Observed in workflow-job-plugin@master, using 2.29 parent, that mvn clean hpi:run (with no package in between, for example) would fail with

java.lang.NullPointerException
	at org.jenkinsci.maven.plugins.hpi.MavenArtifact.getActualArtifactId(MavenArtifact.java:146)
	at org.jenkinsci.maven.plugins.hpi.RunMojo.execute(RunMojo.java:333)
	at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)

Fixed that and then got another exception:

java.lang.NullPointerException
	at org.jenkinsci.maven.plugins.hpi.RunMojo.configureWebApplication(RunMojo.java:460)
	at org.jenkinsci.maven.plugins.hpi.AbstractJettyMojo.startJetty(AbstractJettyMojo.java:502)

The second fix makes it work. Perhaps there is a simpler solution.

@reviewbybees

@ghost
Copy link

ghost commented May 23, 2017

This pull request originates from a CloudBees employee. At CloudBees, we require that all pull requests be reviewed by other CloudBees employees before we seek to have the change accepted. If you want to learn more about our process please see this explanation.

@recampbell recampbell requested a review from abayer May 23, 2017 15:40
@jglick
Copy link
Member Author

jglick commented May 23, 2017

[ERROR] Parser Exception: META-INF/maven/site.vm
org.apache.velocity.runtime.parser.ParseException: Encountered "source" at line 1039, column 52.
Was expecting one of:
    "," ...
    ")" ...
    <WHITESPACE> ...
    
	at org.apache.velocity.runtime.parser.Parser.generateParseException(Parser.java:3679)
	at …

Not sure what that is about, checking…

@jglick
Copy link
Member Author

jglick commented May 23, 2017

Happens in master too, will check it separately.

@jglick
Copy link
Member Author

jglick commented May 23, 2017

@reviewbybees done

@KostyaSha
Copy link
Member

What introduced this issue?

@jglick
Copy link
Member Author

jglick commented May 23, 2017

@KostyaSha see #64.

Copy link
Member

@oleg-nenashev oleg-nenashev left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 🐝

@@ -81,7 +83,7 @@
*
* @author Kohsuke Kawaguchi
*/
@Mojo(name="run")
@Mojo(name="run", requiresDependencyResolution=ResolutionScope.TEST)
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, however there is also the dependencyResolution parameter, used at the start of execute; and resolveDependencies("test") in getJenkinsWarArtifact. Yet these do not work. @stephenc any clue what is going on here?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think something is attaching artifacts to the reactor and then they get wiped by clean and the re-attach is appending to the list, not replacing... does it happen with Maven 3.2.x?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

IIRC I was testing with 3.3.9 at the time.

@jglick jglick requested a review from stephenc May 24, 2017 17:19
@jglick
Copy link
Member Author

jglick commented May 30, 2017

AFAIK the change is helpful and harmless, but withdrawing from consideration until I have time to dig more deeply into why the problem is happening and to check if there is a better solution.

@jglick
Copy link
Member Author

jglick commented Jan 30, 2018

I guess I do not actually have time to dig more deeply, and this fix helps people, so 🤷‍♂️

@jglick jglick merged commit bac2454 into jenkinsci:master Jan 30, 2018
@jglick jglick deleted the NPE branch January 30, 2018 20:54
@carlossg
Copy link

This fixes JENKINS-43950

@jglick jglick changed the title Fix some exceptions breaking mvn clean hpi:run [JENKINS-43950] Fix some exceptions breaking mvn clean hpi:run Jan 31, 2018
olivergondza added a commit to olivergondza/jms-messaging-plugin that referenced this pull request Nov 27, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

7 participants