How to scan my project using pdsoftplan/zap-maven-plugin? I need to know without installing zap server - maven

I have a zap Maven plugin in my Maven pom.xml and I have provided goals as analyze. I didn't install zap server and in pom.xml I used as <shouldRunWithDocker>true</shouldRunWithDocker>. Please tell me the way to scan my project using Maven plugin. It is showing error as below.
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- zap-maven-plugin:1.2.1-0:analyze (default-cli) # IOPmsPerformanceTesting ---
[INFO] Starting ZAP analysis at target: https://example.com
[INFO] --- Validating authentication information ---
[INFO] Authentication information provided: AuthenticationInfo[type=CAS,loginUrl=https://example.com,username=12,password=679,extraPostData=,loggedInRegex=,loggedOutRegex=\QLocation:https://checkmarx.web.att.com\E.*,excludeFromScan=,protectedPages={https://checkmarx.web.att.com},loginRequestData=username={%username%}&password={%password%},usernameParameter=username,passwordParameter=password,httpSessionTokens=,seleniumDriver=Firefox,hostname=,realm=,port=80]
[INFO] The authentication information provided was successfully validated.
[INFO] --- Finished validating authentication information ---
[ERROR] Error creating a new ZAP session.
br.com.softplan.security.zap.zaproxy.clientapi.core.ClientApiException: java.net.ConnectException: Connection refused (Connection refused)
[ERROR] Error while trying to create the script file for CAS authentication in /zap/scripts/. The analysis will continue but CAS authentication will work only if the script file can be accessed by ZAP's Docker image (a default volume is created in /zap/scripts/).
java.io.FileNotFoundException: /zap/scripts/cas-auth.js (No such file or directory)
at java.io.FileOutputStream.open0(Native Method)

I suspect its because ZAP no longer allows you to connect to the API from remote IP addresses by default. You can override this from the ZAP command line: https://github.com/zaproxy/zaproxy/wiki/FAQapikey
Ideally the ZAP Maven Plugin should do this, but it doesnt look like thats been updated recently:/ https://github.com/pdsoftplan/zap-maven-plugin

Related

create spring boot 2.7 'mvn spring-boot:build-image' with podman on macOS failed

I try to create an image with mvn spring-boot:build-image using podman but got
[INFO] --- spring-boot-maven-plugin:2.7.0:build-image (default-cli) # sample-spring-service ---
[INFO] Building image 'docker.io/library/sample-spring-service:1.0.0-SNAPSHOT'
[INFO]
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
[INFO] > Pulled builder image 'docker.io/paketobuildpacks/builder#sha256:94e65320ba1682bc68cbbf1d4f63693bb62cc06c7077bfa3e3bccac7fdc10628'
[INFO] > Pulling run image 'docker.io/paketobuildpacks/run:base-cnb' 100%
[INFO] > Pulled run image 'docker.io/paketobuildpacks/run#sha256:3e889016680c0e2ef1e8b1bfdad2d6d34966c860a53ccfcfb3e269d48ed65fed'
[INFO] > Executing lifecycle version v0.14.1
[INFO] > Using build cache volume 'pack-cache-744ddec35876.build'
[INFO]
[INFO] > Running creator
[INFO] [creator] ERROR: initializing analyzer: getting previous image: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "http://%2Fvar%2Frun%2Fdocker.sock/v1.24/info": dial unix /var/run/docker.sock: connect: permission denied
podman info:
host:
arch: amd64
buildahVersion: 1.26.1
cgroupControllers:
...
version:
APIVersion: 4.1.0
Built: 1651853754
BuiltTime: Fri May 6 18:15:54 2022
GitCommit: ""
GoVersion: go1.18
Os: linux
OsArch: linux/amd64
Version: 4.1.0
I already tried a lot. Set permissions on socket, run podman with root. The same with docker is working well.
podman create alpine ls works fine.
In my pom.xml I tried:
<plugin>
<groupId>org.springframework.boot</groupId>
<artifactId>spring-boot-maven-plugin</artifactId>
<configuration>
<docker>
<!-- <host>unix:///Users/mike/.local/share/containers/podman/machine/podman-machine-default/podman.sock</host>
<host>unix:///run/user/1000/podman/podman.sock</host>
-->
<bindHostToBuilder>true</bindHostToBuilder>
</docker>
</configuration>
</plugin>
Any idea?
Update:
If I enable this line in pom.xml:
unix:///run/user/1000/podman/podman.sock
I get:
[INFO] --- spring-boot-maven-plugin:2.7.0:build-image (default-cli) # sample-spring-service ---
[INFO] Building image 'docker.io/library/sample-spring-service:1.0.0-SNAPSHOT'
[INFO]
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [2] No such file or directory
[INFO] Retrying request to {}->docker://localhost:2376
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [2] No such file or directory
[INFO] Retrying request to {}->docker://localhost:2376
[INFO] I/O exception (java.io.IOException) caught when processing request to {}->docker://localhost:2376: com.sun.jna.LastErrorException: [2] No such file or directory
[INFO] Retrying request to {}->docker://localhost:2376
[INFO] > Pulling builder image 'docker.io/paketobuildpacks/builder:base' 100%
For anyone who runs into a similar issue with spring boot build-image, for example when using remote docker hosts
From what I understand:
the pull is done using your docker parameters in pom.xml or environment variables like DOCKER_HOST
Once the pull has been completed, creator will start a new container and run the next commands in this newly container
The connection to docker in the new container might not work, as the DOCKER_HOST might need to be different for access to docker within a new container. Within the "creator" container, /var/run/docker.sock is automatically mounted from the host system.
If you enable bindHostToBuilder, it'll pass the DOCKER_HOST (or the parameter in pom.xml) to the new container, but that might not be the correct docker hostname that is accessible from within the new container.
For me the solution was to not use bindHostToBuilder, but ensure that /var/run/docker.sock exists on the host system so that it can be mapped within the "creator" container, even though the pull happens with a different DOCKER_HOST (a remote docker)

Creating Springboot image with Docker took box on windows 10 using spotify maven plugin

I use docker tool box in my windows 10 home laptop. Trying to create a docker image using the springboot project I have been working on. Followed the tutorial at https://spring.io/guides/gs/spring-boot-docker/
Have been struggling with the error for past three days
Apr 03, 2019 11:52:57 AM com.spotify.docker.client.shaded.org.apache.http.impl.execchain.RetryExec execute
INFO: I/O exception (java.net.SocketException) caught when processing request to {s}->https://192.168.99.100:2376: Connection reset by peer: socket write error
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 46.027 s
[INFO] Finished at: 2019-04-03T11:52:57+05:30
[INFO] Final Memory: 63M/433M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal com.spotify:dockerfile-maven-plugin:1.4.9:build (default-cli) on project IssueTracker: Could not build image: java.util.concurrent.ExecutionException: com.spotify.docker.client.shaded.javax.ws.rs.ProcessingException: com.spotify.docker.client.shaded.org.apache.http.client.ClientProtocolException: Cannot retry request with a non-repeatable request entity: Connection reset by peer: socket write error -> [Help 1]
Many websites I look up said this could be something related to disabling TLS. I tried to expose the host, disable the tls but still the issue persists. Any help will be appreciated.
The following is my maven plugin config
<plugin>
<groupId>com.spotify</groupId>
<artifactId>dockerfile-maven-plugin</artifactId>
<version>1.4.9</version>
<configuration>
<repository>${docker.image.prefix}/${project.artifactId}</repository>
</configuration>
</plugin>
Did you try to run this maven goal inside "Docker Quickstart Terminal"?

Cannot find class and SurefireBooterForkException while executing from command prompt

While running from command prompt using mvn clean install command getting above error.
Cannot find class in classpath: com.test.selenium.TestHello
[ERROR] org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Complete stack trace:
enter code here
Skip to content
titletitle
search
6
Manage
Dismiss
You have data stored in an older format and/or unreadable data.
Disable CLI over Remoting
Dismiss
Allowing Jenkins CLI to work in -remoting mode is considered dangerous and usually unnecessary. You are advised to disable this mode. Please refer to the CLI documentation for details.
Setup Security
Dismiss
Jenkins is currently unsecured and allows anyone on the network to launch processes on your behalf. It is recommended to set up security and to limit anonymous access even on private networks.
Go to plugin manager
Configure which of these warnings are shown
Warnings have been published for the following currently installed components.
Matrix Authorization Strategy Plugin 1.1
Dangerous permissions can be configured independently of Administer permission
Subversion Plug-in 1.54
CSRF vulnerability and insufficient permission checks allow capturing credentials
Users without Overall/Read are able to access lists of user names and node names
SSH Slaves plugin 1.9
Man-in-the-middle vulnerability due to missing host key verification
Ant Plugin 1.2
Cross-site scripting (XSS) vulnerability
Translation Assistance plugin 1.10
Cross-site request forgery (CSRF) vulnerability
Dismiss
You have not configured the CSRF issuer. This could be a security issue. For more information, please refer to this page.
You can change the current configuration using the Security section CSRF Protection.
This Jenkins instance uses deprecated protocols: CLI-connect,CLI2-connect,JNLP-connect,JNLP2-connect. It may impact stability of the instance. If newer protocol versions are supported by all system components (agents, CLI and other clients), it is highly recommended to disable the deprecated protocols. See Protocol Configuration.
Manage Jenkins
Jenkins
TestMaven
#11
Back to Project
Status
Changes
Console Output
View as plain text
Edit Build Information
Delete Build
Git Build Data
No Tags
Redeploy Artifacts
See Fingerprints
Previous Build
SuccessConsole Output
Started by user unknown or anonymous
Building in workspace /Users/i339884/.jenkins/jobs/TestMaven/workspace
> git rev-parse --is-inside-work-tree # timeout=10
Fetching changes from the remote Git repository
> git config remote.origin.url https://github.com/sreekumarthesun/selenium # timeout=10
Fetching upstream changes from https://github.com/sreekumarthesun/selenium
> git --version # timeout=10
> git fetch --tags --progress https://github.com/sreekumarthesun/selenium +refs/heads/*:refs/remotes/origin/*
> git rev-parse refs/remotes/origin/master^{commit} # timeout=10
> git rev-parse refs/remotes/origin/origin/master^{commit} # timeout=10
Checking out Revision d0cde4d90c2accf2574411d0d46d5dd1ba0d6e07 (refs/remotes/origin/master)
> git config core.sparsecheckout # timeout=10
> git checkout -f d0cde4d90c2accf2574411d0d46d5dd1ba0d6e07
Commit message: "first checkin"
> git rev-list --no-walk d0cde4d90c2accf2574411d0d46d5dd1ba0d6e07 # timeout=10
Parsing POMs
Established TCP socket on 59031
[com.ariba.selenium] $ /ariba/s6053/ariba/3rdParty/jdk/Darwin/1.8.0/bin/java -cp /Users/i339884/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-agent-1.12-alpha-1.jar:/Users/i339884/Desktop/selenium/Selenium/softwares/apache-maven-3.5.2/boot/plexus-classworlds-2.5.2.jar:/Users/i339884/Desktop/selenium/Selenium/softwares/apache-maven-3.5.2/conf/logging jenkins.maven3.agent.Maven35Main /Users/i339884/Desktop/selenium/Selenium/softwares/apache-maven-3.5.2 /Users/i339884/.jenkins/war/WEB-INF/lib/remoting-3.20.jar /Users/i339884/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven35-interceptor-1.12-alpha-1.jar /Users/i339884/.jenkins/plugins/maven-plugin/WEB-INF/lib/maven3-interceptor-commons-1.12-alpha-1.jar 59031
<===[JENKINS REMOTING CAPACITY]===>channel started
Executing Maven: -B -f /Users/i339884/Documents/maven/com.ariba.selenium/pom.xml clean install
[INFO] Scanning for projects...
[WARNING]
[WARNING] Some problems were encountered while building the effective model for com.ariba.selenium:com.ariba.selenium:jar:1.0.0
[WARNING] 'build.plugins.plugin.version' for org.apache.maven.plugins:maven-compiler-plugin is missing. # line 40, column 12
[WARNING]
[WARNING] It is highly recommended to fix these problems because they threaten the stability of your build.
[WARNING]
[WARNING] For this reason, future Maven versions might no longer support building such malformed projects.
[WARNING]
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building com.ariba.selenium 1.0.0
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) # com.ariba.selenium ---
[INFO] Deleting /Users/i339884/Documents/maven/com.ariba.selenium/target
[INFO]
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) # com.ariba.selenium ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/i339884/Documents/maven/com.ariba.selenium/src/main/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:compile (default-compile) # com.ariba.selenium ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) # com.ariba.selenium ---
[WARNING] Using platform encoding (UTF-8 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] skip non existing resourceDirectory /Users/i339884/Documents/maven/com.ariba.selenium/src/test/resources
[INFO]
[INFO] --- maven-compiler-plugin:3.1:testCompile (default-testCompile) # com.ariba.selenium ---
[INFO] No sources to compile
[INFO]
[INFO] --- maven-surefire-plugin:2.21.0:test (default-test) # com.ariba.selenium ---
[INFO] No tests to run.
[INFO]
[INFO] -------------------------------------------------------
[INFO] T E S T S
[INFO] -------------------------------------------------------
[INFO] Running TestSuite
[INFO]
[INFO] Results:
[INFO]
[INFO] Tests run: 0, Failures: 0, Errors: 0, Skipped: 0
[INFO]
[ERROR] There are test failures.
Please refer to /Users/i339884/Documents/maven/com.ariba.selenium/target/surefire-reports for the individual test results.
Please refer to dump files (if any exist) [date]-jvmRun[N].dump, [date].dumpstream and [date]-jvmRun[N].dumpstream.
There was an error in the forked process
Cannot find class in classpath: com.test.selenium.TestHello
org.apache.maven.surefire.booter.SurefireBooterForkException: There was an error in the forked process
Cannot find class in classpath: com.test.selenium.TestHello
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:658)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.fork(ForkStarter.java:533)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:278)
at org.apache.maven.plugin.surefire.booterclient.ForkStarter.run(ForkStarter.java:244)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeProvider(AbstractSurefireMojo.java:1149)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.executeAfterPreconditionsChecked(AbstractSurefireMojo.java:978)
at org.apache.maven.plugin.surefire.AbstractSurefireMojo.execute(AbstractSurefireMojo.java:854)
at org.apache.maven.plugin.DefaultBuildPluginManager.executeMojo(DefaultBuildPluginManager.java:134)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:208)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:154)
at org.apache.maven.lifecycle.internal.MojoExecutor.execute(MojoExecutor.java:146)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:117)
at org.apache.maven.lifecycle.internal.LifecycleModuleBuilder.buildProject(LifecycleModuleBuilder.java:81)
at org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder.build(SingleThreadedBuilder.java:51)
at org.apache.maven.lifecycle.internal.LifecycleStarter.execute(LifecycleStarter.java:128)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:309)
at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:194)
at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:107)
at org.jvnet.hudson.maven3.launcher.Maven35Launcher.main(Maven35Launcher.java:130)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.codehaus.plexus.classworlds.launcher.Launcher.launchEnhanced(Launcher.java:289)
at org.codehaus.plexus.classworlds.launcher.Launcher.launch(Launcher.java:229)
at jenkins.maven3.agent.Maven35Main.launch(Maven35Main.java:176)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:139)
at hudson.maven.Maven3Builder.call(Maven3Builder.java:70)
at hudson.remoting.UserRequest.perform(UserRequest.java:212)
at hudson.remoting.UserRequest.perform(UserRequest.java:54)
at hudson.remoting.Request$2.run(Request.java:369)
at hudson.remoting.InterceptingExecutorService$1.call(InterceptingExecutorService.java:72)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617)
at java.lang.Thread.run(Thread.java:745)
[JENKINS] Recording test results
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.BuildInfoRecorder$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO]
[INFO] --- maven-jar-plugin:2.4:jar (default-jar) # com.ariba.selenium ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: /Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar
[INFO]
[INFO] --- maven-install-plugin:2.4:install (default-install) # com.ariba.selenium ---
[INFO] Installing /Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar to /Users/i339884/.m2/repository/com/ariba/selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.jar
[INFO] Installing /Users/i339884/Documents/maven/com.ariba.selenium/pom.xml to /Users/i339884/.m2/repository/com/ariba/selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.pom
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenArtifactArchiver$2; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[WARNING] Attempt to (de-)serialize anonymous class hudson.maven.reporters.MavenFingerprinter$1; see: https://jenkins.io/redirect/serialization-of-anonymous-classes/
[INFO] ------------------------------------------------------------------------
[INFO] BUILD SUCCESS
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 2.305 s
[INFO] Finished at: 2018-05-12T10:56:23+05:30
[INFO] Final Memory: 17M/265M
[INFO] ------------------------------------------------------------------------
[JENKINS] Archiving /Users/i339884/Documents/maven/com.ariba.selenium/pom.xml to com.ariba.selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.pom
[JENKINS] Archiving /Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar to com.ariba.selenium/com.ariba.selenium/1.0.0/com.ariba.selenium-1.0.0.jar
/Users/i339884/Documents/maven/com.ariba.selenium/pom.xml is not inside /Users/i339884/.jenkins/jobs/TestMaven/workspace/Users/i339884/Documents/maven/com.ariba.selenium/; will archive in a separate pass
/Users/i339884/Documents/maven/com.ariba.selenium/target/com.ariba.selenium-1.0.0.jar is not inside /Users/i339884/.jenkins/jobs/TestMaven/workspace/Users/i339884/Documents/maven/com.ariba.selenium/; will archive in a separate pass
channel stopped
[htmlpublisher] Archiving HTML reports...
[htmlpublisher] Archiving at PROJECT level /Users/i339884/.jenkins/jobs/TestMaven/workspace to /Users/i339884/.jenkins/jobs/TestMaven/htmlreports/Extent_20Html_20Report
TestNG Reports Processing: START
Looking for TestNG results report in workspace using pattern: **/testng-results.xml
testng-results.xml was last modified before this build started. Ignoring it.
Saving reports...
Found matching files but did not find any TestNG results.
Finished: SUCCESS
Help us localize this page Page generated: 14-May-2018 11:30:34 ISTREST APIJenkins ver. 2.121
This error getting while running maven project from command versions.
I am suspecting java class files are not generating properly while running from Maven
I had the similar issue while running the tests on Jenkins. In my local, all tests were running fine but Jenkins was giving me this error as all the plugins and dependencies had to be installed manually behind my company firewall.
Initially I only used Maven Surefire Plugin 3.0.0-M3 which gave me error. Then I had to add a dependency "surefire-testng" version 3.0.0-M3 and solved it.

Bamboo Maven Glassfish Deploy

I've been trying to set up continuous integration and deployment for a Java EE application.
Continuous integration is working however the deployment always fail.
I tried 3 things in the maven parameter ${local.glassfish.passfile}:
path to domain-password
path to.gfclient/pass
password string
One last thing I tried was:
hardcoded value inside pom.xml
Ear pom.xml configuration:
<plugin>
<groupId>org.glassfish.maven.plugin</groupId>
<artifactId>maven-glassfish-plugin</artifactId>
<version>2.1</version>
<configuration>
<glassfishDirectory>${local.glassfish.home}</glassfishDirectory>
<user>${local.glassfish.user}</user>
<passwordFile>${local.glassfish.passfile}</passwordFile>
<domain>
<name>${local.glassfish.domain}</name>
<adminPort>${local.glassfish.adminPort}</adminPort>
<httpPort>${local.glassfish.httpPort}</httpPort>
</domain>
<components>
<component>
<name>${project.artifactId}</name>
<artifact>target/${project.build.finalName}.ear</artifact>
</component>
</components>
<debug>true</debug>
<terse>false</terse>
<echo>true</echo>
</configuration>
</plugin>
Running mvn glassfish:deploy inside the ear folder via the terminal successfully deploys the ear artefact to the server.
Bamboo Error log:
[INFO] Scanning for projects...
[INFO]
[INFO] Using the builder org.apache.maven.lifecycle.internal.builder.singlethreaded.SingleThreadedBuilder with a thread count of 1
[INFO]
[INFO] ------------------------------------------------------------------------
[INFO] Building ear 1.0-SNAPSHOT
[INFO] ------------------------------------------------------------------------
[INFO]
[INFO] --- maven-glassfish-plugin:2.1:undeploy (default-cli) # ear ---
[INFO] Deprecated syntax, instead use:
[INFO] asadmin --echo --terse=false --interactive=false --user admin --passwordfile /home/guest/.gfclient/pass --host localhost --port 55004 undeploy [options] ...
[INFO] asadmin --host localhost --port 55004 --user admin --passwordfile /home/guest/.gfclient/pass --interactive=false --echo=true --terse=false undeploy --keepreposdir=false --isredeploy=false --cascade=false --_ignorecascade=false --_classicstyle=false ear
[INFO] Command undeploy failed.
[ERROR] Authentication failed for user: admin
[ERROR] (Usually, this means invalid user name and/or password)
[ERROR] Undeployment of ear failed.
[ERROR] For more detail on what might be causing the problem try running maven with the --debug option
[ERROR] or setting the maven-glassfish-plugin "echo" property to "true".
[INFO] ------------------------------------------------------------------------
[INFO] BUILD FAILURE
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 1.699 s
[INFO] Finished at: 2014-03-06T17:39:50+00:00
[INFO] Final Memory: 8M/19M
[INFO] ------------------------------------------------------------------------
[ERROR] Failed to execute goal org.glassfish.maven.plugin:maven-glassfish-plugin:2.1:undeploy (default-cli) on project ear: Undeployment of ear failed. -> [Help 1]
[ERROR]
[ERROR] To see the full stack trace of the errors, re-run Maven with the -e switch.
[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 read the following articles:
[ERROR] [Help 1] http://cwiki.apache.org/confluence/display/MAVEN/MojoFailureException
Failing task since return code of [/home/guest/apache-maven-3.2.1/bin/mvn glassfish:undeploy] was 1 while expected 0
Finished task 'Maven Glassfish Undeploy'
Note that I ran the "asadmin login" command after I changed the admin password in order to update the pass file.
guest#foo:~$ asadmin --port 55004 login
Enter admin user name [Enter to accept default]> admin
Enter admin password>
Admin login information for host [localhost] and port [55004] is being overwritten with credentials provided. This is because the --savelogin option was used during create-domain command.
Login information relevant to admin user name [admin] for host [localhost] and admin port [55004] stored at [/home/guest/.gfclient/pass] successfully.
Make sure that this file remains protected. Information stored in this file will be used by administration commands to manage associated domain.
Command login executed successfully.
Also, Glassfish version is 4.0, Maven version is 3.2.1.
If you have used the asadmin login command you don't need to specify the user and password in the undeploy and deploy command as it will use the credentials that you've set using the login command.
There is a Bamboo plugin that allows to deploy an war file to Glassfish Application Server.
https://marketplace.atlassian.com/apps/1219234/tasks-for-glassfish-server

maven: Error transferring file: Connection refused: connect

I am working in a network environment.
my network ip address for internet is:
IE->tools->internet options->connections->LAN settings->Use Automatic configuration script(enabled): Address: http://autocache.abc.com/
port address is not specified in IE settings.
when i do ping autocache.abc.com it gives following ip address: 16.234.18.243
in settings.xml file i have enabled entry for proxy as:
<proxy>
<id>genproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>autocache.abc.com</host>
</proxy>
Nothing is specified at Ie host ie: IE->tools->connection->LAN settings->advanced->http shows empty
if i run mvn install getting following error:
[INFO] Scanning for projects...
[INFO] ------------------------------------------------------------------------
[INFO] Building home-app
[INFO] task-segment: [install]
[INFO] ------------------------------------------------------------------------
[INFO] [resources:resources {execution: default-resources}]
[WARNING] Using platform encoding (Cp1252 actually) to copy filtered resources, i.e. build is platform dependent!
[INFO] Copying 4 resources
Downloading: https://repository.jboss.org/nexus/content/repositories/releases//org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository jboss (https://repository.jboss.org/nexus/content/repositories/releases/): Error transferring file: Connection refused: connect
Downloading: http://repository.springsource.com/maven/bundles/release/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.release (http://repository.springsource.com/maven/bundles/release): Error transferring file: Connection refused: connect
Downloading: http://repository.springsource.com/maven/bundles/external/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository com.springsource.repository.bundles.external (http://repository.springsource.com/maven/bundles/external): Error transferring file: Connection refused: connect
Downloading: http://repo1.maven.org/maven2/org/springframework/spring-parent/3.0.6.RELEASE/spring-parent-3.0.6.RELEASE.pom
[WARNING] Unable to get resource 'org.springframework:spring-parent:pom:3.0.6.RELEASE' from repository central (http://repo1.maven.org/maven2): Error transferring file: Connection refused: connect
[INFO] ------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO] ------------------------------------------------------------------------
[INFO] Error building POM (may not be this project's POM).
Project ID: org.springframework:spring-orm:jar:3.0.6.RELEASE
Reason: Cannot find parent: org.springframework:spring-parent for project: org.springframework:spring-orm:jar:3.0.6.RELEASE for project org.springframework:spring-orm:jar:3.0.6.RELEASE
[INFO] ------------------------------------------------------------------------
[INFO] For more information, run Maven with the -e switch
[INFO] ------------------------------------------------------------------------
[INFO] Total time: 11 seconds
[INFO] Finished at: Wed Feb 15 11:40:32 IST 2012
[INFO] Final Memory: 11M/27M
[INFO] ------------------------------------------------------------------------
If I run mvn install without network connection ie at my private internet connection, it is working fine and only problem is with network proxy.
I strongly feel it is host issue, if I give host as 16.234.18.243 instead of autocache.abc.com, still gives same error.
I tried to create new local repository( ie deleted existing directory), but still same issue.
1> open IE(or any browser),
2> give url as http://autocache.abc.com/ ( you have given above) and enter, a file will be downloaded with .pac format, save to desktop
3> open .pac file in textpad, identify PROXY:
In your editor, it will come something like:
return "PROXY web-proxy.ind.abc.com:8080; PROXY proxy.sgp.abc.com:8080";
4> go to Maven settings.xml and enter as:
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<host>web-proxy.ind.abc.com</host>
<port>8080</port>
</proxy>
5> run mvn:install through command prompt or run through eclipse.
go through maven-in-5-min-not-working
The URL you specified most likely contains a Proxy auto-config file . You need to download it and see what the proxy settings specified in it are.
For instance, the file contents
function FindProxyForURL(url, host)
{
return "PROXY proxy.example.com:8080; DIRECT";
}
indicates that you should use the proxy server proxy.example.com on port 8080.
For a more elaborate example, see How to configure Maven behind an auto configured proxy .

Resources