wood burning stoves 2.0*
The moose likes Ant, Maven and Other Build Tools and the fly likes problem in packaging jenkins plugin tutorial Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Engineering » Ant, Maven and Other Build Tools
Bookmark "problem in packaging jenkins plugin tutorial" Watch "problem in packaging jenkins plugin tutorial" New topic
Author

problem in packaging jenkins plugin tutorial

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
so basically i am trying to build a plugin jenkins, and for that i am trying to packaging the code from the jenkins plugin tutorial
https://wiki.jenkins-ci.org/display/JENKINS/Plugin+tutorial#Plugintutorial-CreatingaNewPlugin
but when i am firing command mvn package, it's not downloading some of dependencies.
here is the stack trace:


C:\maven\punit>mvn package -e
[INFO] Error stacktraces are turned on.
[INFO] Scanning for projects...
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building punit 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-test-
harness/1.466/jenkins-test-harness-1.466.jar
Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/subversion
/1.26/subversion-1.26.jar
Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/1
.466/jenkins-war-1.466.war
Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-core/
1.466/jenkins-core-1.466.jar
Downloading: http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/1
.466/jenkins-war-1.466-war-for-test.jar
Downloaded: http://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/subversion/
1.26/subversion-1.26.jar (306 KB at 2.0 KB/sec)
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2:37:14.226s
[INFO] Finished at: Sat Sep 15 11:27:04 IST 2012
[INFO] Final Memory: 10M/27M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal on project punit: Could not resolve dependencies
for project com.punit:punit:hpi:1.0-SNAPSHOT: The following artifacts could not
be resolved: org.jenkins-ci.main:jenkins-war:war:1.466, org.jenkins-ci.main:jenk
ins-core:jar:1.466, org.jenkins-ci.main:jenkins-test-harness:jar:1.466, org.jenk
ins-ci.main:jenkins-war:jar:war-for-test:1.466: Could not transfer artifact org.
jenkins-ci.main:jenkins-war:war:1.466 from/to repo.jenkins-ci.org (http://repo.j
enkins-ci.org/public/): GET request of: org/jenkins-ci/main/jenkins-war/1.466/je
nkins-war-1.466.war from repo.jenkins-ci.org failed: Read timed out -> [Help 1]
org.apache.maven.lifecycle.LifecycleExecutionException: Failed to execute goal o
n project punit: Could not resolve dependencies for project com.punit:punit:hpi:
1.0-SNAPSHOT: The following artifacts could not be resolved: org.jenkins-ci.main
:jenkins-war:war:1.466, org.jenkins-ci.main:jenkins-core:jar:1.466, org.jenkins-
ci.main:jenkins-test-harness:jar:1.466, org.jenkins-ci.main:jenkins-war:jar:war-
for-test:1.466: Could not transfer artifact org.jenkins-ci.main:jenkins-war:war:
1.466 from/to repo.jenkins-ci.org (http://repo.jenkins-ci.org/public/): GET requ
est of: org/jenkins-ci/main/jenkins-war/1.466/jenkins-war-1.466.war from repo.je
nkins-ci.org failed
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:210)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.resol
veProjectDependencies(LifecycleDependencyResolver.java:117)
at org.apache.maven.lifecycle.internal.MojoExecutor.ensureDependenciesAr
eResolved(MojoExecutor.java:258)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:201)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:153)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor
.java:145)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:84)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProje
ct(LifecycleModuleBuilder.java:59)
at org.apache.maven.lifecycle.internal.LifecycleStarter.singleThreadedBu
ild(LifecycleStarter.java:183)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(Lifecycl
eStarter.java:161)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:320)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:156)
at org.apache.maven.cli.MavenCli.execute(MavenCli.java:537)
at org.apache.maven.cli.MavenCli.doMain(MavenCli.java:196)
at org.apache.maven.cli.MavenCli.main(MavenCli.java:141)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.
java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAcces
sorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:601)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Laun
cher.java:290)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.jav
a:230)
at org.codehaus.plexus.classworlds.launcher.Launcher.mainWithExitCode(La
uncher.java:409)
at org.codehaus.plexus.classworlds.launcher.Launcher.main(Launcher.java:
352)
Caused by: org.apache.maven.project.DependencyResolutionException: Could not res
olve dependencies for project com.punit:punit:hpi:1.0-SNAPSHOT: The following ar
tifacts could not be resolved: org.jenkins-ci.main:jenkins-war:war:1.466, org.je
nkins-ci.main:jenkins-core:jar:1.466, org.jenkins-ci.main:jenkins-test-harness:j
ar:1.466, org.jenkins-ci.main:jenkins-war:jar:war-for-test:1.466: Could not tran
sfer artifact org.jenkins-ci.main:jenkins-war:war:1.466 from/to repo.jenkins-ci.
org (http://repo.jenkins-ci.org/public/): GET request of: org/jenkins-ci/main/je
nkins-war/1.466/jenkins-war-1.466.war from repo.jenkins-ci.org failed
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:189)
at org.apache.maven.lifecycle.internal.LifecycleDependencyResolver.getDe
pendencies(LifecycleDependencyResolver.java:185)
... 22 more
Caused by: org.sonatype.aether.resolution.DependencyResolutionException: The fol
lowing artifacts could not be resolved: org.jenkins-ci.main:jenkins-war:war:1.46
6, org.jenkins-ci.main:jenkins-core:jar:1.466, org.jenkins-ci.main:jenkins-test-
harness:jar:1.466, org.jenkins-ci.main:jenkins-war:jar:war-for-test:1.466: Could
not transfer artifact org.jenkins-ci.main:jenkins-war:war:1.466 from/to repo.je
nkins-ci.org (http://repo.jenkins-ci.org/public/): GET request of: org/jenkins-c
i/main/jenkins-war/1.466/jenkins-war-1.466.war from repo.jenkins-ci.org failed
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:375)
at org.apache.maven.project.DefaultProjectDependenciesResolver.resolve(D
efaultProjectDependenciesResolver.java:183)
... 23 more
Caused by: org.sonatype.aether.resolution.ArtifactResolutionException: The follo
wing artifacts could not be resolved: org.jenkins-ci.main:jenkins-war:war:1.466,
org.jenkins-ci.main:jenkins-core:jar:1.466, org.jenkins-ci.main:jenkins-test-ha
rness:jar:1.466, org.jenkins-ci.main:jenkins-war:jar:war-for-test:1.466: Could n
ot transfer artifact org.jenkins-ci.main:jenkins-war:war:1.466 from/to repo.jenk
ins-ci.org (http://repo.jenkins-ci.org/public/): GET request of: org/jenkins-ci/
main/jenkins-war/1.466/jenkins-war-1.466.war from repo.jenkins-ci.org failed
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolve(Def
aultArtifactResolver.java:538)
at org.sonatype.aether.impl.internal.DefaultArtifactResolver.resolveArti
facts(DefaultArtifactResolver.java:216)
at org.sonatype.aether.impl.internal.DefaultRepositorySystem.resolveDepe
ndencies(DefaultRepositorySystem.java:358)
... 24 more
Caused by: org.sonatype.aether.transfer.ArtifactTransferException: Could not tra
nsfer artifact org.jenkins-ci.main:jenkins-war:war:1.466 from/to repo.jenkins-ci
.org (http://repo.jenkins-ci.org/public/): GET request of: org/jenkins-ci/main/j
enkins-war/1.466/jenkins-war-1.466.war from repo.jenkins-ci.org failed
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:951)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$4.wrap(W
agonRepositoryConnector.java:941)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:669)
at org.sonatype.aether.util.concurrency.RunnableErrorForwarder$1.run(Run
nableErrorForwarder.java:60)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.
java:1110)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor
.java:603)
at java.lang.Thread.run(Thread.java:722)
Caused by: org.apache.maven.wagon.TransferFailedException: GET request of: org/j
enkins-ci/main/jenkins-war/1.466/jenkins-war-1.466.war from repo.jenkins-ci.org
failed
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
49)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
10)
at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:2
87)
at org.apache.maven.wagon.StreamWagon.getIfNewer(StreamWagon.java:97)
at org.apache.maven.wagon.StreamWagon.get(StreamWagon.java:61)
at org.sonatype.aether.connector.wagon.WagonRepositoryConnector$GetTask.
run(WagonRepositoryConnector.java:601)
... 4 more
Caused by: java.net.SocketTimeoutException: Read timed out
at java.net.SocketInputStream.socketRead0(Native Method)
at java.net.SocketInputStream.read(SocketInputStream.java:150)
at java.net.SocketInputStream.read(SocketInputStream.java:121)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.AbstractSess
ionInputBuffer.read(AbstractSessionInputBuffer.java:187)
at org.apache.maven.wagon.providers.http.httpclient.impl.io.ContentLengt
hInputStream.read(ContentLengthInputStream.java:176)
at org.apache.maven.wagon.providers.http.httpclient.conn.EofSensorInputS
tream.read(EofSensorInputStream.java:138)
at org.apache.maven.wagon.AbstractWagon.transfer(AbstractWagon.java:493)

