Archive for May, 2011

searching by content in files, real example

May 29, 2011

Recently I’ve got a problem with finding some text, some content in my old emails.

I use Google account with this gmail. So I tried to find that text using gmail web search, but it was with no success. Also I have local mail client – I use Thunderbird – so I tried to find using its embedded search capabilities – but no success.

I was starting thinking that I never sent this mail or I have deleted it already.  Also.. I use Ubuntu as my desktop machine, and remembering my post about the searching by content in the files I opened my console in my home directory and type there such command: “grep -rn my_text_i_want_to_find .” and voilà – I got it.

So.. why gmail and thunderbird could not do it I don’t know it. So this is a real example of old-school approach of searching that works and able to help you.

Maven. Using dependency from test scope

May 18, 2011

If you have module A where you have some test classes, and module B where you wish to use this test classes. You need to use some plugin with configured goal, some scope and some type to resolve this.

So, in module A

<project>
  <build>
    <plugins>
     <plugin>
       <groupId>org.apache.maven.plugins</groupId>
       <artifactId>maven-jar-plugin</artifactId>
       <version>2.2</version>
       <executions>
         <execution>
           <goals>
             <goal>test-jar</goal>
           </goals>
         </execution>
       </executions>
     </plugin>
    </plugins>
  </build>
</project>


And in module B:
<project>
  ...
  <dependencies>
    <dependency>
      <groupId>com.my.app</groupId>
      <artifactId>module-a</artifactId>
      <version>1.0-SNAPSHOT</version>
      <type>test-jar</type>
      <scope>test</scope>
    </dependency>
  </dependencies>
  ...
</project>


%d bloggers like this: