Advertisement
Guest User

Untitled

a guest
Dec 19th, 2014
147
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 3.83 KB | None | 0 0
  1. <plugin>
  2. <artifactId>maven-jar-plugin</artifactId>
  3. <executions>
  4. <execution>
  5. <id>test-jar</id>
  6. <phase>test-compile</phase>
  7. <goals>
  8. <goal>test-jar</goal>
  9. </goals>
  10. </execution>
  11. </executions>
  12. </plugin>
  13.  
  14. <dependency>
  15. <groupId>com.example</groupId>
  16. <artifactId>foo</artifactId>
  17. <version>1.0.0-SNAPSHOT</version>
  18. </dependency>
  19.  
  20. <profile>
  21. <id>local</id>
  22. <dependencies>
  23. <dependency>
  24. <groupId>com.example</groupId>
  25. <artifactId>foo</artifactId>
  26. <version>1.0.0-SNAPSHOT</version>
  27. <type>test-jar</type>
  28. </dependency>
  29. </dependencies>
  30. </profile>
  31.  
  32. <execution>
  33. <id>local-build</id>
  34. <phase>package</phase>
  35. <goals>
  36. <goal>jar</goal>
  37. </goals>
  38. <configuration>
  39. <classifier>batman</classifier>
  40. <directory>${basedir}/src/test/java</directory> <!-- tried several variations here -->
  41. <includes>
  42. <include>**</include>
  43. </includes>
  44. </configuration>
  45. </execution>
  46.  
  47. <project>
  48. <groupId>com.example</groupId>
  49. <artifactId>foo</artifactId>
  50. <version>1.0.0-SNAPSHOT</version>
  51. <packaging>jar</packaging>
  52. <build>
  53. <plugins>
  54. ...
  55. <plugin>
  56. <groupId>org.apache.maven.plugins</groupId>
  57. <artifactId>maven-jar-plugin</artifactId>
  58. <executions>
  59. <execution>
  60. <goals>
  61. <goal>test-jar</goal>
  62. </goals>
  63. </execution>
  64. </executions>
  65. </plugin>
  66.  
  67. <dependency>
  68. <groupId>com.example</groupId>
  69. <artifactId>foo</artifactId>
  70. <version>1.0.0-SNAPSHOT</version>
  71. <type>test-jar</type>
  72. <!-- uncomment if needed in test scope only
  73. <scope>test</scope>
  74. -->
  75. </dependency>
  76.  
  77. <dependency>
  78. <groupId>com.example</groupId>
  79. <artifactId>foo</artifactId>
  80. <version>1.0.0-SNAPSHOT</version>
  81. <classifier>tests</classifier>
  82. <scope>test</scope>
  83. </dependency>
  84.  
  85. <plugin>
  86. <groupId>org.codehaus.mojo</groupId>
  87. <!-- used to package the dummy daos when building
  88. with the local profile -->
  89. <artifactId>build-helper-maven-plugin</artifactId>
  90. <executions>
  91. <execution>
  92. <phase>generate-sources</phase>
  93. <goals>
  94. <goal>add-source</goal>
  95. </goals>
  96. <configuration>
  97. <sources>
  98. <source>${extra.sources.dir}</source>
  99. </sources>
  100. </configuration>
  101. </execution>
  102. </executions>
  103. </plugin>
  104.  
  105. <profile>
  106. <id>local</id>
  107. <properties>
  108. <env.resources.dir>src/test/resources</env.resources.dir>
  109. <extra.sources.dir>src/test/java</extra.sources.dir>
  110. </properties>
  111. <dependencies>
  112. <dependency>
  113. <groupId>junit</groupId>
  114. <artifactId>junit</artifactId>
  115. <version>4.8.1</version>
  116. <scope>compile</scope>
  117. </dependency>
  118. <dependency>
  119. <groupId>org.springframework</groupId>
  120. <artifactId>org.springframework.test</artifactId>
  121. <scope>compile</scope>
  122. </dependency>
  123. </dependencies>
  124. </profile>
  125.  
  126. <plugin>
  127. <groupId>org.apache.maven.plugins</groupId>
  128. <artifactId>maven-dependency-plugin</artifactId>
  129. <executions>
  130. <execution>
  131. <id>copy-dependencies</id>
  132. <phase>compile</phase>
  133. <goals>
  134. <goal>copy-dependencies</goal>
  135. </goals>
  136. <configuration>
  137. <artifactSet>
  138. <includes>
  139. <include>com.example:foo</include>
  140. </includes>
  141. </artifactSet>
  142. <outputDirectory>target/dependencies</outputDirectory>
  143. </configuration>
  144. </execution>
  145. </executions>
  146. </plugin>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement