qpid-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Robbie Gemmell <robbie.gemm...@gmail.com>
Subject Re: [java][dumb question] How do you build the qpid java tree?
Date Mon, 23 Jun 2014 22:24:19 GMT
Hi Alan,

>From the qpid/java directory, running this will build everything, creating
the jars and the release archives. Remove the 'skipTests' to let the unit
tests run:
mvn clean package -DskipTests

Replace 'package' with 'verify' and it will do basically the same, but now
removing the 'skipTests' will make the unit tests and system tests run:
mvn clean verify -DskipTests

Replace 'package' with 'install' and it will do the same as above, but
additioanlly install the artifacts in your local repo (~/.m2/repository)
once they are built:
mvn clean install -DskipTests

The reason it is failing currently when you do 'mvn compile', is that some
of the broker plugin module tests depend on the 'test jar' from the
broker-core module. Because you havent built that due to the command you
used (it happens at 'package'), havent previously installed them in your
local repo, and they dont exist in the snapshots repo (because test jars
aren't usually deployed), it has ultimately failed to find what it needs to
satisfy a test-scope dependency resolution that it is undertaking (which is
occurring because some of the build plugins being used require a test-scope
resolution to work, annoyingly). The act of depending on test jars from
other peer modules does somewhat suck for this reason, but was a necessary
evil to keep the Ant build working at the time of introducing the maven
build, while avoiding duplicating lots of code. Removing such dependencies
would be good. You currently need to either avoid 'compile', or only use it
after previously doing 'install' for the things whose 'test jar' is being
depended upon. I always tend to use package as my base build phase (though
not for that reason, simply because it packages everything :P).

While the client doesnt depend on e.g the broker, essentially all of the
modules tests depend on the 'qpid-test-utils' module, and it is that
dependency it is failing to resolve. To build only the client as you tried,
qpid-test-utils would need to exist either in the snapshots repo (which it
currently doenst, but will in future, see below), or you would first need
to install it in your local repo by first doing a 'mvn install' which
includes it first.

One of the background issues here is that we arent currently deploying new
snapshots. The ASF Jenkins installation was entirely messed up at the time
I was trying to cut the builds across, and I never got back to it. Jenkins
seems happy just now, and there has been less complaining about it on the
builds mailing list recently, so I'll take an action to ensure we start
publishing new snapshots again soon. The snapshots being there would just
have made certain things fall back to the remote artifacts rather than
fail, but what you were trying ultimately still wouldnt have worked in this
case. You can entirely forego the use of the remote snapshots and achieve
the same result by locally installing the artifacts as outlined above.

[Finally, on the baiting:

Maven has a couple of core ways of 'using things you built locally' rather
than remote artifacts. The first is that anything currently being built in
the same 'reactor build' is available to the modules that come later in the
same reactor, so e.g running in qpid/java means the output of 'common' is
available to 'client' on the fly to satisfy the dependency rather than
looking it up from a repo. The second is that anything depended on that
isnt currently being built in the same reactor gets resolved via the local
repo [and then the snapshots or release repositories if needed], so if you
want to build module A and then completely seperately build module B that
depends on its output, you would ensure to install module A in your local
repo so that maven can do exactly what you seek]


On 23 June 2014 19:52, Alan Conway <aconway@redhat.com> wrote:

> So I found
>  https://cwiki.apache.org/confluence/display/qpid/Qpid+Java+Build+How+To
> (a README would be nice, I will to write one when I figure this out.)
> My Java and Maven versions are good:
> [aconway@gonzo java (trunk *%)]$ java -version
> java version "1.7.0_55"
> [aconway@gonzo java (trunk *%)]$ mvn --version
> Apache Maven 3.1.1 (NON-ClsANONICAL_2013-11-08_14-32_mockbuild;
> I went to the top level qpid/java direcotry and did:
>   mvn compile
> Which compiled a bunch of stuff and then stopped with:
> [ERROR] Failed to execute goal on project
> qpid-broker-plugins-access-control: Could not resolve dependencies for
> project
> org.apache.qpid:qpid-broker-plugins-access-control:jar:0.30-SNAPSHOT:
> Failure to find org.apache.qpid:qpid-broker-core:jar:tests:0.30-SNAPSHOT
> in http://repository.apache.org/snapshots was cached in the local
> repository, resolution will not be reattempted until the update interval
> of apache.snapshots has elapsed or updates are forced -> [Help 1]
> I really only need the client and it says the projects have indepenent
> POMS, so I tried
>   cd client; mvn compile
> That gave me:
> mvn compile
> [INFO] Scanning for projects...
> [INFO]
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Building Qpid AMQP 0-x JMS Client 0.30-SNAPSHOT
> [INFO]
> ------------------------------------------------------------------------
> [WARNING] The POM for org.apache.qpid:qpid-test-utils:jar:0.30-SNAPSHOT
> is missing, no dependency information available
> [INFO]
> ------------------------------------------------------------------------
> [INFO]
> ------------------------------------------------------------------------
> [INFO] Total time: 0.526s
> [INFO] Finished at: Mon Jun 23 14:23:49 EDT 2014
> [INFO] Final Memory: 6M/107M
> [INFO]
> ------------------------------------------------------------------------
> [ERROR] Failed to execute goal on project qpid-client: Could not resolve
> dependencies for project org.apache.qpid:qpid-client:jar:0.30-SNAPSHOT:
> Failure to find org.apache.qpid:qpid-test-utils:jar:0.30-SNAPSHOT in
> http://repository.apache.org/snapshots was cached in the local
> repository, resolution will not be reattempted until the update interval
> of apache.snapshots has elapsed or updates are forced -> [Help 1]
> [ERROR] To see the full stack trace of the errors, re-run Maven with the
> -e switch.
> [ERROR] Re-run Maven using the -X switch to enable full debug logging.
> [ERROR] For more information about the errors and possible solutions,
> please read the following articles:
> [ERROR] [Help 1]
> http://cwiki.apache.org/confluence/display/MAVEN/DependencyResolutionException
> I tried "rm -rf ~/.m2" but that just did more downloading before falling
> over as before.
> I followed the "help" link which suggested maybe some network problem
> connecting to the repository. I was able to open this in my browser:
> http://repository.apache.org/content/groups/snapshots/org/apache/qpid/qpid-broker-plugins-access-control/0.30-SNAPSHOT/
> There's a bunch of substitutions of / for . etc. but that sure looks
> like the resource maven says it can't download. So I don't think I have
> a network problem.
> Please, just tell me how to make it work!!! And then please put it in a
> README in the top level Java directory so others can learn too!!
> [ARRGH! I swore there would be no maven-baiting in this email but I am
> weak!!! Please don't read what follows: I think  it's great that maven
> can find dependencies for us. I think it's totally insane that maven
> refuses to build source code that _I have checked out locally_ because
> it can't download a pre-compiled snapshot _of source code that *I have
> checked out locally*_!!!]
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe@qpid.apache.org
> For additional commands, e-mail: dev-help@qpid.apache.org

  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message