Giter Club home page Giter Club logo

puppet-maven's People

Contributors

adamantivm avatar alvagante avatar arnd avatar brettporter avatar carlossg avatar dcrissman avatar evansj avatar highb avatar jbcpollak avatar jfroche avatar kitplummer avatar mask avatar mpeter avatar s-j-nilsson avatar samstonehouse avatar tstibbs avatar whazor avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

puppet-maven's Issues

Request transitive dependencies

It is sometimes useful to be able to fetch and cache transitive dependencies as well.

It seems to me it is a very easy addition as the plug-in stands now: just allow configuring -Dtransitive=true as an option

Windows compatibility

Hi maestrodev,

First, I would like to thank you for the job you have done so far. You have been providing to the community with a tremendous contribution.

I would like to report you that it seems that your puppet-maven module is not compatible with Windows 7. Indeed, if you check for example the manifests\maven.pp file you can notice that within exec {'maven-untar':..} there is a tar xf command with paths that are unix/linux like and the cwd attribute value is /opt. Therefore, the puppet parsing is failing because, it expects a fully qualified path for cwd and I guess an error would occur at runtime since the paths are not windows like.

Am I missing anything? Do you have an idea of how could I fix this issue?

Many thanks
Regards

Tempfile permissions are not the same as the user,group specified

We just found a problem with permissions when using the maven type. If we specify a custom user,group with which to download the maven artifact and have an ensure set to latest, we get an error message from maven because the Tempfile is read only.

We had a look at
https://github.com/maestrodev/puppet-maven/blob/master/lib/puppet/provider/maven/mvn.rb and it seems that the user,group parameters are only honored for the maven execution but not for the Tempfile.

tempfile = Tempfile.new 'mvn'

is generating a file with owner set to root and 'rw' only for him

root@nikolavp-desktop:~# irb
irb(main):001:0> require 'tempfile'
=> true
irb(main):002:0> Tempfile.new 'mvn'
=> #<File:/tmp/mvn20140523-18968-qds2ic>
irb(main):003:0> 
[1]+  Stopped                 irb
root@nikolavp-desktop:~# ls /tmp/mvn20140523-18968-qds2ic  -l
-rw------- 1 root root 0 May 23 17:49 /tmp/mvn20140523-18968-qds2ic

"which: no javac in (/sbin:/bin:/usr/sbin:/usr/bin)" appears in puppet output during apply

Hello,

We are using a relatively new version of this module

commit 802b279

When we run the puppet apply we see the following

.
.
.
Info: Loading facts in /var/lib/puppet/lib/facter/puppet_vardir.rb
which: no javac in (/sbin:/bin:/usr/sbin:/usr/bin)
Info: Caching catalog for XXXXXX.XXX.XX
Info: Applying configuration version '1414012210'
Notice: Finished catalog run in 5.48 seconds

Can the "which: no javac in (/sbin:/bin:/usr/sbin:/usr/bin)" be supressed?

I wasn't able to track down where this is coming from in the code.

thanks,
Garret

Support Mac

It appears that a Mac is not supported because wget does not exist.
Would it be possible to simply leverage curl in wget's absence?
Or could the wget package install wget in its absence?

Use of deprecated function Puppet::Util::SUIDManager.run_and_capture

Using maven resource with puppet 3.4.2-1 will output the following deprecation warning.

