Where to download Square Wire wire-compiler-VERSION-jar-with-dependencies.jar? - proto

I want to use protobuf in Android , and I find Square Wire. https://github.com/square/wire
In the document, there is a command to gerate Java file.
% java -jar wire-compiler-VERSION-jar-with-dependencies.jar \
--proto_path=src/main/proto \
--java_out=out \
squareup/dinosaurs/dinosaur.proto \
squareup/geology/period.proto
I download the released zip, but there are all source code, no Jar file.
Then ,I went to Maven Respoist, but there is no wire-compiler-VERSION-jar-with-dependencies.jar

You can build it yourself with maven
Get sources, install maven and run
mvn package
You'll find wire-compiler-VERSION-jar-with-dependencies.jar in wire/wire-compiler/target/ directory.

Wire's README has a link to download the latest JAR from maven.org.

Related

How to create a jar from a github Project

I want a jar file for the project https://github.com/tsantalis/RefactoringMiner but I don't see any link on the site which gives me jar file and there is no POM.xml
I need to run the project on Eclipse
From the page you linked:
In order to build the project, run ./gradlew jar (or gradlew jar, in Windows) in the project's root directory. Alternatively, you can generate a complete distribution zip including all runtime dependencies running ./gradlew distZip.

Install scala source without change pom

I can install java source from command line:
mvn source:jar install
So how can I install scala source only with command?
I think this answer applies to your question.
Scala is a dependency of maven project, so you can fetch it by
mvn dependency:sources
To install jar with sources without updating pom.xml
mvn source:jar install

How to build a bundle sbt from source for offline use?

My goal is to have a sbt jar file with all dependencies in order to create a debian package, so it could be install on machine without check/install package at first run.
Is it the right choice use sbt-assembly to build a sbt jar with all dependencies?
The sbt binary version doesn't come with dependecies and sbt download them at first run.
I don't fully understand your use case, but would sbt-native-packager .deb format be a good fit?

Create a Maven project with hibernate

I need to create a maven project, which also has hibernate. How do i write the maven create project command.
The IDE i'm using is Eclipse.
If you're asking what archetype would be best to use from the command line, then the below will give you a nice list to choose from:
mvn archetype:generate
However, you say you're using Eclipse - if so, take advantage of the Maven integration and you'll be offered a similar choice when creating the project (basically just a nice GUI around archetype:generate and friends)
What you need is an appropriate maven archetype E.g.:
mvn archetype:generate -B \
-DgroupId=com.my-company.my-project \
-DartifactId=my-project-domain \
-DpackageName=com.company.project.domain \
-DarchetypeGroupId=com.rfc.maven.archetypes \
-DarchetypeArtifactId=jpa-maven-archetype \
-DremoteRepositories=http://maven.rodcoffin.com/repo \
-DarchetypeVersion=1.0.0
You can find some Hibernate archetypes here http://docs.codehaus.org/display/MAVENUSER/Archetypes+List
or use google

How can I let sbt download the source of scala-library.jar?

I know if I add withSources when I define one dependency, sbt can download that sources jar file automatically.
For example,
val specs = "org.scala-tools.testing" % "specs_2.8.1" % "1.6.6" % "test" withSources ()
But for the scala-library.jar and scala-compiler.jar, I don't need define them explicitly, how can I get sbt download their sources for me? So, I don't need config it manually after generate idea project using sbt-idea-plugin.
You have to change the boot properties. There is a nice description in the recent blog decodified from Mathias:
"How to make SBT download scala library sources" (started from #hseeberger key starting points)
Here is the relevant part (in case that link ever goes stale)
First, forget about trying to find some “hidden” setting in your SBT project definition enabling Scala library source download! It does not exist (at least not in SBT version 0.7.x).
Rather, there are these two things you need to do in order to whip SBT into submission:
Create an alternative configuration file for your SBT launcher.
Make the SBT launcher use it.
These are the steps in detail:
Find your sbt-launcher-0.7.x.jar file.
Since I’m on OS/X and use SBT via Homebrew mine lives at /usr/local/Cellar/sbt/0.7.5.RC0/libexec/sbt-launch-0.7.5.RC0.jar.
Extract the sbt.boot.properties from the sbt sub directory in the launcher jar
Fire up your favorite editor and change line 3 to classifiers: sources (uncomment the line)
Find the sbt script file you created during your SBT setup (e.g. ~/bin/sbt, or, when using Homebrew, /usr/local/Cellar/sbt/0.7.x/bin/sbt)
Add the path to your tweaked sbt.boot.properties file, prepended with an ’#’ character and in double quotes, as the second-to-last argument of the java call.
This is what my sbt script file looks like:
#!/bin/sh
java -Xmx768M -XX:+CMSClassUnloadingEnabled -XX:MaxPermSize=256m \
-jar /usr/local/Cellar/sbt/0.7.5.RC0/libexec/sbt-launch-0.7.5.RC0.jar \
"#/usr/local/Cellar/sbt/0.7.5.RC0/libexec/sbt.boot.properties" \
"$#"
Once you have completed these steps SBT should happily download the scala-...-sources.jar files for the Scala compiler and standard library for any new project you create.
To have SBT do this for an existing project, you have to manually delete the project/boot/scala-{version} directory before performing an ‘sbt update’ (SBT does not fetch additional source artifacts if the main jar is already present).
Once you have a custom sbt.boot.properties file, there are also other ways to supply it to the SBT launcher.
See SO question "how do I get sbt to use a local maven proxy repository (Nexus)?"
Based on Michael Slinn comments:
If you are using sbt 0.11.x and above, use this command:
sbt update-sbt-classifiers
Two pieces of information.
(1) SBT Documentation
http://www.scala-sbt.org/0.13.5/docs/Detailed-Topics/Library-Management.html
and I quote:
"To obtain particular classifiers for all dependencies transitively, run the updateClassifiers task. By default, this resolves all artifacts with the sources or javadoc classifier."
This means you should not need to do anything, but you can make it explicit and put in you build.sbt:
transitiveClassifiers := Seq("sources", "javadoc")
To actually get the sources downloaded by SBT then you do:
"updateClassifiers"
(2) If you are working with Eclipse scala IDE - most likely you are as development of plugins for Eclipse/Netebeans is a lot more active for eclipse - then you should configure your ecplise to find out the sources if you do the following.
EclipseKeys.withSource := true
Here is the documentation you should read,
https://github.com/typesafehub/sbteclipse/wiki/Using-sbteclipse