Skip to content

Commit

Permalink
added more gav/maven info
Browse files Browse the repository at this point in the history
Signed-off-by: SamMarkowitz <[email protected]>
  • Loading branch information
SamMarkowitz committed Jun 9, 2016
1 parent db89d38 commit c186950
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 22 deletions.
49 changes: 39 additions & 10 deletions cloudslang_cli.rst
Original file line number Diff line number Diff line change
Expand Up @@ -110,16 +110,34 @@ Configure the CLI
The CLI can be configured using the configuration file found at
``cslang/configuration/cslang.properties``.

+---------------------+---------------------------------------------------------+-----------------------+
| Configuration key | Default value | Description |
+=====================+=========================================================+=======================+
| log4j.configuration | file:${app.home}/configuration/logging/log4j.properties | | Location of logging |
| | | | configuration file |
+---------------------+---------------------------------------------------------+-----------------------+
| cslang.encoding | utf-8 | | Character encoding |
| | | | for input values |
| | | | and input files |
+---------------------+---------------------------------------------------------+-----------------------+
Some of the configuration items are listed in the table below:

+-------------------------------------+---------------------------------------------------------+--------------------------+
| Configuration key | Default value | Description |
+=====================================+=========================================================+==========================+
| log4j.configuration | file:${app.home}/configuration/logging/log4j.properties | | Location of logging |
| | | | configuration file |
+-------------------------------------+---------------------------------------------------------+--------------------------+
| cslang.encoding | utf-8 | | Character encoding |
| | | | for input values |
| | | | and input files |
+-------------------------------------+---------------------------------------------------------+--------------------------+
| maven.home | ${app.home}/maven/apache-maven-3.3.9 | | Location of CloudSlang |
| | | | Maven repository home |
| | | | directory |
+-------------------------------------+---------------------------------------------------------+--------------------------+
| maven.settings.xml.path | ${app.home}/maven/conf/settings.xml | | Location of |
| | | | Maven settings file |
+-------------------------------------+---------------------------------------------------------+--------------------------+
| cloudslang.maven.repo.local | ${app.home}/maven/repo | | Location of local |
| | | | repository |
+-------------------------------------+---------------------------------------------------------+--------------------------+
| cloudslang.maven.repo.remote.url | http://repo1.maven.org/maven2 | | Location of remote |
| | | | Maven repository |
+-------------------------------------+---------------------------------------------------------+--------------------------+
| cloudslang.maven.plugins.remote.url | http://repo1.maven.org/maven2 | | Location of remote |
| | | | Maven plugins |
+-------------------------------------+---------------------------------------------------------+--------------------------+

Logging Configuration
---------------------
Expand All @@ -128,6 +146,17 @@ The CLI's logging can be configured using the logging configuration file. The
location of the logging configuration file is defined in the :ref:`CLI's
configuration file <configure_cli>`.

Maven Configuration
-------------------

The CLI uses Maven to manage Java action dependencies. There are several
Maven configuration properties found in the :ref:`CLI's
configuration file <configure_cli>`. To configure Maven to use a remote
repository other than Maven Central, edit the values for
``cloudslang.maven.repo.remote.url`` and ``cloudslang.maven.plugins.remote.url``.
Additionally, you can edit the proxy settings in the file found
at ``maven.settings.xml.path ``.
.. _use_the_cli:
Use the CLI
Expand Down
9 changes: 9 additions & 0 deletions cloudslang_content.rst
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,15 @@ see the :doc:`CLI <cloudslang_cli>` section.
properly reference ready-made content. For information on using classpaths, see
:ref:`Run with Dependencies <run_with_dependencies>`.

Running Content Dependent on Java Actions
=========================================

Some of the content is dependent on Java actions from the score-actions
repository. CloudSlang uses Maven to manage these dependencies. When executing
an operation that declares a dependency, the required Maven project and all its
resources specified in its pom's ``dependencies`` will be resolved and
downloaded (if necessary).

Running Content Dependent on External Python Modules
====================================================

Expand Down
37 changes: 26 additions & 11 deletions cloudslang_dsl_reference.rst
Original file line number Diff line number Diff line change
Expand Up @@ -749,6 +749,15 @@ Upon `operation <#operation>`__ execution, the Maven project and all its
required resources specified in its pom's ``dependencies`` will be resolved and
downloaded (if necessary).

**Example - referencing Maven artifact using gav**

.. code-block:: yaml
java_action:
gav: io.cloudslang.content:score-xml:0.0.2
class_name: io.cloudslang.content.mail.actions.SendMailAction
method_name: execute
.. _imports:

imports
Expand Down Expand Up @@ -909,8 +918,8 @@ Adding a New Java Action
To add a new Java action:

- `Write an annotated Java method <#write-an-annotated-java-method>`__
- `Package the method in a Jar <#package-the-method-in-a-jar>`__
- `Add the Jar to the lib folder in the CLI <#add-the-jar-to-the-lib-folder-in-the-cli>`__
- `Release to remote Maven repository <#release-to-remote-maven-repository>`__
- `Reference your Maven artifact <#reference-your-maven artifact>`__

Write an Annotated Java Method
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Expand Down Expand Up @@ -985,11 +994,14 @@ that matches a CloudSlang output.
}
}
Package the Method in a Jar
^^^^^^^^^^^^^^^^^^^^^^^^^^^
Release to remote Maven repository
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Use Maven to package the project containing the Java action method and release
it to the remote repository defined in the :ref:`CLI's configuration file
<configure_cli>`.

Use Maven to package the class containing the Java action method. Below is an
example **pom.xml** file that can be used for your Maven project.
Below is an example **pom.xml** file that can be used for your Maven project.

**Example - sample pom.xml**

Expand Down Expand Up @@ -1024,12 +1036,15 @@ example **pom.xml** file that can be used for your Maven project.
</build>
</project>
Add the Jar to the lib Folder in the CLI
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
Reference your Maven artifact
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Reference your Maven artifact using the `gav <#gav>`__ key in the
`java_action <#java-action>`__ section of your `operation <#operation>`__.

Place the Jar created by Maven in the **cslang/lib** folder and restart the CLI.
You can now call the Java action from a CloudSlang operation as explained
`above <#java-action>`__.
Upon the `operation's <#operation>`__ first execution, the Maven project and all
its required resources specified in its pom's ``dependencies`` will be resolved
and downloaded.

.. _loop:

Expand Down
2 changes: 1 addition & 1 deletion tutorial/14_lesson.rst
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ resides in. If you downloaded a pre-built CLI the **requirements.txt** file is
already there and we will be appending to its contents.

The folder structure where the CLI executable is should look something
like this:
like this (other folders omitted for simplicity):

- cslang

Expand Down

0 comments on commit c186950

Please sign in to comment.