river-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Greg Trasuk <tras...@stratuscom.com>
Subject Re: Getting Started
Date Thu, 08 Jan 2015 20:55:01 GMT

Hi Patricia:

Maven is pretty mainstream at this point in time (very much in open source, it’s also beginning
to hit the later adopters in the corporate world).

Having said that, the Maven site makes it look much harder than it is.  Let me boil it down
a little.

1 - From the command line...
============================

- Download the latest Maven from http://maven.apache.org/download.cgi
  - You probably want the binary zip
- Unpack that file somewhere convenient
- The unpacked file contains a ‘bin’ folder.  Put that ‘bin’ folder in your command
path
- At the command line, type ‘mvn -version’. Does that run?  If yes, you’ve installed
Maven.
- Now you can go to the project directory, e.g. river-examples, and type ‘mvn install’.

2 - From Netbeans
===============

- Netbeans includes Maven 3.0.5, which I don’t think has the markdown processor for the
documents that I created.  So it’s better to use a local Maven installation, so…
- Download the latest Maven from http://maven.apache.org/download.cgi
  - You probably want the binary zip
- Unpack that file somewhere convenient.  This is your “Maven Installation” dir.
- In Netbeans, select Preferences - > Java -> Maven and point it to the unpacked Maven
dir.

3 - What Maven Does…
===================

Maven processes a set of source files and/or submodules to produce an ‘artifact’.  Typically
an artifact is a jar file, but it could also be an unpacked directory.

We talk about a ‘Maven Module’.  This is a folder that contains a file called ‘pom.xml’
and all the source code and/or submodules.  Source code is under ‘src’.  Anything produced
by Maven is under ‘target’.  ‘pom.xml’ is essentially a description of the artifact.
 In particular, it includes a list of artifacts that this artifact depends on.  One module
should produce one artifact.  When we have more than one artifact, or an artifact that depends
on other artifacts, we use a “Multi-module” project.  This is simply a module who’s
‘pom.xml’ specifies submodules.

Maven processes your source file, based on the requirements in ‘pom.xml’ to produce an
artifact.  Typically this artifact gets installed in a local repository, that usually resides
in ~/.m2/repository.  Typing ‘mvn install’ in the module folder tells Maven to do this
installation.  Maven is bright enough to know that it has to compile and package the artifact
first.

While doing the build, if Maven finds a dependency that it doesn’t already have a copy of,
it goes off to a central repository called ‘Maven Central’ and downloads it to your local
repository.  All of River’s compiled jars are available through Maven Central.

Hopefully that makes my previous explanation make a little more sense.  If not, just shout…

Cheers,

Greg Trasuk.



On Jan 8, 2015, at 1:37 PM, Patricia Shanahan <pats@acm.org> wrote:

> For me, the next step in this flow is to learn Maven.
> 
> In general, is it reasonable to assume that, if I had been working actively as a programmer
for the last few years, I would have already learned Maven?
> 
> If not, we need to document, at least by reference, the steps involved to get far enough
along with Maven to try out River.
> 
> Patricia
> 
> On 1/5/2015 7:16 PM, Greg Trasuk wrote:
>> 
>> I started working on making new demos and “getting started” stuff
>> back before the holidays.  Here’s my thinking…
>> 
>> As Patricia alludes to, it really shouldn’t be necessary to build the
>> River distribution in order to try out some samples and get started.
>> After all, the artifacts are published on Maven Central, so they can
>> simply be referenced in a Maven build (or Gradle, Ivy, Etc).
>> 
>> Towards that end, I started building a new Mavenized ‘examples’
>> project, which can be checked-out from
>> https://svn.apache.org/repos/asf/river/river-examples/river-examples/trunk.
>> 
>> In that project, there are currently modules for the service browser
>> jars and a ‘home’ folder for the compiled and packaged examples.
>> (might be best to download it and do a ‘mvn install site’).  There’s
>> also documentation for the examples under the main project (look at
>> <project-home>/target/site/index.html - this should be familiar to
>> Maven users).  The documentation currently includes how to build and
>> run the service browser (although I think right now it’s incomplete
>> on how the configuration works - haven’t looked at it since Dec 15).
>> 
>> Right now, the project has a dependency on the new ‘river-rt-tools’
>> modules that I talked about back in December as well.  So in order to
>> run the examples, you currently need to checkout
>> 'https://svn.apache.org/repos/asf/river/river-rt-tools/trunk' and do
>> a ‘mvn install’ on it, which will install the runtime tool artifacts
>> (start.jar) in your local Maven cache.  In the end, those artifacts
>> would also be released and published on Maven Central, so you
>> eventually wouldn’t need to build the runtime tools separately.
>> 
>> My plan is to add modules to the river-examples project for a
>> 'hello-service’ and ‘hello-client’, as well as a config for the
>> infrastructure services (Reggie, etc).  So eventually, the “getting
>> started” instructions become “have a look at ‘river-examples’”, and
>> we’d remove the (very confusing, if you ask me) ‘examples’ folder
>> from the JTSK distribution.  As a bonus, we can isolate new users
>> from the convoluted build system in River.
>> 
>> If this seems like a reasonable path forward for our “getting
>> started” experience, perhaps you’d like to work on bringing over some
>> of the examples from the JTSK to the ‘river-examples’ project. That’s
>> probably also a good way to re-familiarize yourself with Jini.  I
>> probably won’t have any cycles to work on it seriously for the next
>> couple weeks, but could cheerfully make suggestions.
>> 
>> You should be able to check-out these two Maven project in the IDE of
>> your choice.  I was using NetBeans, but AFAIK, Eclipse should be able
>> to use the Maven build directly.  I just haven’t tried it.
>> 
>> Cheers,
>> 
>> Greg Trasuk.
>> 
>> On Jan 5, 2015, at 6:07 PM, Patricia Shanahan <pats@acm.org> wrote:
>> 
>>> I have completed buying a new home, moving into it, and selling the
>>> old one, followed by Christmas in England and recovery from the
>>> cold I caught there. That means I'm ready to get much more active
>>> in River.
>>> 
>>> Last year, we got some feedback suggesting that better support for
>>> new users might remove a barrier to community building. My main
>>> agenda is community building, so I want to work on that. I am going
>>> to be a very naive potential user, so stand by for basic
>>> questions.
>>> 
>>> I began by downloading the binary version, since in this mode I am
>>> not interested in being a River developer. However, when I looked
>>> at the "Getting Started" page,
>>> river.apache.org/user-guide-basic-river-services.html, it says:
>>> 
>>> "The instructions assume that you're building from source as
>>> checked out from the SVN trunk. Currently this is necessary because
>>> the code snippets below use methods and classes which, at time of
>>> writing, haven't made it into the latest binary release yet. Having
>>> said that, the code you will need in the binary release isn't to
>>> far removed from what you'll see below, so you can progress with
>>> the binary release if you want to and are happy odifying the
>>> code."
>>> 
>>> According to the page info, the "time of writing" was no later than
>>> November 23, 2013. Do I still need to do a River build before I can
>>> run the example? If so, why and what can I do to fix that?
>>> 
>>> I have no idea whether or not I would be happy "odifying" code -
>>> maybe "modifying"?
>>> 
>>> What is the best procedure for editing the "Getting Started" page?
>>> I want to make sure that any changes I make really are
>>> improvements, so I would like PMC review as I go along.
>>> 
>>> Patricia
>>> 
>>> 
>> 


Mime
View raw message