Where do I get the google artifact from? - guava

So I'm trying to build guava from source with maven2 but it seems to need the 'google' artifact as parent. Where is the upstream website of this artifact? (yes, I need the source, not just the artifact).

The guava-parent artifact is in the main source repo for guava under maven/pom.xml
Just do "mvn -N install" from the maven directory and you'll have it in your local repo. Having said that, it should have automatically picked it up - I'll check out a fresh workspace with an empty local repository and make sure the main guava project will automatically find the parent pom.

Related

M2Eclipse: Automatically execute Maven when pom.xml changes?

For an Eclipse plugin project I need a p2 local repository to be automatically deployed with dependencies defined in the pom.
The best way (or the only way that really works) to do so is to use org.reficio plugin p2-maven-plugin.
Therefore I created a general project in Eclipse to prepare and hold the repository and a pom.xml that generates this repository.
When I execute the goal p2:site the repository is created successfully.
Now I am trying to make Eclipse with M2Eclipse to automatically execute that goal whenever the file pom.xml has ben changed (e.g. the user has added a new dependency or the file has been changed because an updated file has been downloaded from the SCM repository.
Is there a way to make M2Eclipse respectively it's Maven Project Builder to execute this phase automatically?

maven publish jar to .ivy

I have a maven project, which will produce a jar file, and I want to use it in another sbt project. Is there any method to publish the jar file to .ivy rather than in .m2?
I try to put the jar file in the libs under the sbt project, but it does not work. and use the mvn install the jar to the .m2 does not work too.
As I understand it you have a maven project and an SBT project. The SBT project depends on the artifact produced by your maven project.
You ask how to publish the maven produced artifact to your local .ivy so it can be picked up by the SBT project.
you can probably achieve that using an ant task in the maven build.
However I'd like to suggest different angles :
Make the sbt project aware of the local .m2
Simply add resolvers += Resolver.mavenLocal to your sbt build definition, if you don't want to pollute the main build definition, add that line to a local.sbt file alongside the main build defition. SBT merges all the .sbt files found at the project root.
Publish to a controlled repository
This is especially useful if you want the build to be easily reproduceable outside of your local machine.
The idea is simply to publish the maven project to an actual server, either an internal nexus/artifactory server for proprietary code or to a public artefact hosting (such as bintray)
I use bintray all the time to publish custom builds of opensource projects while I wait for PRs to be merged in master and published an the official build.
Add your artifact server as a resolver to the SBT project and you are good to go :)

Maven dependency in Local Repository but not being picked up

The dependency I'm using is for Oracle which, reading from another post, is not included in the default maven repo due to legal issues. For this reason I've added the dependency to my local repo using:
mvn install:install-file -Dfile=/home/<myname>/development/Libraries/ojdbc6.jar
-DgroupId=com.oracle -DartifactId=ojdbc6 -Dversion=11.2.0.3 -Dpackaging=jar
My problem is that maven is attempting to pull the file from the default remote repo and failing although it was my understanding that the local repo is checked first.
My install of maven is the default version packaged with STS (basically Eclipse).
Kind Regards,
Justin
Checking whether the jar got properly installed in your local repository might help. If you navigate to the .m2/repository/com/oracle/ojdbc6/11.2.03/ you should find the jar present there.
if this problem is present, i can suggest you to select the Offline option on maven uptade project. Whith this option enabled, the maven install search for local repository.

Maven project showing as pomUpdated instead of jar

I am using Eclipse with m2e. I have one ProjectA that is built as a Maven project and is packaged as a Jar. When I add ProjectA as a dependency in ProjectB, it is showing up as packaging .pomUpdated instead of Jar. I am using the feature 'Resolve dependencies from Workspace projects'.
Any ideas? I've tried forcing updates/snapshots and a bunch of other things, but nothing has fixed the problem. I've had this work successfully before with other projects referencing ProjectA, but this time it's not working.
EDIT:
The issue turns out to be that ProjectA not building, but I can't figure out why. Apparently it is having trouble finding its parent project on my Nexus server, but I have it setup to find the parent using a relative path, which should mean it will find it locally, right? Why would it be looking at Nexus instead?
Failure to find com.foobar:MyProject:pom:0.0.1-SNAPSHOT in
http://myserver/nexus/content/groups/public was cached in the local
repository, resolution will not be reattempted until the update interval of nexus has
elapsed or updates are forced -> [Help 1]
EDIT 2:
I fixed the issue with ProjectA not building, but now I'm back to only seeing pomUpdated available for ProjectB to use... very frustrating!
The issue was with my Sonatype Nexus setup being incorrect.

Dependency and workspace projects

I have a Maven project called Utils that i'm working on. I also have another project, called A, that uses classes of Utils. So, I've added a dependency to Utils in the POM of A. I precise that the two projects are not installed in the local repository (or another private repository). When I try to package the project A, I get an error because Maven tries to get the Utils project from the local repository and central repository, but it's not there. I don't want to install the project because it's not final, i don't want to give it a version because there is no release.
Thanks
It's safe to install the project into local repository. Just use mvn install in the Utils' project folder. Anytime you do install it will be replaced by newest in your local repo.
But don't deploy it, it means others could use it. In comparison, your local repo is used only by you.
It seems that the Maven plugin on Eclipse provides this possibility. And there is no need to install the artifacts corresponding to the active projects in the local repository. It seems that the plugin considers the workspace as a second local repository (you can see this using the Maven repositories view). First, the Workspace resolution feature must be enabled (Right click on the project then under Maven). When I want to run the project, I use Run configurations wizard, and Resolve workspace must be checked.
Is it a good solution? I don't know if it just seems to work or if it really works.
Thanks