Nutch 2.2.1 build stuck issue - java

I am having issues building Nutch 2.2.1 behind my company firewall. My build gets stuck here:
[ivy:resolve] :: loading settings :: file = ~/nutchtest/nutch/ivy/ivysettings.xml
When I contacted the hosting admin, they said - "Ant is trying to download files from internet and it will have problems with our firewalls. You will either have to download the files yourself and then scp/sftp them to the machine. Unfortunately we don't have an http proxy."
From further digging, I could see Ant is trying to access this link http://ant.apache.org/ivy/. Could anyone please advise what I should do to make Ant compile Nutch without accessing the internet? I can download required files from http://ant.apache.org/ivy/ and scp/sftp to the server but I am not sure what files to download and where to put them?

Run the build on a machine connected to the internet. Ivy will cache your build's dependencies here (by default):
$HOME/.ivy2/cache
A populated cache will enable you to repeat the build inside your firewall.
I would also suggest enhancing the build to run the ivy report task. This will produce webpage listing the dependency tree. If you want to build a local repository this information is very useful.
Finally consider running a repository manager inside your firewall. Tools like Nexus and Artifactory make repository hosting a lot simpler to manage. Consider obtaining a firewall exception for this server. Repository managers are used to cache useful internet repositories like Maven Central.

Related

Maven proxy configuration with Nexus

I am using Nexus and have configured maven-proxy and maven-hosted repositories, added them to a group repo and using that repo through settings.xml. Now when a new dependency is added in pom, maven-proxy goes to maven central and downloads it. However, I do not want this.
My goal is to stop replying on Maven central completely, but I know it won't work until my hosted repository contains everything that maven needs.
Issue is that Maven plugins like compiler, clean, jar etc. downloads tons of dependencies on its own. If I remove connection to maven proxy, how do I get all that list and then how do I make sure that I put whatever is needed in my hosted repository ?
Should I even try to put such artifacts in my hosted repo ? Is there any other better approach ?
You cannot really do that manually, the number of artifacts is way too large.
You can let Maven download all needed artifacts, then copy that from a remote to a hosted repository and work with that (until you need something new).
But it is still painful. I would not do that.
If your concern is security, I would use an open source security scanner instead of blocking internet access altogether.

Maven dependencies fail to download

I am working in a corporate network.
I can't download artifacts through maven, but I can download them individually through my web browser.
This is the error:
[ERROR] Non-resolvable import POM: Could not transfer artifact com.fasterxml.jackson:jackson-bom:pom:2.9.8 from/to central (https://repo1.maven.org/maven2): Can't connect to SOCKS proxy:Connection refused: connect # org.springframework.boot:spring-boot-dependencies:2.1.3.RELEASE, C:\Users\alfonso\.m2\repository\org\springframework\boot\spring-boot-dependencies\2.1.3.RELEASE\spring-boot-dependencies-2.1.3.RELEASE.pom, line 605, column 25
For what I have googled, a lot of people solve this configuring a proxy. I don't understand why I would need that, because as I said, I can download the dependencies trough my web browser.
If configuring a proxy is the only way, any idea as to how to identify my company's proxy?? I've no idea what it is.
Is it supposed to be a "maven proxy" or just a simple proxy? I ask because IT people probably don't know much about java and maven. So if I ask them what is our maven proxy, they may not know what I'm talking about (if it is something at all he he)
Downloading the dependencies through a browser is a nightmare because standard Maven projects need hundreds of artifacts (Maven plugins etc.).
The proxy is not a "Maven proxy", but a company thing. You need to find out which proxy allows access to MavenCentral. If you don't have such proxy, you need to discuss a solution like e.g. setting up your own Nexus/Artifactory and giving it access to MavenCentral.

Gradle Build Error: Failed to appy plugin[class 'org.gradle.api.plugins.JavaPlugin

Gradle Build fails with the above error. I am going thru firewall and proxy server settings. I do have local nexus repository hosted in the company network.
The module which is failing uses free marker templates and bundles them into a deployable jar. I suspect I am not including the java plugin in the repository.
Gradle plugin resolution uses a different configuration than dependency resolution.
You most likely need to customise it as well. The exact details will depend on your setup and constraints.
See the relevant documentation

What is the best way to use maven offline without sync with remote repo?

I am working in a company network which blocks connectivity to remote maven repo,What is the best way to use maven offline without sync with remote repo ?
Do we have option without setting up a mirror in local machine.
This is not ideal, but you could build the project outside your company network (at home), then take a copy of your .m2 directory back to your work computer. This works in a pinch and only until you need more dependencies.

Uploading local maven repository to archiva

I am setting up a local repository using Apache Archiva. After setting up now I need to copy the libraries that got downloaded into my local maven repository into archiva. Currently I am manually copying it but it is very tedious process and I am planning to automate it using some scripts. Is there any better approach to do this?
I'm trying to write a plugin for this here which is able to copy jars and poms for all dependencies in all Configurations (including transitive dependencies). You might be interested in this code
Note: I've got a failing test here because I can't currently get the parent pom xml via the Gradle API's. I raised a feature request in Gradle here
There's a suggestion on the issue to use the IvyPot plugin... I haven't tried this myself but might be worth a shot.

Categories