include resource changing the path

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

include resource changing the path

by Daniele Dellafiore :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi everyone.

I have this resource:

<resource>
            <directory>src/main/contents</directory>
            <includes>
               <include>${runtime}/**</include>
            </includes>
            <targetPath>contents</targetPath>
</resource>

let's suppose that ${runtime} has this value: "stage".
The result is that I have the src/main/contents/stage files copied into
WEB-INF/classes/contents/stage.
What I would like to achieve is that those files are copied info
WEB-INF/classes/contents/ without stage.
This would save me to know in many part of the code, what is the actual
value of "runtime" and I can provide different version of same application
with different resources (text, images, everything).

Any idea?

Thanks.

--
Daniele Dellafiore
http://danieledellafiore.net

Re: include resource changing the path

by Daniele Dellafiore :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I also see a strange behavior that tells me I am missing something:

with the configuration I described, I have my contents put in:

WEB-INF/classes/contents/stage

The same result I have if I put them in
src/main/webapp/contents/stage

without any additional configuration or targetPath, of course.

Well, with the first configuration, images are *not* found. With the second
one, they are. This while the target folder is the same in both cases. Maybe
I have to dig in war plugin and war resources to understand this...

On Wed, Nov 4, 2009 at 12:32 PM, Daniele Dellafiore <ildella@...>wrote:

> Hi everyone.
>
> I have this resource:
>
> <resource>
>             <directory>src/main/contents</directory>
>             <includes>
>                <include>${runtime}/**</include>
>             </includes>
>             <targetPath>contents</targetPath>
> </resource>
>
> let's suppose that ${runtime} has this value: "stage".
> The result is that I have the src/main/contents/stage files copied into
> WEB-INF/classes/contents/stage.
> What I would like to achieve is that those files are copied info
> WEB-INF/classes/contents/ without stage.
> This would save me to know in many part of the code, what is the actual
> value of "runtime" and I can provide different version of same application
> with different resources (text, images, everything).
>
> Any idea?
>
> Thanks.
>
> --
> Daniele Dellafiore
> http://danieledellafiore.net
>



--
Daniele Dellafiore
http://danieledellafiore.net

Re: include resource changing the path

by Daniele Dellafiore :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

On Wed, Nov 4, 2009 at 12:54 PM, Daniele Dellafiore <ildella@...>wrote:

> I also see a strange behavior that tells me I am missing something:
>
> with the configuration I described, I have my contents put in:
>
>
> WEB-INF/classes/contents/stage
>
> The same result I have if I put them in
> src/main/webapp/contents/stage
>
> without any additional configuration or targetPath, of course.
>
> Well, with the first configuration, images are *not* found. With the second
> one, they are. This while the target folder is the same in both cases. Maybe
> I have to dig in war plugin and war resources to understand this...
>
>

in fact adding

         <plugin>
            <groupId>org.apache.maven.plugins</groupId>
            <artifactId>maven-war-plugin</artifactId>
            <configuration>
               <webResources>
                  <resource>
                     <!--                      this is relative to the
pom.xml directory -->
                     <directory>src/main/contents</directory>
                     <!--                      the list has a default value
of ** -->
                     <includes>
                        <include>${runtime}/*.jpg</include>
                     </includes>
                     <targetPath>contents</targetPath>
                  </resource>
               </webResources>
            </configuration>
         </plugin>

the resources are used.
Unfortunately in mnv jetty:run I do not see the jpg included cause the
static source remains just src/main/webapp even configuring webapp for
multiple static source like explained here:
http://docs.codehaus.org/display/JETTY/Multiple+WebApp+Source+Directory

I add:

<webAppConfig>
                  <contextPath>/</contextPath>
                  <baseResource
implementation="org.mortbay.resource.ResourceCollection">

<resourcesAsCSV>src/main/webapp,src/main/contents</resourcesAsCSV>
                  </baseResource>
</webAppConfig>

but images in src/main/contents/stage is not displayed pointing to
http://localhost:9090/contents/stage/pic.jpg
while it works if I run mvn jetty:run-war


--
Daniele Dellafiore
http://danieledellafiore.net

Maven fails to deploy to artifactory - Code 401

by Drone42 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

We are building a Maven2 multi-module project using Hudson v1.323. When
using the 'deploy' goal, the build fails with the exception;


[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file:
http://10.48.29.168:8888/artifactory-2.0.5/internal-repository/esa/dops/
game/game/1/game-1.pom. Return code is: 401
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error deploying
artifact: Failed to transfer file:
http://10.48.29.168:8888/artifactory-2.0.5/internal-repository/esa/dops/
game/game/1/game-1.pom. Return code is: 401
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:703)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:540)
        ...


It seems Hudson / maven2 are not authorized to deploy artefacts to the
repository. We have updated the local Hudson .m2/settings.xml file to
contain;

<servers>
        <server>
                <id>internal-repository</id>
                <username>[username]</username>
                <password>[password]</password>
        </server>
</servers>


<repositories>
        <repository>
                <id>internal-repository</id>
       
<url>http://[IP]/artifactory-2.0.5/internal-repository/</url>
        </repository>
</repositories>


URL and user / password are correct. What are we doing wrong?

Thanks,
Gert.

Please help Logica to respect the environment by not printing this email  / Pour contribuer comme Logica au respect de l'environnement, merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. /  Por favor ajude a Logica a respeitar o ambiente nao imprimindo este correio electronico.



This e-mail and any attachment is for authorised use by the intended recipient(s) only. It may contain proprietary material, confidential information and/or be subject to legal privilege. It should not be copied, disclosed to, retained or used by, any other party. If you are not an intended recipient then please promptly delete this e-mail and any attachment and all copies and inform the sender. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...


Parent Message unknown Re: Maven fails to deploy to artifactory - Code 401

by Yossi Shaul-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

The server id in the settings.xml has to match the server id of the target repository in the distributionManagement section (not the id of the repository under the repositories tag).
For example:
<distributionManagement>
     <repository>
               <id>internal-repository</id>
               http://[IP]/artifactory-2.0.5/internal-repository/
       </repository>
</distributionManagement>


Yossi Shaul

From: Villemos, Gert <gert.villemos@...>
Date: Wed, Nov 4, 2009 at 4:17 PM
Subject: Maven fails to deploy to artifactory - Code 401
To: Maven Users List <users@...>


We are building a Maven2 multi-module project using Hudson v1.323. When
using the 'deploy' goal, the build fails with the exception;


[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error deploying artifact: Failed to transfer file:
http://10.48.29.168:8888/artifactory-2.0.5/internal-repository/esa/dops/
game/game/1/game-1.pom. Return code is: 401
[INFO]
------------------------------------------------------------------------
[INFO] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error deploying
artifact: Failed to transfer file:
http://10.48.29.168:8888/artifactory-2.0.5/internal-repository/esa/dops/
game/game/1/game-1.pom. Return code is: 401
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(Default
LifecycleExecutor.java:703)
       at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifec
ycle(DefaultLifecycleExecutor.java:540)
       ...


It seems Hudson / maven2 are not authorized to deploy artefacts to the
repository. We have updated the local Hudson .m2/settings.xml file to
contain;

<servers>
       <server>
               <id>internal-repository</id>
               <username>[username]</username>
               <password>[password]</password>
       </server>
</servers>


<repositories>
       <repository>
               <id>internal-repository</id>

http://[IP]/artifactory-2.0.5/internal-repository/
       </repository>
</repositories>


URL and user / password are correct. What are we doing wrong?

Thanks,
Gert.

Please help Logica to respect the environment by not printing this
email  / Pour contribuer comme Logica au respect de l'environnement,
merci de ne pas imprimer ce mail /  Bitte drucken Sie diese Nachricht
nicht aus und helfen Sie so Logica dabei, die Umwelt zu schützen. /
Por favor ajude a Logica a respeitar o ambiente nao imprimindo este
correio electronico.



This e-mail and any attachment is for authorised use by the intended
recipient(s) only. It may contain proprietary material, confidential
information and/or be subject to legal privilege. It should not be
copied, disclosed to, retained or used by, any other party. If you are
not an intended recipient then please promptly delete this e-mail and
any attachment and all copies and inform the sender. Thank you.



---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@...
For additional commands, e-mail: users-help@...




--
Yoav Landman
Artifactory Founder
Co-founder and Products Development Lead
JFrog Ltd.
http://www.jfrog.org/