at org.apache.maven.wagon.AbstractWagon.getTransfer(AbstractWagon.java:3
39)
... 9 more
[ERROR]
[ERROR] Re-run Maven using the -X switch to enable full debug logging.
[ERROR]
[ERROR] For more information about the errors and possible solutions, please rea
d the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/DependencyReso
lutionException


can anybody please tell me, what is going wrong.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

I check the URLs in the download message and the JAR file do appear there. Do you perhaps need to configure a proxy? Also, try accessing the JARs from a browser using the URLs in the download statements.


JBoss In Action
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
yes, i am not able to access few links:
http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-test-
http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/1
http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-war/1

and i am able to access these links:

http://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/subversion
http://repo.jenkins-ci.org/public/org/jenkins-ci/main/jenkins-core/
http://repo.jenkins-ci.org/public/org/jenkins-ci/plugins/subversion/

do i need to create proxies for all above links?
i mean in host element of proxy settings, do i need to give above url's?

also i havn't stared jenkins server when packaging this projects?
also do i need to start tomcat as my servce for this?

Thanks.
Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

You might try using the full URL and not just the part the first on the first line; didn't you notice that they all wrapped to a second line???

You don't need to run Tomcat or Jenkins to build a Jenkins plugin.
Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
okay, so i have created two proxies:



