maven-users mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Robert Scholte" <rfscho...@apache.org>
Subject Re: How to read new Folder data
Date Sun, 05 May 2013 16:08:23 GMT
Hi Kashu,

This is probably a question you have to ask to the developers of the  
jbehave-maven-plugin. [1]
The maven-resources-plugin and maven-compiler-plugin do their work as  
expected.
It's not clear to me if the custom resource is actually for testing  
purpose. If so, move it to src/test/java
Do you see the test being executed with Maven? Be sure that the test class  
end with "Test.java".
You could run 'mvn test -X' to activate logging with debug level,  
hopefully the writers of the plugin have added some useful debug  
informaion.
I haven't used this plugin, so there's not much I can do to help on that  
area.

Robert

- http://jbehave.org/reference/stable/faq.html
- http://jbehave.org/reference/stable/maven-goals.html
- http://jbehave.org/reference/stable/mailing-lists.html

Op Sun, 05 May 2013 17:31:13 +0200 schreef kashu <kashu.joshi@gmail.com>:

> My Bad Robert..
>
> What do you mean by "the custom one when used to run by IDE(eclipse)"? :
> This mean that I have added resources folder in my classpath through
> eclipse (an IDE) .So when I try to run the story driver in eclipse via
> Junit test, some how , the resources folder data is getting read by  
> eclipse
> . As I put changed FTL file in resources , when the report is getting
> generated in target\jbehave\view , it's getting generated as a custom one
> as I made changes in FTL file.
> But when I try to do mvn test from command promt, the report is getting
> generated in target\jbehave\view but again somehow maven could not read  
> the
> FTL file placed inside resources folder hence default report every time  
> has
> been getting generated...
> I am placing my Entire POM structure for further reference...I am sorry  
> as
> length of mail now will increase beyond limit.
> <?xml version="1.0" encoding="UTF-8"?>
>
> <project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="
> http://www.w3.org/2001/XMLSchema-instance"
>     xsi:schemaLocation="http://maven.apache.org/POM/4.0.0
> http://maven.apache.org/maven-v4_0_0.xsd">
>     <modelVersion>4.0.0</modelVersion>
>     <groupId>com.proejct value .project value</groupId>
>     <artifactId>project value</artifactId>
>     <version>0.0.1-SNAPSHOT</version>
>     <name>JBehave Stories</name>
>
>     <properties>
>         <jbehave.core.version>4.0-beta-3</jbehave.core.version>
>         <jbehave.web.version>3.5.4</jbehave.web.version>
>         <jbehave.site.version>3.1.1</jbehave.site.version>
>         <selenium.version>2.31.0</selenium.version>
>         <meta.filter></meta.filter>
>         <basedir>.</basedir>
>
> <src.conf>src/main/java/com/CustomPackage/projectName/configuration</src.conf>
>         <test.application></test.application>
>         <test.environment>QA enviornment name</test.environment>
>         <test.group>Smoke suite name</test.group>
>
>
>     </properties>
>
>     <profiles>
>         <profile>
>             <id>StoryDriver</id>
>             <activation>
>                 <activeByDefault>true</activeByDefault>
>             </activation>
>             <properties>
>
> <embeddables>**/${test.application}StoryDriver.java</embeddables>
>             </properties>
>         </profile>
>
>         <!-- <profile> <id>ConsumerRegression</id> <properties>
> <embeddables>**/Stories.java</embeddables>
>             </properties> </profile> -->
>     </profiles>
>
>
> <dependencies>
>         <dependency>
>             <groupId>org.jbehave</groupId>
>             <artifactId>jbehave-core</artifactId>
>             <version>${jbehave.core.version}</version>
>         </dependency>
>         <dependency>
>     <groupId>org.apache.maven.plugins</groupId>
>     <artifactId>maven-resources-plugin</artifactId>
>     <version>2.6</version>
> </dependency>
>         <dependency>
>             <groupId>org.jbehave.web</groupId>
>             <artifactId>jbehave-web-selenium</artifactId>
>             <version>${jbehave.web.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>org.jbehave</groupId>
>             <artifactId>jbehave-core</artifactId>
>             <version>${jbehave.core.version}</version>
>             <classifier>resources</classifier>
>             <type>zip</type>
>         </dependency>
>         <dependency>
>             <groupId>org.jbehave.site</groupId>
>             <artifactId>jbehave-site-resources</artifactId>
>             <version>${jbehave.site.version}</version>
>             <type>zip</type>
>         </dependency>
>         <dependency>
>             <groupId>org.seleniumhq.selenium</groupId>
>             <artifactId>selenium-java</artifactId>
>             <version>${selenium.version}</version>
>         </dependency>
>         <dependency>
>             <groupId>junit</groupId>
>             <artifactId>junit</artifactId>
>             <version>3.8.1</version>
>             <scope>test</scope>
>         </dependency>
>         <dependency>
>             <groupId>org.testng</groupId>
>             <artifactId>testng</artifactId>
>             <version>6.8</version>
>         </dependency>
>     </dependencies>
>
>     <build>
>         <resources>
>             <resource>
>                 <directory>src/main/java</directory>
>                 <filtering>true</filtering>
>                 <excludes>
>                     <exclude>**/*.java</exclude>
>                 </excludes>
>             </resource>
>             <resource>
>                 <directory>src/main/java</directory>
>
>                 <filtering>true</filtering>
>             </resource>
>             <resource>
>                 <directory>src/main/resources</directory>
>                         <includes>
>           <include>**/*.ftl</include>
>         </includes>
>                 <filtering>true</filtering>
>             </resource>
>         </resources>
>         <pluginManagement>
>             <plugins>
>                 <plugin>
>                     <groupId>org.apache.maven.plugins</groupId>
>                     <artifactId>maven-compiler-plugin</artifactId>
>                     <version>2.1</version>
>                     <configuration>
>                         <source>1.5</source>
>                         <target>1.5</target>
>                     </configuration>
>                 </plugin>
>             </plugins>
>         </pluginManagement>
>         <plugins>
>             <plugin>
>                 <groupId>org.jbehave</groupId>
>                 <artifactId>jbehave-maven-plugin</artifactId>
>                 <version>${jbehave.core.version}</version>
>                 <executions>
>                     <execution>
>                         <id>unpack-view-resources</id>
>                         <phase>process-resources</phase>
>                         <goals>
>                             <goal>unpack-view-resources</goal>
>                         </goals>
>                     </execution>
>                     <execution>
>                         <id>embeddable-stories</id>
>                         <phase>test</phase>
>                         <configuration>
>                             <includes>
>                                 <include>${embeddables}</include>
>                             </includes>
>                             <excludes />
>
> <ignoreFailureInStories>true</ignoreFailureInStories>
>                             <ignoreFailureInView>false</ignoreFailureInView>
>                             <threads>1</threads>
>                             <storyTimeoutInSecs>3600</storyTimeoutInSecs>
>
> <outputDirectory>${basedir}/test-output</outputDirectory>
>                             <metaFilters>
>                                 <metaFilter>${meta.filter}</metaFilter>
>                             </metaFilters>
>                             <systemPropertyVariables>
>                                 <property>
>                                     <name>java.awt.headless</name>
>                                     <value>true</value>
>                                 </property>
>                             </systemPropertyVariables>
>                         </configuration>
>                         <goals>
>                             <goal>run-stories-as-embeddables</goal>
>                         </goals>
>                     </execution>
>
>                 </executions>
>             </plugin>
>             <plugin>
>                 <groupId>org.apache.maven.plugins</groupId>
>                 <artifactId>maven-antrun-plugin</artifactId>
>                 <version>1.1</version>
>                 <executions>
>                     <execution>
>                         <phase>validate</phase>
>                         <goals>
>                             <goal>run</goal>
>                         </goals>
>                         <configuration>
>                             <tasks>
>                                 <available
>
> file="${src.conf}/configuration.auto.${test.environment}.properties"
>                                     type="file" property="file.exists" />
>                                 <echo message="property
> value:${file.exists}" />
>                                 <copy
>
> file="${src.conf}/configuration.auto.${test.environment}.properties"
>
> tofile="${src.conf}/configuration.auto.local.properties"
>                                     overwrite="true" verbose="true" />
>                             </tasks>
>                         </configuration>
>                     </execution>
>                 </executions>
>             </plugin>
>
>         </plugins>
>     </build>
>
> </project>
>
> Please let me know if you need more information.
>
> Cheers,
> Kashu
>
>
>
> On Sun, May 5, 2013 at 6:40 PM, rfscholte [via Maven] <
> ml-node+s40175n5754962h63@n5.nabble.com> wrote:
>
>> Hi,
>>
>> What do you mean by "the custom one when used to run by IDE(eclipse)"?
>> The maven-resource-plugin will copy all files from src/main/resources to
>> target/classes, and when using filtering, the ${key} -properties will be
>> replaced with their matching value. This has been used zillions of  
>> times,
>>
>> so I can't imagine a bug here.
>> It seems like you're expecting something else.
>>
>> What do you expect? (name the files + folders)
>> How did you run Maven?
>> It would help if you gave enough information so we could reproduce it.
>>
>> Robert
>>
>>
>>
>> Op Sun, 05 May 2013 13:59:12 +0200 schreef kashu <[hidden  
>> email]<http://user/SendEmail.jtp?type=node&node=5754962&i=0>>:
>>
>>
>> > Hi,
>> >
>> > I tried that option but no success as still report are getting  
>> generated
>> > with old/default format and not the custom one when used to run by
>> > IDE(eclipse)
>> > <resource>
>> >                 <directory>src/main/resources</directory>
>> >                         <includes>
>> >           <include>**/*.ftl</include>
>> >         </includes>
>> >                 <filtering>true</filtering>
>> >             </resource>
>> >         </resources>
>> >
>> > I am using Jbehave on top of selenium..giving this as an additional
>> > information as don't know whether this would be helpful or not.
>> >
>> > Any idea why  Maven is behaving such a way? Any bug present in maven?
>> > Awaiting the reply.
>> > Cheers,
>> > Kashu
>> >
>> >
>> > On Sun, May 5, 2013 at 1:15 AM, rfscholte [via Maven] <
>> > [hidden email] <http://user/SendEmail.jtp?type=node&node=5754962&i=1>>
>> wrote:
>> >
>> >> The default folder for resources, which need to be available on the
>> >> classpath is:
>> >> src/main/resources
>> >>
>> >> and for java-files:
>> >> src/main/java
>> >>
>> >> using the standard directory layout [1] is by far the easiest way to
>> >> setup
>> >>
>> >> your project.
>> >>
>> >> if you still want to keep your own structure and adjust the pom,  
>> have a
>> >> look at the maven-resource-plugin[2], which is responsible for  
>> copying
>> >> files to the classes-folder.
>> >>
>> >> Robert
>> >>
>> >> [1]
>> >>
>> >>
>> http://maven.apache.org/guides/introduction/introduction-to-the-standard-directory-layout.html
>> >> [2]
>> >>
>> >>
>> http://maven.apache.org/plugins/maven-resources-plugin/examples/include-exclude.html
>> >>
>> >>
>> >>
>> >> Op Sat, 04 May 2013 16:49:44 +0200 schreef kashu <[hidden
>> >> email]<http://user/SendEmail.jtp?type=node&node=5754938&i=0>>:
>> >>
>> >>
>> >> > What I did is that, I manually added resources folder which had
>> >> changed
>> >>
>> >> > FTL
>> >> > file in the project folder structure under the path src/main. Now
>> >> through
>> >> > eclipse, I right click on and gone to configure build path where I
>> >> link
>> >> > resources folder and also created environment variable as well.This
>> >> was
>> >> > fruitful as when I tried to run storyDriver.java via Junit, test  
>> case
>> >> was
>> >> > getting run successfully and custom report were generated due to  
>> the
>> >> > changes
>> >> > I made in FTL file..but when I try to run through maven , the
>> >> resources
>> >> > folder data was not at all getting picked up/read hence no custom
>> >> report
>> >>
>> >> > got
>> >> > generated..
>> >> >  can somebody please suggest how I can make it read the resources
>> >> folder
>> >> > through maven?I mean , I am not an expert in Maven so what I did in
>> >> > eclipse
>> >> > for reading resources folder, how I can do the same in POM file?
>> >> >
>> >> > Cheers,
>> >> > kashu
>> >> >
>> >> >
>> >> >
>> >> > --
>> >> > View this message in context:
>> >> >
>> >>
>> http://maven.40175.n5.nabble.com/How-to-read-new-Folder-data-tp5754909.html
>> >> > Sent from the Maven - Users mailing list archive at Nabble.com.
>> >> >
>> >> >  
>> ---------------------------------------------------------------------
>> >> > To unsubscribe, e-mail: [hidden
>> >> email]<http://user/SendEmail.jtp?type=node&node=5754938&i=1>
>> >> > For additional commands, e-mail: [hidden
>> >> email]<http://user/SendEmail.jtp?type=node&node=5754938&i=2>
>> >>
>> >> ---------------------------------------------------------------------
>> >> To unsubscribe, e-mail: [hidden
>> >> email]<http://user/SendEmail.jtp?type=node&node=5754938&i=3>
>> >> For additional commands, e-mail: [hidden
>> >> email]<http://user/SendEmail.jtp?type=node&node=5754938&i=4>
>> >>
>> >>
>> >>
>> >> ------------------------------
>> >>  If you reply to this email, your message will be added to the
>> >> discussion
>> >> below:
>> >>
>> >>
>> http://maven.40175.n5.nabble.com/How-to-read-new-Folder-data-tp5754909p5754938.html
>> >>  To unsubscribe from How to read new Folder data, click
>> >> here<
>>
>> >> .
>> >> NAML<
>> http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>> >>
>> >
>> >
>> >
>> >
>> > --
>> > View this message in context:
>> >
>> http://maven.40175.n5.nabble.com/How-to-read-new-Folder-data-tp5754909p5754960.html
>>
>> > Sent from the Maven - Users mailing list archive at Nabble.com.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: [hidden  
>> email]<http://user/SendEmail.jtp?type=node&node=5754962&i=2>
>> For additional commands, e-mail: [hidden  
>> email]<http://user/SendEmail.jtp?type=node&node=5754962&i=3>
>>
>>
>>
>> ------------------------------
>>  If you reply to this email, your message will be added to the  
>> discussion
>> below:
>>
>> http://maven.40175.n5.nabble.com/How-to-read-new-Folder-data-tp5754909p5754962.html
>>  To unsubscribe from How to read new Folder data, click  
>> here<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=unsubscribe_by_code&node=5754909&code=a2FzaHUuam9zaGlAZ21haWwuY29tfDU3NTQ5MDl8Mjk5NzQxNTY4>
>> .
>> NAML<http://maven.40175.n5.nabble.com/template/NamlServlet.jtp?macro=macro_viewer&id=instant_html%21nabble%3Aemail.naml&base=nabble.naml.namespaces.BasicNamespace-nabble.view.web.template.NabbleNamespace-nabble.view.web.template.NodeNamespace&breadcrumbs=notify_subscribers%21nabble%3Aemail.naml-instant_emails%21nabble%3Aemail.naml-send_instant_email%21nabble%3Aemail.naml>
>>
>
>
>
>
> --
> View this message in context:  
> http://maven.40175.n5.nabble.com/How-to-read-new-Folder-data-tp5754909p5754967.html
> Sent from the Maven - Users mailing list archive at Nabble.com.

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


Mime
View raw message