Specifying proxy for cxf-codegen-plugin - maven

How do you specify a proxy that needs to be used by cxf-codegen-plugin. I tried specifying proxy in the maven settings.xml, but that was not picked up.

maven settings.xml in ~/.m2 folder works just fine for me for cxf-codegen-plugin. Example:
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>proxy.example.com</host>
<port>8080</port>
<username><!-- username --></username>
<password><!-- pass --></password>
<nonProxyHosts>*.local|*.example.com</nonProxyHosts>
</proxy>
</proxies>

I've tried:
mvn -Dhttp.proxyHost=[_] -Dhttp.proxyPort=[_] clean package
([_] -> Your proxy data)
On console and worked.

Related

How to make maven search for artifacts in local repository

I have a project that worked fine on another pc. And now i'm trying to run it on another pc. There is no acces to proxy. And after any action it says that
couldn't transfer artifact. no route to host
But i have all depandencies in local repository, maven just doesn't want to take it from there. Is there a way to make him take all artifacts from local repo first?
There must be a version difference in the artifacts you have in your local repository and the ones mentioned in pom.xml
Your error : couldn't transfer artifact. no route to host
is because you have'nt added proxy to your pom. eg :
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
-->
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>username</username>
<password>yourpassword</password>
<host>yourhost#host.com</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
</proxies>
Add it to the settings.xml file in conf folder of maven and try again

Not able to create maven project under eclipse mars even after setting the proxy

Hi Everyone ,
I am new to Maven environment . Tried all possibilities of enabling the proxy under settings.xml .But no use. Since the maven is integrated in mars I couldn't find the settings.xml and created my own under .m2 . And also tried with the external maven also .But no results .
Below is my settings.xml .
<settings>
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<host>hostname</host>
<port>port</port>
<username></username>
<password></password>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
</settings>
The failed request from before has been cached by Maven. You need to run the command with the -U flag to retry. (Or wait until the caching has expired...)

Unable to get external maven dependencies for Junit and Selenium in IntelliJ

I'm not sure if the issue of not being able to sync the dependencies is to do with proxy or firewall.
I have been trying to make it work but no joy.
Is there any solution for someone in my situation?
I have, reinstall, imported project, run maven clean and install in cmd but still no dependency has been imported.
Message displays 'Dependency "org.seleniumhq.selenium-java:2.53.0" not found'
I believe I found the answer. The issue is indeed proxy and by adding those lines in the settings.xml between with your/company proxy details it should work.
<proxies>
<proxy>
<id>myproxy</id>
<active>true</active>
<protocol>http</protocol>
<host>xx.xx.x.xxx</host>
<port>1234</port>
<nonProxyHosts></nonProxyHosts>
</proxy>
</proxies>
In some instances you may need to add the username and password to make it work.
<username></username>
<password></password>

proxy without authentication in settings.xml

I am looking for a way to set system proxy settings in settings.xml. If the proxy server does not need authentication, can I leave the username and password tag blank ? How can I achieve this ?
I can not find any documents from maven on this : http://maven.apache.org/guides/mini/guide-proxies.html
There is a same scenario in my team. Following are our settings. Just don't include those tag in your settings.xml
<proxies>
<proxy>
<active>true</active>
<protocol>http</protocol>
<port><port-number></port>
<host><your-prox-server></host>
</proxy>
</proxies>

maven failure to resolve archetype ear-jee5

I am trying to create an EAR maven module project (in eclipse) with ear-jee5 as the archetype. It fails with the following error.
Could not resolve archetype org.codehaus.mojo.archetypes:ear-jee5:1.3 from any of the configured repositories.
Could not resolve artifact
Missing org.codehaus.mojo.archetypes:ear-jee5:pom:1.3
Could someone please help me resolve this error or show me an alternate way to create the project structure for Maven EAR module?
Thanks.
Apparently, the failure seems to be because I am behind a proxy/firewall at office. The solution is add proxy configurations or add repository mirrors not blocked by firewall in your settings.xml.
hope this helps someone.
Add proxy
<proxies>
<!-- proxy
| Specification for one proxy, to be used in connecting to the network.
|
<proxy>
<id>optional</id>
<active>true</active>
<protocol>http</protocol>
<username>proxyuser</username>
<password>proxypass</password>
<host>proxy.host.net</host>
<port>80</port>
<nonProxyHosts>local.net|some.host.com</nonProxyHosts>
</proxy>
-->
</proxies>
or mirrors
<mirrors>
<!-- mirror
| Specifies a repository mirror site to use instead of a given repository. The repository that
| this mirror serves has an ID that matches the mirrorOf element of this mirror. IDs are used
| for inheritance and direct lookup purposes, and must be unique across the set of mirrors.
|
<mirror>
<id>mirrorId</id>
<mirrorOf>repositoryId</mirrorOf>
<name>Human Readable Name for this Mirror.</name>
<url>http://my.repository.com/repo/path</url>
</mirror>
<mirrors>
Thanks

Resources