but still getting this error:

Punit Jain
Ranch Hand

Joined: Aug 20, 2011
Posts: 979
    
    2
it works for me now.
i don't know, what was the problem, but i again tried all the steps in my office and it worked, slow internet connection might be a reason but i am not quite sure.
okay so, after packaging that project i installed eclipse maven plugin, and import that project.
in pom.xml i got one error, can anyone help me with this error?


Next, the tutorial says,

Let's take a look at the source code. A plugin's main entry point is a PluginImpl class that extends from Plugin. Once Jenkins detects your plugin class (via its inheritance relationship from Plugin), it will create an instance, and invoke methods. A Plugin class is optional; a plugin may simply implement extensions:

Most of the time, a plugin class just registers extension points, and your main work involves implementing those extension points. See the source code for more about how a Builder is implemented and what it does.


i didn't found any PluginImpl class in the project.

Next, i set this property set MAVEN_OPTS=-Xdebug -Xrunjdwp:transport=dt_socket,server=y,address=8000,suspend=n and run command mvn hpi:run
but don't know what it do?

Next i open browser and open http://localhost:8080/
i got this below screen:

now i am confused how do i start writing and test the code.
can anyone please guide me here or any sample plugin?

Thanks




[Thumbnail for jenkins1.png]

Peter Johnson
author
Bartender

Joined: May 14, 2008
Posts: 5811
    
    7

This should help: http://wiki.eclipse.org/M2E_plugin_execution_not_covered

The MAVEN_OPTS you posted let you remotely connect to the JVM running the code (which I will assume is Jenkins).

 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: problem in packaging jenkins plugin tutorial
 
Similar Threads
The POM for org.eclipse.persistence:eclipselink:jar:2.3.0 is missing
Could not resolve dependencies for maven project
How use sonar for an existing project in eclipse ?
Transitive Dependency Problem
"Reason: Auth cancel" while uploading war onto remote server via jenkins and maven