Is the distribution package (.tgz) of Apache Kafka available as a Maven dependency? - maven

I would like to add Apache Kafka .tgz archive contents to my Maven project's distribution package. I was not able to find the archive on Maven Central. Any reason why it is not there?

Maven Central generally has jars and POMs, not tarballs.
The kafka module, (not kafka-clients) includes everything needed to programmatically run a KafkaServer class, though you'd want KafkaServerStartable to initialize that

Related

How to convert a Gradle project's dependencies into a local maven repository?

I am building a Java SDK that can be used to work on my app.
When I run ./gradlew :my-sdk-library:dependencies I get my transitive tree of deps.
All my customers refuse to access libraries on the internet. And they do not have a local maven proxy either, so I need to supply my sdk jars and the other open source jars too.
So I would like to convert that into a local maven repository so that I can send it to those who cannot access our maven repository that is hosted on Artifactory, nor Maven central.
The naive approach is the make a shaded (shadow) jar containing all the libraries then import it as a implementation file(path-to-shaded.jar). But that is not good because IDEs do not like huge 200MB shaded jar files. And you lose all the dependency management provided by the GAV values.
So I want to produce a local maven repository I can send along with the SDK.
So if this were Maven I would go to a fresh VM, run mvn install, then just copy the ~/.m2/repository folder and there you go.
I did find a project https://github.com/sinsongdev/gradle-cash-to-maven-repo which might work to create a local maven repo using the gradle cache, but it is not widely used. I'll give it a try.
Basically I want exactly what https://github.com/johnrengelman/shadow does but instead of producing an uber jar, to create a local maven repo.
Is there some option like that in Gradle to create an offline copy of the repo or cache so that developers who are behind strict firewalls can use your SDK?

Flink: Why is Hive dependency flink-sql-connector-hive not available on Maven Central?

According to Flink SQL Hive: Using bundled hive jar:
The following tables list all available bundled hive jars. You can pick one to the /lib/ directory in Flink distribution.
flink-sql-connector-hive-1.2.2 (download link)
flink-sql-connector-hive-2.2.0 (download link)
...
However, these dependencies are not available from Maven central. As a work around, I use user defined dependencies, but this is not recommended:
the recommended way to add dependency is to use a bundled jar. Separate jars should be used only if bundled jars don’t meet your needs.
I wonder why the bundle jars are not available in Maven central?
Follow-up: Since they are not available from Maven central, I wonder how to include them in pom.xml in order to run mvn package, if I don't want to use user defined dependencies?
Thanks!
The answer is, I am wrong. flink-sql-connector-hive does exist in maven central, see https://search.maven.org/artifact/org.apache.flink/flink-sql-connector-hive-2.2.0_2.11/1.12.0/jar.

Can i configure maven to use custom build number for Snapshot version

If i am deploying a snapshot jar file using mvn deploy, then maven generates the jar file name depending based as follows
projectname-1.0-20170509.204524-1.jar
That is
$project1-$version-$date.$time-$buildnumber.jar
Can i configure maven to use custom jar file name?
Eg projectname-1.0-1.jar, projectname-1.0-2.jar
In your case, the artifact's version is a snapshot. Snapshot artifacts (since Maven 3.x) always must have a timestamped version.
You should not be changing this.
If, you would like to change it for purposes other than for deploying to an artifact repository, I believe you can do this via the finalName, or via the maven-assembly-plugin.
Either way, this is (usually) a very bad idea.

Add multiple JARs and Javadoc to local Maven repository

I have a number of JAR files that comprise two different Java SDKs for BOXI R3.1: BusinessObjects Enterprise Java SDK and the Web Services Consumer Java SDK.
The BusinessObjects Enterprise Java SDK has a number of 'core' JARs:
biarengine.jar
biplugins.jar
cecore.jar
celib.jar
ceplugins_client.jar
ceplugins_core.jar
ceplugins_cr.jar
cereports.jar
cesession.jar
ceutils.jar
corbaidl.jar
ebus405.jar
flash.jar
SL_plugins.jar
logging.jar
pluginhelper.jar
xcelsius.jar
and a number of dependencies:
asn1.jar
backport-util-concurrent-2.2.jar
certj.jar
commons-logging.jar
derby.jar
freessl201.jar
jsafe.jar
log4j.jar
rascore.jar
sslj.jar
The Javadocs are available as a ZIP file.
The situation is similar for the web-services SDK, so I will omit the details.
Goal: package each SDK and its Javadoc as a local, Maven repository (it doesn't appear that SAP is providing a remote one).
Questions:
can one Maven repository contain multiple JAR files? The mvn deploy:deploy-file plugin seems to only work on a single file: How to add a jar, source and Javadoc to the local Maven repository?
should Javadocs be kept in ZIP format in a Maven repository?
if i choose to make to repos for a given SDK (i.e. core and dependencies), is specifying the linkage as easy as editing the core repos' configuration file?
rather than creating a repo for the dependencies, I'm assuming that it would be better to identify and reference existing Maven repos (e.g log4j.jar). Will this lead me to JAR hell?
Yes a maven repo can contain multiple files, you can execute mvn deploy:deploy-file on each one (using -Djavadoc and -Dsources as needed).
To specify dependencies for a jar, create a pom file for it (with dependencies) and use -DpomFile (and omit -DgeneratePom) in mvn deploy:deploy-file.
Yes you should not re-invent the wheel and deploy artifacts to your repository that are already in central. You can use tools like http://mvnrepository.com to search for your jars (look META-INF/MANIFEST.MF in your jars to find the version).
For more info see: http://maven.apache.org/plugins/maven-deploy-plugin/deploy-file-mojo.html.

Why can't I download MysqlConnectionPoolDataSource sources and find javadocs with Maven?

I see that for some jars Maven (m2e) automatically downloads sources and/or javadocs. But not for com.mysql.jdbc.jdbc2.optional.MysqlConnectionPoolDataSource class in mysql-connector-java ver. 5.1.18.
Why?
Is this my mistake or sources and docs are not on repository? How to check artifact has no sources using http://search.maven.org/ website?
The sources are not delivered into Maven Central by the vendor. I assume MySQL does not like to put the sources of their driver onto Maven Central.
Checking for sources is simple, cause there must be a package called mysql-connector-java-5.1.18-sources.jar which isn't their.

Resources