Author: veithen
Date: Sat Apr 16 20:58:47 2016
New Revision: 1739512
URL: http://svn.apache.org/viewvc?rev=1739512&view=rev
Log:
Simplify repository generation.
Added:
axis/axis2/java/core/trunk/modules/jaxws-integration/src/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/repository/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/repository/services/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/repository/services/BookStoreService/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/repository/services/BookStoreService/META-INF/
- copied from r1735661,
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/server/META-INF/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/repository/services/EchoService/
axis/axis2/java/core/trunk/modules/jaxws-integration/src/test/repository/services/EchoService/META-INF/
- copied from r1735661,
axis/axis2/java/core/trunk/modules/jaxws-integration/test/server/META-INF/
Removed:
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/server/META-INF/
axis/axis2/java/core/trunk/modules/jaxws-integration/test/server/META-INF/
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/BookStoreService.java
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/AbstractCreateRepositoryMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateRepositoryMojo.java
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateTestRepositoryMojo.java
Modified: axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml?rev=1739512&r1=1739511&r2=1739512&view=diff
==============================================================================
--- axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml (original)
+++ axis/axis2/java/core/trunk/modules/jaxws-integration/pom.xml Sat Apr 16
20:58:47 2016
@@ -214,6 +214,7 @@
<configuration>
<outputDirectory>${project.build.directory}/repo</outputDirectory>
<modules>addressing</modules>
+ <axis2xml>test-resources/axis2.xml</axis2xml>
</configuration>
</execution>
<execution>
@@ -709,27 +710,6 @@
<property name="services.dir"
value="${repo.dir}/services" />
<property name="servicejars.dir"
value="${repo.dir}/servicejars" />
- <!--
================================================================ -->
- <!-- Non-JAXWS services -->
- <!--
================================================================ -->
-
- <copy toDir="${services.dir}/EchoService/">
- <fileset dir="target/test-classes">
- <include name="server/**" />
- </fileset>
- <fileset dir="test/server">
- <exclude name="**/*.java" />
- </fileset>
- </copy>
- <copy
toDir="${services.dir}/BookStoreService/">
- <fileset dir="target/test-classes">
- <include
name="org/apache/axis2/jaxws/client/soapaction/**" />
- </fileset>
- <fileset
dir="test/org/apache/axis2/jaxws/client/soapaction/server">
- <include name="META-INF/**" />
- </fileset>
- </copy>
-
<mkdir dir="${servicejars.dir}" />
<!--
================================================================ -->
<!-- JAXWS services -->
@@ -1453,29 +1433,6 @@
</execution>
</executions>
</plugin>
- <plugin>
- <artifactId>maven-resources-plugin</artifactId>
- <executions>
- <execution>
- <id>copy-repo</id>
- <phase>test-compile</phase>
- <goals>
- <goal>copy-resources</goal>
- </goals>
- <configuration>
-
<outputDirectory>${project.build.directory}/repo</outputDirectory>
- <resources>
- <resource>
- <directory>test-resources</directory>
- <includes>
- <include>axis2.xml</include>
- </includes>
- </resource>
- </resources>
- </configuration>
- </execution>
- </executions>
- </plugin>
<plugin>
<artifactId>maven-surefire-plugin</artifactId>
<inherited>true</inherited>
Modified:
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/BookStoreService.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/BookStoreService.java?rev=1739512&r1=1739511&r2=1739512&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/BookStoreService.java
(original)
+++
axis/axis2/java/core/trunk/modules/jaxws-integration/test/org/apache/axis2/jaxws/client/soapaction/BookStoreService.java
Sat Apr 16 20:58:47 2016
@@ -33,7 +33,7 @@ public class BookStoreService
{
private static URL BOOKSTORESERVICE_WSDL_LOCATION;
- private static String
wsdlLocation="/test/org/apache/axis2/jaxws/client/soapaction/server/META-INF/SOAPActionTest.wsdl";
+ private static String
wsdlLocation="/src/test/repository/services//BookStoreService/META-INF/SOAPActionTest.wsdl";
static {
URL url = null;
try {
Modified:
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/AbstractCreateRepositoryMojo.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/AbstractCreateRepositoryMojo.java?rev=1739512&r1=1739511&r2=1739512&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/AbstractCreateRepositoryMojo.java
(original)
+++
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/AbstractCreateRepositoryMojo.java
Sat Apr 16 20:58:47 2016
@@ -33,11 +33,13 @@ import org.apache.maven.artifact.Artifac
import org.apache.maven.plugin.AbstractMojo;
import org.apache.maven.plugin.MojoExecutionException;
import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.plugin.logging.Log;
import org.apache.maven.project.MavenProject;
import
org.apache.maven.shared.artifact.filter.collection.ArtifactFilterException;
import org.apache.maven.shared.artifact.filter.collection.FilterArtifacts;
import org.apache.maven.shared.artifact.filter.collection.ScopeFilter;
import org.apache.maven.shared.artifact.filter.collection.TypeFilter;
+import org.codehaus.plexus.util.DirectoryScanner;
import org.codehaus.plexus.util.FileUtils;
import org.codehaus.plexus.util.StringUtils;
@@ -155,9 +157,29 @@ public abstract class AbstractCreateRepo
protected abstract String getScope();
+ protected abstract File getInputDirectory();
+
protected abstract File getOutputDirectory();
public void execute() throws MojoExecutionException, MojoFailureException {
+ Log log = getLog();
+ File inputDirectory = getInputDirectory();
+ File outputDirectory = getOutputDirectory();
+ if (inputDirectory.exists()) {
+ log.info("Copying files from " + inputDirectory);
+ DirectoryScanner ds = new DirectoryScanner();
+ ds.setBasedir(inputDirectory);
+ ds.scan();
+ for (String relativePath : ds.getIncludedFiles()) {
+ try {
+ FileUtils.copyFile(
+ new File(inputDirectory, relativePath),
+ new File(outputDirectory, relativePath));
+ } catch (IOException ex) {
+ throw new MojoExecutionException("Failed to copy " +
relativePath, ex);
+ }
+ }
+ }
Set<Artifact> artifacts = new HashSet<Artifact>();
if (useDependencies) {
artifacts.addAll(projectArtifacts);
@@ -168,7 +190,6 @@ public abstract class AbstractCreateRepo
artifacts.addAll(project.getAttachedArtifacts());
}
}
- File outputDirectory = getOutputDirectory();
if (includeModules || includeServices) {
FilterArtifacts filter = new FilterArtifacts();
filter.addFilter(new ScopeFilter(getScope(), null));
@@ -199,14 +220,14 @@ public abstract class AbstractCreateRepo
if (deployer == null) {
throw new MojoExecutionException("No deployer found for
artifact type " + type);
}
- deployer.deploy(getLog(), artifact);
+ deployer.deploy(log, artifact);
}
for (ArchiveDeployer deployer : deployers.values()) {
- deployer.finish(getLog());
+ deployer.finish(log);
}
}
if (axis2xml != null) {
- getLog().info("Copying axis2.xml");
+ log.info("Copying axis2.xml");
File targetDirectory = configurationDirectory == null
? outputDirectory : new File(outputDirectory,
configurationDirectory);
try {
Modified:
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateRepositoryMojo.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateRepositoryMojo.java?rev=1739512&r1=1739511&r2=1739512&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateRepositoryMojo.java
(original)
+++
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateRepositoryMojo.java
Sat Apr 16 20:58:47 2016
@@ -33,6 +33,13 @@ import org.apache.maven.artifact.Artifac
*/
public class CreateRepositoryMojo extends AbstractCreateRepositoryMojo {
/**
+ * Input directory with additional files to be copied to the repository.
+ *
+ * @parameter default-value="src/main/repository"
+ */
+ private File inputDirectory;
+
+ /**
* The output directory where the repository will be created.
*
* @parameter default-value="${project.build.directory}/repository"
@@ -45,6 +52,11 @@ public class CreateRepositoryMojo extend
}
@Override
+ protected File getInputDirectory() {
+ return inputDirectory;
+ }
+
+ @Override
protected File getOutputDirectory() {
return outputDirectory;
}
Modified:
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateTestRepositoryMojo.java
URL:
http://svn.apache.org/viewvc/axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateTestRepositoryMojo.java?rev=1739512&r1=1739511&r2=1739512&view=diff
==============================================================================
---
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateTestRepositoryMojo.java
(original)
+++
axis/axis2/java/core/trunk/modules/tool/axis2-repo-maven-plugin/src/main/java/org/apache/axis2/maven2/repo/CreateTestRepositoryMojo.java
Sat Apr 16 20:58:47 2016
@@ -36,6 +36,13 @@ import org.apache.maven.plugin.MojoFailu
*/
public class CreateTestRepositoryMojo extends AbstractCreateRepositoryMojo {
/**
+ * Input directory with additional files to be copied to the repository.
+ *
+ * @parameter default-value="src/test/repository"
+ */
+ private File inputDirectory;
+
+ /**
* The output directory where the repository will be created.
*
* @parameter default-value="${project.build.directory}/test-repository"
@@ -54,6 +61,11 @@ public class CreateTestRepositoryMojo ex
}
@Override
+ protected File getInputDirectory() {
+ return inputDirectory;
+ }
+
+ @Override
protected File getOutputDirectory() {
return outputDirectory;
}