Maven and resources

View: New views
5 Messages — Rating Filter:   Alert me  

Maven and resources

by buters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

if I put a library files in src/main/resources, then I can find and add these ones with Project->Properties->Liebraries->Add Jars...
But I don't want have these all in my project. There is tag <resources> in Maven and I use it so:
<build>
...
   <resources>
      <resource>
        <directory>${env.JBOSS_HOME}/client</directory>
      </resource>
    </resources>
...
</build>
I compile my project Run As -> build... -> compile
I get "BUILD SUCCESSFUL". But I can not find needed libraries as above. And my java-files display errors because of wrong imports.
How can I solve it?

Thanks beforehand,
best regards, buters

Re: Maven and resources

by Igor Fedorenko-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I am not sure what you're trying to achieve, but generally maven
projects use <dependencies/> pom section to define project's
dependencies on external libraries. m2e will automatically make such
dependencies available on compile classpath and when you run the project
from eclipse. You can read more about maven dependencies here

http://www.sonatype.com/book/reference/public-book.html

buters wrote:

> Hi,
>
> if I put a library files in src/main/resources, then I can find and add
> these ones with Project->Properties->Liebraries->Add Jars...
> But I don't want have these all in my project. There is tag <resources> in
> Maven and I use it so:
> <build>
> ...
>    <resources>
>       <resource>
>         <directory>${env.JBOSS_HOME}/client</directory>
>       </resource>
>     </resources>
> ...
> </build>
> I compile my project Run As -> build... -> compile
> I get "BUILD SUCCESSFUL". But I can not find needed libraries as above. And
> my java-files display errors because of wrong imports.
> How can I solve it?
>
> Thanks beforehand,
> best regards, buters


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Maven and resources

by buters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

<dependencies/>  are gut. But how you find e.g. 20-30 plugins, that are not in remote maven repository or in another maven-project? Either difficult way: you have to install every plugin with install:install-file in your local repository or you create lib-folder for these in maven-project (I am in this state now), or I don't know a better solution.
I thought that with <resources> I can only have references to all plugins and I have not to store quite a number of plugins in the lib-folder of my project, e.g. with <directory>${env.JBOSS_HOME}/client</directory>

Igor Fedorenko-4 wrote:
I am not sure what you're trying to achieve, but generally maven
projects use <dependencies/> pom section to define project's
dependencies on external libraries. m2e will automatically make such
dependencies available on compile classpath and when you run the project
from eclipse. You can read more about maven dependencies here

http://www.sonatype.com/book/reference/public-book.html

buters wrote:
> Hi,
>
> if I put a library files in src/main/resources, then I can find and add
> these ones with Project->Properties->Liebraries->Add Jars...
> But I don't want have these all in my project. There is tag <resources> in
> Maven and I use it so:
> <build>
> ...
>    <resources>
>       <resource>
>         <directory>${env.JBOSS_HOME}/client</directory>
>       </resource>
>     </resources>
> ...
> </build>
> I compile my project Run As -> build... -> compile
> I get "BUILD SUCCESSFUL". But I can not find needed libraries as above. And
> my java-files display errors because of wrong imports.
> How can I solve it?
>
> Thanks beforehand,
> best regards, buters


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email


Re: Maven and resources

by Igor Fedorenko-4 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I don't know much about jboss, but have you looked at
http://wiki.jboss.org/wiki/Maven ?

Generally, you have to have dependencies available from maven
repository, if you want to be able to reproduce your builds. But if you
have to use libraries available from local filesystem, then you need to
use dependencies with system scope.

buters wrote:

> <dependencies/>  are gut. But how you find e.g. 20-30 plugins, that are not
> in remote maven repository or in another maven-project? Either difficult
> way: you have to install every plugin with install:install-file in your
> local repository or you create lib-folder for these in maven-project (I am
> in this state now), or I don't know a better solution.
> I thought that with <resources> I can only have references to all plugins
> and I have not to store quite a number of plugins in the lib-folder of my
> project, e.g. with <directory>${env.JBOSS_HOME}/client</directory>
>
>
> Igor Fedorenko-4 wrote:
>> I am not sure what you're trying to achieve, but generally maven
>> projects use <dependencies/> pom section to define project's
>> dependencies on external libraries. m2e will automatically make such
>> dependencies available on compile classpath and when you run the project
>> from eclipse. You can read more about maven dependencies here
>>
>> http://www.sonatype.com/book/reference/public-book.html
>>
>> buters wrote:
>>> Hi,
>>>
>>> if I put a library files in src/main/resources, then I can find and add
>>> these ones with Project->Properties->Liebraries->Add Jars...
>>> But I don't want have these all in my project. There is tag <resources>
>>> in
>>> Maven and I use it so:
>>> <build>
>>> ...
>>>    <resources>
>>>       <resource>
>>>         <directory>${env.JBOSS_HOME}/client</directory>
>>>       </resource>
>>>     </resources>
>>> ...
>>> </build>
>>> I compile my project Run As -> build... -> compile
>>> I get "BUILD SUCCESSFUL". But I can not find needed libraries as above.
>>> And
>>> my java-files display errors because of wrong imports.
>>> How can I solve it?
>>>
>>> Thanks beforehand,
>>> best regards, buters
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email



Re: Maven and resources

by buters :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Thank you very much Igor,

best regards, buters

Igor Fedorenko-4 wrote:
I don't know much about jboss, but have you looked at
http://wiki.jboss.org/wiki/Maven ?

Generally, you have to have dependencies available from maven
repository, if you want to be able to reproduce your builds. But if you
have to use libraries available from local filesystem, then you need to
use dependencies with system scope.

buters wrote:
> <dependencies/>  are gut. But how you find e.g. 20-30 plugins, that are not
> in remote maven repository or in another maven-project? Either difficult
> way: you have to install every plugin with install:install-file in your
> local repository or you create lib-folder for these in maven-project (I am
> in this state now), or I don't know a better solution.
> I thought that with <resources> I can only have references to all plugins
> and I have not to store quite a number of plugins in the lib-folder of my
> project, e.g. with <directory>${env.JBOSS_HOME}/client</directory>
>
>
> Igor Fedorenko-4 wrote:
>> I am not sure what you're trying to achieve, but generally maven
>> projects use <dependencies/> pom section to define project's
>> dependencies on external libraries. m2e will automatically make such
>> dependencies available on compile classpath and when you run the project
>> from eclipse. You can read more about maven dependencies here
>>
>> http://www.sonatype.com/book/reference/public-book.html
>>
>> buters wrote:
>>> Hi,
>>>
>>> if I put a library files in src/main/resources, then I can find and add
>>> these ones with Project->Properties->Liebraries->Add Jars...
>>> But I don't want have these all in my project. There is tag <resources>
>>> in
>>> Maven and I use it so:
>>> <build>
>>> ...
>>>    <resources>
>>>       <resource>
>>>         <directory>${env.JBOSS_HOME}/client</directory>
>>>       </resource>
>>>     </resources>
>>> ...
>>> </build>
>>> I compile my project Run As -> build... -> compile
>>> I get "BUILD SUCCESSFUL". But I can not find needed libraries as above.
>>> And
>>> my java-files display errors because of wrong imports.
>>> How can I solve it?
>>>
>>> Thanks beforehand,
>>> best regards, buters
>>
>> ---------------------------------------------------------------------
>> To unsubscribe from this list, please visit:
>>
>>     http://xircles.codehaus.org/manage_email
>>
>>
>>
>>
>


---------------------------------------------------------------------
To unsubscribe from this list, please visit:

    http://xircles.codehaus.org/manage_email

LightInTheBox - Buy quality products at wholesale price!