Warning: Puppet::Util::SUIDManager.run_and_capture is deprecated; please use Puppet::Util::Execution.execute instead.
(at /var/lib/puppet/lib/puppet/provider/maven/mvn.rb:115:in `download')

Let default_repo_config configure multiple repositories

When configuring default_repo_config it can be necessary to add multiple repositories.
For this, we have defined default_repo_config as map [], and iterate in settings.xml.erb through the repositories to add them.
We can send you the modified code if you wish. It is straightforward.

We have modified:

  • settings.pp
  • settings.xml.erb

title patterns that use procs are not supported

When running puppet generate types
I have the following error
Error: /etc/puppetlabs/code/environments/production/modules/maven/lib/puppet/type/maven.rb: title patterns that use procs are not supported.

Java class required

I am installing java by uncompressing it in a specific folder and updating the JAVA_HOME and not using the rpm/yum java based. While trying to download and artifact using maven, it fails and the log shows:
Could not evaluate: mvn returned 1: Is Maven installed?

The "funny thing" s that if I run the exec command shown on logs manually it works perfectly but not while it runs through puppet.

puppet-maven seems to need the rpm/yum java version somehow and doesn't like my approach. Any Idea how can I make it compatible? the other option I can think is that there is some environment variable not set. Who knows.... :)

Thanks for your time

Error: mvn returned 1: Is Maven installed?

Hi Maestro,

I am trying to download war files from my maven repository. It is hosted in http://car-build-001.abc.com:8081/artifactory/simple/libs-snapshot-local/

$repo = {
id => "myrepo",
username => "admin",
password => "password",
url => "http://car-build-001.abc.com:8081/artifactory/simple/libs-snapshot-local/",
#mirrorof => "external:*" # if you want to use the repo as a mirror, see maven::settings below
}

maven { "/tmp/myfile.war":
groupid => "com.abc.aus",
artifactid => "assess-maven",
version => "latest",
packaging => "war",
#classifier => "sources",
repos => $repo,
ensure => "latest",
}

I am probably doing it wrong. Can you please take a look?

Thanks!

Documentation for setting the 'profiles' element via maven::settings class

Would it be possible to get an example of setting profiles in maven::settings class?

I am trying to add the following to settings.xml

<profile>
  <repositories>
    <repository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>libs-release</name>
      <url>http://artifactory.mycompany/artifactory/libs-release</url>
    </repository>
    <repository>
      <snapshots />
      <id>snapshots</id>
      <name>libs-snapshot</name>
      <url>http://artifactory.mycompany/artifactory/libs-snapshot</url>
    </repository>
  </repositories>
  <pluginRepositories>
    <pluginRepository>
      <snapshots>
        <enabled>false</enabled>
      </snapshots>
      <id>central</id>
      <name>plugins-release</name>
      <url>http://artifactory.mycompany/artifactory/plugins-release</url>
    </pluginRepository>
    <pluginRepository>
      <snapshots />
      <id>snapshots</id>
      <name>plugins-snapshot</name>
      <url>http://artifactory.mycompany/artifactory/plugins-snapshot</url>
    </pluginRepository>
  </pluginRepositories>
  <id>artifactory</id>
  <activation>
    <activeByDefault>true</activeByDefault>
  </activation>
</profile>

Thanks!

Could not load confine test 'operatingsystem'

Hi,

when i try to run the tests i got a bunch of confusing messaged ( for me ;) ).

Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem

What about these message? Do you have any idea what this means?

Greetings
Sascha

user@unknown:~/git/puppet-maven$ rake spec
/home/sgirru/.rvm/gems/ruby-1.9.3-p392/gems/puppet-2.7.18/lib/puppet/external/pson/pure.rb:7:in <module:PSON>': iconv will be deprecated in the future, use String#encode instead. /home/sgirru/.rvm/rubies/ruby-1.9.3-p392/bin/ruby -S rspec spec/classes/maven_spec.rb spec/defines/environment_spec.rb spec/defines/settings_spec.rb --color /home/sgirru/.rvm/gems/ruby-1.9.3-p392/gems/puppet-2.7.18/lib/puppet/external/pson/pure.rb:7:inmodule:PSON': iconv will be deprecated in the future, use String#encode instead.
Mocha deprecation warning: Test::Unit or MiniTest must be loaded before Mocha.
Mocha deprecation warning: If you're integrating with another test library, you should probably require 'mocha_standalone' instead of 'mocha'
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
Could not load confine test 'operatingsystem': cannot load such file -- puppet/provider/confine/operatingsystem
...................

Finished in 0.50082 seconds
19 examples, 0 failures

Add compatibility with PE 2.x

Hi,

You provider mvn.rb needs a little patch to work on older puppet versions:

--- /var/opt/lib/pe-puppet/lib/puppet/provider/maven/mvn.rb 2014-07-02 12:58:42.501421195 +0200
+++ /tmp/puppet-file20140728-4863-7zln9w-0 2014-07-28 13:31:01.555375356 +0200
@@ -128,9 +128,17 @@
output = nil
status = nil

  • The Puppet::Util::Execution.execute method is deprecated in Puppet 3.x and does not exist in 2.8.x

  • but we need this to work on 2.7.x too.

  • if Puppet::Util::Execution.respond_to?(:execute)
  •  exec_method = Puppet::Util::Execution.method(:execute)
    
  • else
  •  exec_method = Puppet::Util.method(:execute)
    
  • end

begin
Timeout::timeout(timeout) do

  •    output = Puppet::Util::Execution.execute(command, {:uid => user, :gid => group})
    
  •    output = exec_method.call(command, {:uid => user, :gid => group, :failonfail => true})
    
     debug output if output.exitstatus == 0
     debug "Exit status = #{output.exitstatus}"
    

Move .mavenrc generation into a separate resource type and don't create a user

There's no reason for the Maven installation to attempt to create a user, and it could conflict with other definitions in the site. That should be removed.

The only feature relying on that was the generation of .mavenrc. That should be more like settings.xml in that it can be done for several users. It should be moved into a defined type.

Fedora support ?

Hi, your module looks great, but is Fedora support planned for your module ?
Thank you in advance for your answer.

Regards,

Adrien

Noob Setup: No errors, but settings.xml not created

Hi, please forgive the total newbie question. I've had some success with Puppet and have a basic master/agent setup working, but I am having trouble getting maven to install. I got the puppet-model installed with:

puppet install puppet-maven

which installed the 1.1.2 version with no errors.

Now I have /etc/puppet/manifests/maven.pp file (based off the docs) that looks like this:

  $snapshots = {
    active => true, #Defaults to true
    protocol => 'http', #Defaults to 'http'
    host => 'https://myrepo.com/snapshot',
    username => 'myuser', #Optional if proxy does not require
    password => 'mypassword', #Optional if proxy does not require
  }

  # Install Maven
  class { "maven::maven":
    version => "3.0.5", # version to install
    # you can get Maven tarball from a Maven repository instead than from Apache servers, optionally with a user/password
    repo => {
      #url => "http://repo.maven.apache.org/maven2",
      #username => "",
      #password => "",
    },
    maven_opts           => "FOO=bar",      # anything to add to MAVEN_OPTS in ~/.mavenrc
    #maven_path_additions => "",      # anything to add to the PATH in ~/.mavenrc
  } ->

  # Create a settings.xml with the repo credentials
  maven::settings { 'maven-user-settings' :
    servers => [$snapshots], # servers entry in settings.xml, uses id, username, password from the hash passed
  }

In my site.pp I have:

import "maven"
import "nodes"

And then in nodes.pp I have:

node appserver inherits staging {
  include maven
}

node 'host.domain.net' inherits appserver {
}

When I run puppet on host.domain.net, I see Maven downloaded and stored in /tmp, and I think it was correctly installed, (mvn at the command line works), but I don't see /root/.mavenrc or /root/.m2/settings.xml created.

Can you help me figure out what I'm doing wrong?

Thanks.

Make maven's conf settings.xml manageable

The possibility to define user-specific settings is already available, but it would be very helpful if the settings.xml in the maven-conf-folder (/opt/maven-x.x.x/conf) could also be created by this module. In my case I must use a http-proxy and it is very inconvenient to create maven-settings for every user.

Add support for configure destination directory of Maven

Add support for configure installation directory of Maven, insted of hardcoded /opt.

That includes: exec maven-untar:

exec { 'maven-untar':
      command => "tar xf /tmp/apache-maven-${version}-bin.tar.gz",
      cwd     => '/opt',
      creates => "/opt/apache-maven-${version}",
      path    => ['/bin','/usr/bin'],
    }

Please release 1.4.1

1.4.0 is current on the puppet forge, but is broken with puppet 4.x. When trying to use it the following errors are generated:

Error: Could not retrieve catalog from remote server: Error 500 on SERVER: Server Error: Evaluation Error: Error while evaluating a Resource Statement, Evaluation Error: Unknown variable: '::maven_version'. at /etc/puppetlabs/code/environments/infrastructure/modules/maven/manifests/maven.pp:42:6 at ....

Pointing my Puppetfile at this git repo and it installs fine. It's been almost 2 years since the last release to the forge, and lots of commits in between. It would be nice to have working code from the forge.

Agent failing to fetch Maven artifacts

These simple puppet scripts are attempting to fetch a zip file from the maven repository and unzip it.

Running 'puppet agent --test --debug" on the puppet master as a test works. Running the same on the puppet agent machine fails as it appears the system never attempts to fetch the zip file from the repository.

site.pp:
git://gist.github.com/2847814.git

init.pp
git://gist.github.com/2847835.git

mysql.pp
git://gist.github.com/2847843.git

Master log:
git://gist.github.com/2847850.git

Agent log:
git://gist.github.com/2847853.git

Bug: Re-downloads maven after each restart

According to my experience, the maven::maven class downloads maven again when the server is restarted even though it is already installed. This is due to storing the donwloaded archive into /tmp/ (which is wiped upon shutdown).

Possible solutions:

  • Either check whether /opt/apache-maven-${version}/bin/mvn exists and if it does, do not do anything (checking for the presence of the maven_version fact should do it)
  • Or download it to another place than /opt

Add provider to run mvn commands

Easy to do with puppet exec but for completeness would be nice to be able to run "mvn install" commands from this module too.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.