I have tried everything i can think of to get my JBoss to run as a plugin with maven, but it seems impossible to get it tio run. I get the same error on all versions(tried 7.1.1 - 7.9 final).
Does anyone now what can be the problem? I am running on Java 8 and maven 3.
I have also tried all possible ports, 9999, 9990, 4447 and so on. Running in standalone mode. This seems to be a really horrible plugin.
ERROR] Failed to execute goal
Reason: I/O Error could not execute operation '{
ERROR] "operation" => "read-attribute",
[ERROR] "address" => [],
[ERROR] "name" => "launch-type"
[ERROR] }': java.net.ConnectException: JBAS012144: Could not connect to remote://localhost:4447. The connection timed out
[ERROR] -> [Help 1]
Jonas
For a default standalone.xml configuration (with 0 port offset) remote management port is 9999.
You need to set this port in jboss maven plugin configuration.
Usually, in this cases you need to check:
1- Plugin configuration matches your jboss standalone xml file. For example:
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.9.Final</version>
<inherited>true</inherited>
<configuration>
<hostname>${jboss.hostname}</hostname>
<port>${jboss.port}</port>
<username>${jboss.user}</username>
<password>${jboss.pass}</password>
</configuration>
</plugin>
2 - check if hostname matches the binding interface where your jboss AS is listening. For example using netstat command you can check if jboss is listening in 0.0.0.0:9999 or 127.0.0.1:9999 or another interface.
This ip should be setted in jboss.hostname property and the default port 9999 in jboss.port property.
jboss.user and jboss.pass properties are related to your defined management user in jboss AS.
3 - try to execute mvn jboss-as:deploy. If you get a timeout error message try increasing timeout value in the plugin configuration. For example:
<plugin>
<groupId>org.jboss.as.plugins</groupId>
<artifactId>jboss-as-maven-plugin</artifactId>
<version>7.9.Final</version>
<inherited>true</inherited>
<configuration>
<hostname>${jboss.hostname}</hostname>
<port>${jboss.port}</port>
<username>${jboss.user}</username>
<password>${jboss.pass}</password>
....
30000
....
4 - if problem persist, check your firewall configuration too.
I have the following problem while trying to download the artifact bbb:
[ERROR] Failed to execute goal on project phoenix-model: Could not
resolve dependencies for project
aaa:jar:4.7.0-SNAPSHOT: Failed to
collect dependencies at
bbb:jar:1.0.24-SNAPSHOT: Failed to
read artifact descriptor for
bbb:jar:1.0.24-SNAPSHOT: Could not
transfer artifact
bbb:pom:1.0.24-SNAPSHOT from/to
nexus (https://s.s.com/nexus/content/groups/public):
Hostname 's.s.com' was not verified - [Help 1]
it tries to connect to s.s.com (not the real name) but could not find it in the cacerts keystore since the site doesn't use the name s.s.com in it's certificate but rather s.j.com (and i can't change that since i'm not the admin).
Any way to tell maven or jdk to bypass that?
I am running the command from the eclipse m2 tool plugin by adding the following in the jdk arguments:
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true -Djsse.enableSNIExtension=false -Dmaven.wagon.http.ssl.ignore.validity.dates=true
currently using the embeded mvn of kepler which is at 3.2.1
any idea what is wrong?
if i used the same setting with the exception of mvn configured at external version 3.2.2 it runs perfectly fine.
Straight to specific problem
If I specify "fully qualified" SSH address with path in pom.xml
<scm>
<developerConnection>scm:git:username#hostname:/absolute/path/to/repo.git</developerConnection>
</scm>
and use it in command like
mvn --batch-mode release:prepare -Dtag=whatever -DreleaseVersion=3.0 -DdevelopmentVersion=4.0-SNAPSHOT
then I get error like
[ERROR] Failed to execute goal org.apache.maven.plugins:maven-release-plugin:2.3.2:prepare (default-cli) on project maven_dependencies: Unable to tag SCM
[ERROR] Provider message:
[ERROR] The git-push command failed.
[ERROR] Command output:
[ERROR] fatal: 'hostname/absolute/path/to/repo.git' does not appear to be a git repository
[ERROR] fatal: Could not read from remote repository.
NOTE: The semicolon between hostname and /absolute/path/to/repo.git which was in pom.xml disappeared in the error output!
Additional details
Absolute vs relative path
Actually, I'm able to use Git with non-absolute path in SSH URL (relative to usernname's home directory). For example, using
scm:git:username#hostname:path/to/repo.git
instead of
scm:git:username#hostname:/home/username/path/to/repo.git
works perfectly.
Official documentation
I've read official Maven Release documentation for Git and, because standard SSH-like URL already worked at least in relative path case, I deliberately ignore its weird URL specification:
scm:git:ssh://username#hostname[:port]/~/path/to/repository
The reason to rebel and ignore this syntax is inability to imply path relative to user's home (which SSH does by default if path does not start with /). Moreover, colon : after hostname for standard SSH-like URL is a delimiter between hostname and path (not a port number)!
This means that Git URLs for SSH have to be specifically re-formatted for Maven Release plugin - what a headache!
I'm experimenting a bit with releasing my software (I've never done this before) and so far I've been able to execute mvn release:prepare. As I'm executing release:perform I get the following error:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plug
in:2.7:deploy (default-deploy) on project img2stl: Failed to deploy artifacts: C
ould not transfer artifact nl.byterendition:img2stl:jar:0.9 from/to byterenditio
n-releases (https://localhost:443/svn/repo/releases): peer not authenticated ->
[Help 1]
I've set up a local password protected svn repository at localhost:443, so I added the following to my settings.xml in my .m2 folder
EDITED TO INCLUDE Edwin Buck's answer:
<?xml version="1.0" encoding="UTF-8"?>
<settings xmlns="http://maven.apache.org/SETTINGS/1.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/SETTINGS/1.0.0 http://maven.apache.org/xsd/settings-1.0.0.xsd">
<servers>
<server>
<id>byterendition-releases</id>
<username>username</username>
<password>password</password>
</server>
<server>
<id>byterendition-snapshots</id>
<username>username</username>
<password>password</password>
</server>
</servers>
</settings>
This is the useful section of my pom:
<distributionManagement>
<repository>
<id>byterendition-releases</id>
<url>https://localhost:443/svn/repo/releases</url>
</repository>
<snapshotRepository>
<id>byterendition-snapshots</id>
<url>https://localhost:443/svn/repo/snapshots</url>
</snapshotRepository>
</distributionManagement>
How can I get maven to access the svn repository?
Ok, as Edwin Buck suggested I shouldn't use localhost, but since I haven't been able to get it to work otherwise I thought I'd try this using a remote SVN server I use for work. Now I get a different error:
[INFO] [ERROR] Failed to execute goal org.apache.maven.plugins:maven-deploy-plug
in:2.7:deploy (default-deploy) on project img2stl: Failed to deploy artifacts: C
ould not transfer artifact nl.byterendition:img2stl:jar:0.9.5 from/to byterendit
ion-releases (https://svn.science.ru.nl/repos/estens/releases/): Failed to trans
fer file: https://svn.science.ru.nl/repos/estens/releases/nl/byterendition/img2s
tl/0.9.5/img2stl-0.9.5.jar. Return code is: 409, ReasonPhrase: Conflict. -> [Hel
p 1]
Again I can access this repo from Eclipse. Does anyone know what I'm doing wrong?
Since version 3.0.5 Maven checks the SSL certificate on https connections. You can temporarily fix this by adding the command line parameters
-Dmaven.wagon.http.ssl.insecure=true -Dmaven.wagon.http.ssl.allowall=true
Installing the SSL certificate into your JRE should permanently fix the issue.
Official documentation: http://maven.apache.org/wagon/wagon-providers/wagon-http/
Step 1. Download the certificate in DER format *.cer (/X.509 .cert) file to your local dir
(You can do this from your browser; For Chrome Click on the Lock symbol, Show Ceritficate --> Copy to File)
Step 2. Import it to Java trust store
\Program_Files\Java\jdk1.6.0_45\jre\lib\security>%JAVA_HOME%\jre\bin\keytool
-v -alias mavensrv -import -file d:\temp\apacher.cer -keystore trust.jks
Step 3. Give the path to maven as environment variables
set MAVEN_OPTS=-Xmx512m
-Djavax.net.ssl.trustStore=%JAVA_HOME%/jre/lib/security/trust.jks -Djavax.net.ssl.trustStorePassword=changeit -Djavax.net.ssl.keyStore=%JAVA_HOME%/jre/lib/security/trust.jks -Djavax.net.ssl.keyStoreType=jks -Djavax.net.ssl.keyStorePassword=changeit
Your entry in settings.xml is for a server id of localhost but you are accessing repositories with id(s) of byterendition-releases and byterendition-snapshots.
This means that maven won't recogonize and associate the credentials with these two servers, because they have different "identities". You will need settings.xml entries for byterendition-releases and byterendition-snapshots.
Now if you added an entry like
<server>
<id>byterendition-releases</id>
<username>user</username>
<password>password</password>
</server>
Then maven would meet the https authentication challenge to byterendition-releases with a username of user and a password of password, because it has a server credential entry for byterendition-releases.
You'll also have to add in an additional entry for byterendition-snapshots, or set it to have the same server id as byterendition-releases.
--- Edited to keep up with the updated question ---
You are reaching for your repository with a localhost URL. While this might work if your repository is really on the same host machine, there are lots of reasons why it might not work.
The SVN repository is on a remote SVN server, so this will fail when developing elsewhere than the remote server.
The HTTP server is not configured to resolve localhost exactly the same way that it might resolve an external request.
Either way, ditch localhost. If you can't get a stable DNS name for the machine, even putting in an IP address is a better choice. If your SVN server is on DHCP, then invest the time into getting DynamicDNS working (but really, you should get a static IP for a server if you can).
https://github.com/escline/InstallCert provides the necessary tools and provides a step by step instruction on how to import a remote certificate into the system-wide certificate store.
I found that the Java version can make a difference here.
With Maven 3.0.5 I was getting this error with Java 6, but switching to Java 7 (or newer) resolved it for me.
It looks like a SSL problem when connecting to the server. Maybe before the username and password check.
Did you config the svn server with SSL client auth? This means you need to send a client certificate to the server.
I've had lot of security issues after upgrading to OSX Mavericks
SSL problem with Amazon AWS
peer not authenticated with Maven and Eclipse
trustAnchors parameter must be non-empty
I applied this JAVA update and it fixed all my issues:
http://support.apple.com/kb/DL1572?viewlocale=en_US
I'm using maven 3.5.3, and I choose to temporarily fix this SSL issue by adding the command line parameters according to above answers. But the parameters's format seems changed a little.
-D maven.wagon.http.ssl.insecure=true -D maven.wagon.http.ssl.allowall=true
Sorry I can't comment #Alex Punnen's answer, so I have to write a new answer.
I had the same issue using maven 3.6.0. All proposed solutions (using -Dmaven.wagon.http.ssl.insecure=true, -Dmaven.wagon.http.ssl.allowall=true, update CA store) did not work for me. Actually the deployment failed not on the first module but on the ~25ish or so, and was successful for all previous modules. Thus I assumed that in general the SSL handling was ok and there was general issue in the local <> server connection or certificates.
Leaving me quite confused for some time, I today stumbled across this jacoco issue where they mention the deployAtEnd parameter. Adding this parameter to my pom.xml as part of the deploy plugin configuration solved the issue for me.
However, I'm yet not clear on why the deployment failed on some later module and not on the first already.
I am working on NetBeans 7.0 which has maven 3.0.3 by default.... last week I opened a project which was developed using Maven 2.2... Now even after closing that project.. NetBeans is not allowing me to create any new project...not even the sample projects of NetBeans.... Every time I get the following error ...
Plugin org.apache.maven.plugins:maven-resources-plugin:2.4.3 or one of its dependencies could not be resolved: Failed to read artifact descriptor for org.apache.maven.plugins:maven-resources-plugin:jar:2.4.3: Could not transfer artifact org.apache.maven.plugins:maven-resources-plugin:pom:2.4.3 from/to central (http://repo1.maven.org/maven2): Error transferring file: repo1.maven.org: Unknown host repo1.maven.org -> [Help 1]
To see the full stack trace of the errors, re-run Maven with the -e switch.
Re-run Maven using the -X switch to enable full debug logging.
For more information about the errors and possible solutions, please read the following articles:
"**[Help 1] http://cw
iki.apache.org/confluence/display/MAVEN/PluginResolutionException"**
any help regarding this will be appreciated....
Thanks in advance,,
Unknown host repo1.maven.org
Try setting your DNS to 8.8.8.8 or 8.8.4.4 these are google's DNS which can resolve this name
in Linux machine.
type
sudo gedit /etc/resolv.conf
add an entry of nameserver with the mentioned IP