fix line endings
git-svn-id: https://svn.apache.org/repos/asf/incubator/npanday/trunk@1619666 13f79535-47bb-0310-9956-ffa450edef68
diff --git a/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java b/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java
index 3e6d1b8..62345a5 100644
--- a/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java
+++ b/components/dotnet-executable/src/main/java/npanday/executable/impl/DefaultNetExecutable.java
@@ -1,104 +1,104 @@
-package npanday.executable.impl;
-
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-import npanday.NPandayContext;
-import npanday.PathUtil;
-import npanday.PlatformUnsupportedException;
-import npanday.executable.CommandExecutor;
-import npanday.executable.CommandFilter;
-import npanday.executable.ExecutableContext;
-import npanday.executable.ExecutionException;
-import npanday.executable.ExecutionResult;
-import npanday.executable.NetExecutable;
-import npanday.vendor.Vendor;
-import org.codehaus.plexus.logging.Logger;
-
-import java.util.Collection;
-import java.util.Collections;
-import java.util.List;
-import java.util.Properties;
-
-/**
- * Provides the default implementation of the net executable.
- *
- * @author Shane Isbell
- */
-public class DefaultNetExecutable
- implements NetExecutable
-{
-
- protected ExecutableContext executableContext;
-
- /**
- * A logger for writing log messages
- */
- protected Logger logger;
-
- private Collection<String> commands;
-
- private Properties configuration;
-
- public List<String> getCommands() throws ExecutionException, PlatformUnsupportedException
- {
- // TODO: should it fail on unsupported commands?
- CommandFilter filter = executableContext.getCommandFilter();
- return Collections.unmodifiableList( filter.filter( commands ) );
- }
-
- public ExecutionResult execute() throws ExecutionException, PlatformUnsupportedException
- {
- return innerExecute();
- }
-
- public ExecutionResult innerExecute() throws ExecutionException, PlatformUnsupportedException
- {
- List<String> commands = getCommands();
-
- CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor(
- configuration);
- commandExecutor.setLogger( logger );
- commandExecutor.executeCommand(
- PathUtil.getExecutable(
- executableContext.getExecutableName(), executableContext.getProbingPaths(), logger
- ), commands, null, true
- );
-
- return new ExecutionResult(
- commandExecutor.getResult(),
- commandExecutor.getStandardOut(),
- commandExecutor.getStandardError()
- );
-
- }
-
- public Vendor getVendor()
- {
- return executableContext.getVendor();
- }
-
- public void init( NPandayContext npandayContext, Properties properties )
- {
- configuration = properties;
- this.executableContext = (ExecutableContext) npandayContext;
- this.logger = executableContext.getLogger();
- commands = executableContext.getCommands();
- }
+package npanday.executable.impl;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+import npanday.NPandayContext;
+import npanday.PathUtil;
+import npanday.PlatformUnsupportedException;
+import npanday.executable.CommandExecutor;
+import npanday.executable.CommandFilter;
+import npanday.executable.ExecutableContext;
+import npanday.executable.ExecutionException;
+import npanday.executable.ExecutionResult;
+import npanday.executable.NetExecutable;
+import npanday.vendor.Vendor;
+import org.codehaus.plexus.logging.Logger;
+
+import java.util.Collection;
+import java.util.Collections;
+import java.util.List;
+import java.util.Properties;
+
+/**
+ * Provides the default implementation of the net executable.
+ *
+ * @author Shane Isbell
+ */
+public class DefaultNetExecutable
+ implements NetExecutable
+{
+
+ protected ExecutableContext executableContext;
+
+ /**
+ * A logger for writing log messages
+ */
+ protected Logger logger;
+
+ private Collection<String> commands;
+
+ private Properties configuration;
+
+ public List<String> getCommands() throws ExecutionException, PlatformUnsupportedException
+ {
+ // TODO: should it fail on unsupported commands?
+ CommandFilter filter = executableContext.getCommandFilter();
+ return Collections.unmodifiableList( filter.filter( commands ) );
+ }
+
+ public ExecutionResult execute() throws ExecutionException, PlatformUnsupportedException
+ {
+ return innerExecute();
+ }
+
+ public ExecutionResult innerExecute() throws ExecutionException, PlatformUnsupportedException
+ {
+ List<String> commands = getCommands();
+
+ CommandExecutor commandExecutor = CommandExecutor.Factory.createDefaultCommmandExecutor(
+ configuration);
+ commandExecutor.setLogger( logger );
+ commandExecutor.executeCommand(
+ PathUtil.getExecutable(
+ executableContext.getExecutableName(), executableContext.getProbingPaths(), logger
+ ), commands, null, true
+ );
+
+ return new ExecutionResult(
+ commandExecutor.getResult(),
+ commandExecutor.getStandardOut(),
+ commandExecutor.getStandardError()
+ );
+
+ }
+
+ public Vendor getVendor()
+ {
+ return executableContext.getVendor();
+ }
+
+ public void init( NPandayContext npandayContext, Properties properties )
+ {
+ configuration = properties;
+ this.executableContext = (ExecutableContext) npandayContext;
+ this.logger = executableContext.getLogger();
+ commands = executableContext.getCommands();
+ }
}
\ No newline at end of file
diff --git a/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java b/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java
index 323c5aa..0b18747 100644
--- a/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java
+++ b/components/dotnet-executable/src/main/java/npanday/resolver/NPandayResolutionCache.java
@@ -1,58 +1,58 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.resolver;
-
-import com.google.common.collect.Sets;
-import org.apache.maven.artifact.Artifact;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-
-import java.io.File;
-import java.util.HashSet;
-import java.util.Hashtable;
-
-/**
- * The instance of this cache should span the full maven reactor build.
- * Resolving the artifact file once pr. artifact id is enough.
- *
- * @author <a href="mailto:me@lcorneliussen.de>Lars Corneliussen, Faktum Software</a>
- * @plexus.component role="npanday.resolver.NPandayResolutionCache"
- */
-public class NPandayResolutionCache
- extends AbstractLogEnabled
-{
- private Hashtable<String, File> cache = new Hashtable<String, File>();
-
- public void put(Artifact artifact){
- cache.put(artifact.getId(), artifact.getFile());
- }
-
- public Boolean applyTo(Artifact artifact){
- String key = artifact.getId();
- if (cache.containsKey(key)){
- File resolvedFile = cache.get(key);
- if (resolvedFile != null){
- artifact.setFile(resolvedFile);
- artifact.setResolved(true);
- }
- return true;
- }
- return false;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.resolver;
+
+import com.google.common.collect.Sets;
+import org.apache.maven.artifact.Artifact;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.io.File;
+import java.util.HashSet;
+import java.util.Hashtable;
+
+/**
+ * The instance of this cache should span the full maven reactor build.
+ * Resolving the artifact file once pr. artifact id is enough.
+ *
+ * @author <a href="mailto:me@lcorneliussen.de>Lars Corneliussen, Faktum Software</a>
+ * @plexus.component role="npanday.resolver.NPandayResolutionCache"
+ */
+public class NPandayResolutionCache
+ extends AbstractLogEnabled
+{
+ private Hashtable<String, File> cache = new Hashtable<String, File>();
+
+ public void put(Artifact artifact){
+ cache.put(artifact.getId(), artifact.getFile());
+ }
+
+ public Boolean applyTo(Artifact artifact){
+ String key = artifact.getId();
+ if (cache.containsKey(key)){
+ File resolvedFile = cache.get(key);
+ if (resolvedFile != null){
+ artifact.setFile(resolvedFile);
+ artifact.setResolved(true);
+ }
+ return true;
+ }
+ return false;
+ }
+}
diff --git a/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java b/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java
index 0702b81..a44fe24 100644
--- a/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java
+++ b/components/dotnet-executable/src/main/java/npanday/resolver/resolvers/PdbAssemblyResolver.java
@@ -1,105 +1,105 @@
-package npanday.resolver.resolvers;
-
-import java.util.List;
-import java.util.Set;
-
-import npanday.resolver.NPandayResolutionCache;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.factory.ArtifactFactory;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.ArtifactResolver;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-
-import npanday.ArtifactType;
-import npanday.ArtifactTypeHelper;
-import npanday.resolver.ArtifactResolvingContributor;
-
-/**
- * PDB assemblies contributor class.
- * @plexus.component role="npanday.resolver.ArtifactResolvingContributor" role-hint="pdb"
- */
-public class PdbAssemblyResolver extends AbstractLogEnabled implements ArtifactResolvingContributor
-{
- /** @plexus.requirement */
- ArtifactResolver mavenResolver;
-
- /** @plexus.requirement */
- ArtifactFactory artifactFactory;
-
- /** @plexus.requirement */
- NPandayResolutionCache cache;
-
- /**
- * {@inheritDoc}
- */
- public void tryResolve(Artifact artifact, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter)
- throws ArtifactNotFoundException
- {
- // NO-OP
- }
-
-
- /**
- * {@inheritDoc}
- */
- public void contribute(Artifact artifact, ArtifactRepository localRepository,
- @SuppressWarnings("rawtypes") List remoteRepositories,
- Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException
- {
- final ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName(artifact.getType());
- if ( !ArtifactTypeHelper.isDotnetAnyGac(artifactType) &&
- !ArtifactTypeHelper.isComReference(artifactType) &&
- ArtifactTypeHelper.isDotnetLibraryOrExecutable(artifactType))
- {
- tryResolveArtifactPdbAssembly(artifact, localRepository, remoteRepositories,
- additionalDependenciesCollector, filter);
- }
- }
-
- /**
- * Try to resolve PDB artifact for given artifact.
- *
- * @param artifact
- * @param localRepository
- * @param remoteRepositories
- * @param additionalDependenciesCollector
- * @param filter
- * @throws ArtifactNotFoundException
- */
- private void tryResolveArtifactPdbAssembly(Artifact artifact, ArtifactRepository localRepository,
- List remoteRepositories, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException
- {
- Artifact pdbArtifact = artifactFactory.createArtifactWithClassifier(artifact.getGroupId(), artifact.getArtifactId(),
- artifact.getVersion(), ArtifactType.DOTNET_SYMBOLS.getPackagingType(), artifact.getClassifier());
- pdbArtifact.setScope(artifact.getScope());
- pdbArtifact.setRelease(artifact.isRelease());
- pdbArtifact.setDependencyTrail(artifact.getDependencyTrail());
-
- if(filter != null && !filter.include(pdbArtifact)){
- getLogger().debug("NPANDAY-157-003: resolving pdb for " + artifact.getId() + " was excluded by a filter");
- return;
- }
-
- Boolean wasCached = cache.applyTo(pdbArtifact);
- if (!wasCached) {
- try {
- mavenResolver.resolve(pdbArtifact, remoteRepositories, localRepository);
- // the complimentary artifact should have the same scope as the leading one
- getLogger().debug("NPANDAY-157-001: found a pdb for " + artifact.getId());
-
- } catch (ArtifactNotFoundException e) {
- getLogger().debug("NPANDAY-157-002: no pdb found for " + artifact.getId());
- } catch (ArtifactResolutionException e) {
- throw new ArtifactNotFoundException(e.getMessage(), artifact);
- }
-
- cache.put(pdbArtifact);
- }
- if (pdbArtifact.isResolved()){
- additionalDependenciesCollector.add(pdbArtifact);
- }
- }
-}
+package npanday.resolver.resolvers;
+
+import java.util.List;
+import java.util.Set;
+
+import npanday.resolver.NPandayResolutionCache;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.factory.ArtifactFactory;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.artifact.resolver.ArtifactNotFoundException;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.ArtifactResolver;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import npanday.ArtifactType;
+import npanday.ArtifactTypeHelper;
+import npanday.resolver.ArtifactResolvingContributor;
+
+/**
+ * PDB assemblies contributor class.
+ * @plexus.component role="npanday.resolver.ArtifactResolvingContributor" role-hint="pdb"
+ */
+public class PdbAssemblyResolver extends AbstractLogEnabled implements ArtifactResolvingContributor
+{
+ /** @plexus.requirement */
+ ArtifactResolver mavenResolver;
+
+ /** @plexus.requirement */
+ ArtifactFactory artifactFactory;
+
+ /** @plexus.requirement */
+ NPandayResolutionCache cache;
+
+ /**
+ * {@inheritDoc}
+ */
+ public void tryResolve(Artifact artifact, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter)
+ throws ArtifactNotFoundException
+ {
+ // NO-OP
+ }
+
+
+ /**
+ * {@inheritDoc}
+ */
+ public void contribute(Artifact artifact, ArtifactRepository localRepository,
+ @SuppressWarnings("rawtypes") List remoteRepositories,
+ Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException
+ {
+ final ArtifactType artifactType = ArtifactType.getArtifactTypeForPackagingName(artifact.getType());
+ if ( !ArtifactTypeHelper.isDotnetAnyGac(artifactType) &&
+ !ArtifactTypeHelper.isComReference(artifactType) &&
+ ArtifactTypeHelper.isDotnetLibraryOrExecutable(artifactType))
+ {
+ tryResolveArtifactPdbAssembly(artifact, localRepository, remoteRepositories,
+ additionalDependenciesCollector, filter);
+ }
+ }
+
+ /**
+ * Try to resolve PDB artifact for given artifact.
+ *
+ * @param artifact
+ * @param localRepository
+ * @param remoteRepositories
+ * @param additionalDependenciesCollector
+ * @param filter
+ * @throws ArtifactNotFoundException
+ */
+ private void tryResolveArtifactPdbAssembly(Artifact artifact, ArtifactRepository localRepository,
+ List remoteRepositories, Set<Artifact> additionalDependenciesCollector, ArtifactFilter filter) throws ArtifactNotFoundException
+ {
+ Artifact pdbArtifact = artifactFactory.createArtifactWithClassifier(artifact.getGroupId(), artifact.getArtifactId(),
+ artifact.getVersion(), ArtifactType.DOTNET_SYMBOLS.getPackagingType(), artifact.getClassifier());
+ pdbArtifact.setScope(artifact.getScope());
+ pdbArtifact.setRelease(artifact.isRelease());
+ pdbArtifact.setDependencyTrail(artifact.getDependencyTrail());
+
+ if(filter != null && !filter.include(pdbArtifact)){
+ getLogger().debug("NPANDAY-157-003: resolving pdb for " + artifact.getId() + " was excluded by a filter");
+ return;
+ }
+
+ Boolean wasCached = cache.applyTo(pdbArtifact);
+ if (!wasCached) {
+ try {
+ mavenResolver.resolve(pdbArtifact, remoteRepositories, localRepository);
+ // the complimentary artifact should have the same scope as the leading one
+ getLogger().debug("NPANDAY-157-001: found a pdb for " + artifact.getId());
+
+ } catch (ArtifactNotFoundException e) {
+ getLogger().debug("NPANDAY-157-002: no pdb found for " + artifact.getId());
+ } catch (ArtifactResolutionException e) {
+ throw new ArtifactNotFoundException(e.getMessage(), artifact);
+ }
+
+ cache.put(pdbArtifact);
+ }
+ if (pdbArtifact.isResolved()){
+ additionalDependenciesCollector.add(pdbArtifact);
+ }
+ }
+}
diff --git a/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java b/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java
index b0c19ba..327b574 100644
--- a/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java
+++ b/components/dotnet-nuget/src/main/java/npanday/nuget/NugetException.java
@@ -1,48 +1,48 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.nuget;
-
-/**
- * Something went wrong while instrumenting or executing Nuget.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public class NugetException
- extends Exception
-{
- public NugetException()
- {
- }
-
- public NugetException(String message)
- {
- super( message );
- }
-
- public NugetException(String message, Throwable cause)
- {
- super( message, cause );
- }
-
- public NugetException(Throwable cause)
- {
- super( cause );
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.nuget;
+
+/**
+ * Something went wrong while instrumenting or executing Nuget.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class NugetException
+ extends Exception
+{
+ public NugetException()
+ {
+ }
+
+ public NugetException(String message)
+ {
+ super( message );
+ }
+
+ public NugetException(String message, Throwable cause)
+ {
+ super( message, cause );
+ }
+
+ public NugetException(Throwable cause)
+ {
+ super( cause );
+ }
+}
diff --git a/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java b/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java
index ef508e7..2a45f71 100644
--- a/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java
+++ b/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInstallParameters.java
@@ -1,120 +1,120 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.nuget;
-
-import com.google.common.base.Preconditions;
-import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
-
-import java.io.File;
-import java.util.Collection;
-import java.util.List;
-
-/**
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public class NugetInstallParameters
-{
- private String packageName;
-
- private String version;
-
- private File outputDirectory;
-
- private boolean prerelease;
-
- private boolean excludeVersion;
-
- private List<String> sources;
-
- public NugetInstallParameters( String packageName )
- {
- Preconditions.checkArgument( packageName != null, "packageName was null!" );
-
- this.packageName = packageName;
- }
-
- public Collection<String> buildCommands()
- {
- List<String> commands = Lists.newArrayList();
-
- commands.add( "install" );
-
- commands.add( packageName );
-
- if ( !Strings.isNullOrEmpty( version ) )
- {
- commands.add( "-Version" );
- commands.add( version );
- }
-
- if ( outputDirectory != null )
- {
- commands.add( "-OutputDirectory" );
- commands.add( outputDirectory.getAbsolutePath() );
- }
-
- if ( prerelease )
- {
- commands.add( "-Prerelease" );
- }
-
- if ( excludeVersion )
- {
- commands.add( "-ExcludeVersion" );
- }
-
- if ( sources != null && sources.size() > 0 )
- {
- for ( String source : sources )
- {
- commands.add( "-Source" );
- commands.add( source );
- }
- }
-
- return commands;
- }
-
- public void setSources( List<String> sources )
- {
- this.sources = sources;
- }
-
- public void setVersion( String version )
- {
- this.version = version;
- }
-
- public void setOutputDirectory( File outputDirectory )
- {
- this.outputDirectory = outputDirectory;
- }
-
- public void setPrerelease( boolean prerelease )
- {
- this.prerelease = prerelease;
- }
-
- public void setExcludeVersion( boolean excludeVersion )
- {
- this.excludeVersion = excludeVersion;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.nuget;
+
+import com.google.common.base.Preconditions;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+
+import java.io.File;
+import java.util.Collection;
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public class NugetInstallParameters
+{
+ private String packageName;
+
+ private String version;
+
+ private File outputDirectory;
+
+ private boolean prerelease;
+
+ private boolean excludeVersion;
+
+ private List<String> sources;
+
+ public NugetInstallParameters( String packageName )
+ {
+ Preconditions.checkArgument( packageName != null, "packageName was null!" );
+
+ this.packageName = packageName;
+ }
+
+ public Collection<String> buildCommands()
+ {
+ List<String> commands = Lists.newArrayList();
+
+ commands.add( "install" );
+
+ commands.add( packageName );
+
+ if ( !Strings.isNullOrEmpty( version ) )
+ {
+ commands.add( "-Version" );
+ commands.add( version );
+ }
+
+ if ( outputDirectory != null )
+ {
+ commands.add( "-OutputDirectory" );
+ commands.add( outputDirectory.getAbsolutePath() );
+ }
+
+ if ( prerelease )
+ {
+ commands.add( "-Prerelease" );
+ }
+
+ if ( excludeVersion )
+ {
+ commands.add( "-ExcludeVersion" );
+ }
+
+ if ( sources != null && sources.size() > 0 )
+ {
+ for ( String source : sources )
+ {
+ commands.add( "-Source" );
+ commands.add( source );
+ }
+ }
+
+ return commands;
+ }
+
+ public void setSources( List<String> sources )
+ {
+ this.sources = sources;
+ }
+
+ public void setVersion( String version )
+ {
+ this.version = version;
+ }
+
+ public void setOutputDirectory( File outputDirectory )
+ {
+ this.outputDirectory = outputDirectory;
+ }
+
+ public void setPrerelease( boolean prerelease )
+ {
+ this.prerelease = prerelease;
+ }
+
+ public void setExcludeVersion( boolean excludeVersion )
+ {
+ this.excludeVersion = excludeVersion;
+ }
+}
diff --git a/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java b/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java
index 7cfbbd8..997ea6b 100644
--- a/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java
+++ b/components/dotnet-nuget/src/main/java/npanday/nuget/NugetInvoker.java
@@ -1,71 +1,71 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.nuget;
-
-import com.google.common.collect.Lists;
-import npanday.PlatformUnsupportedException;
-import npanday.executable.ExecutableRequirement;
-import npanday.executable.ExecutionException;
-import npanday.executable.NetExecutable;
-import npanday.executable.NetExecutableFactory;
-import org.codehaus.plexus.logging.AbstractLogEnabled;
-
-import java.util.List;
-
-/**
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @plexus.component role="npanday.nuget.NugetInvoker"
- */
-public class NugetInvoker
- extends AbstractLogEnabled
-{
- /**
- * @plexus.requirement
- */
- protected NetExecutableFactory netExecutableFactory;
-
- public void install(
- ExecutableRequirement executableRequirement, NugetInstallParameters parameters ) throws
- PlatformUnsupportedException,
- NugetException
- {
- final NetExecutable executable = netExecutableFactory.getExecutable(
- executableRequirement, buildCommands( parameters ), null
- );
-
- try
- {
- executable.execute();
- }
- catch ( ExecutionException e )
- {
- throw new NugetException( "NPANDAY-143-000: Exception on executing Nuget with " + parameters, e );
- }
- }
-
- private List<String> buildCommands( NugetInstallParameters parameters )
- {
- List<String> commands = Lists.newArrayList();
-
- commands.addAll( parameters.buildCommands() );
-
- return commands;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.nuget;
+
+import com.google.common.collect.Lists;
+import npanday.PlatformUnsupportedException;
+import npanday.executable.ExecutableRequirement;
+import npanday.executable.ExecutionException;
+import npanday.executable.NetExecutable;
+import npanday.executable.NetExecutableFactory;
+import org.codehaus.plexus.logging.AbstractLogEnabled;
+
+import java.util.List;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @plexus.component role="npanday.nuget.NugetInvoker"
+ */
+public class NugetInvoker
+ extends AbstractLogEnabled
+{
+ /**
+ * @plexus.requirement
+ */
+ protected NetExecutableFactory netExecutableFactory;
+
+ public void install(
+ ExecutableRequirement executableRequirement, NugetInstallParameters parameters ) throws
+ PlatformUnsupportedException,
+ NugetException
+ {
+ final NetExecutable executable = netExecutableFactory.getExecutable(
+ executableRequirement, buildCommands( parameters ), null
+ );
+
+ try
+ {
+ executable.execute();
+ }
+ catch ( ExecutionException e )
+ {
+ throw new NugetException( "NPANDAY-143-000: Exception on executing Nuget with " + parameters, e );
+ }
+ }
+
+ private List<String> buildCommands( NugetInstallParameters parameters )
+ {
+ List<String> commands = Lists.newArrayList();
+
+ commands.addAll( parameters.buildCommands() );
+
+ return commands;
+ }
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java
index 9c2d21d..aac42dc 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/deploy/DeployLibraries.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.deploy;
-
-import npanday.plugin.libraryimporter.model.NugetPackageLibrary;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * Mojo for deploying the resolved libraries to the local repository.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal deploy-libraries
- */
-public class DeployLibraries
- extends AbstractDeployMojo
-{
- @Override
- protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException, MojoFailureException
- {
- ArtifactRepository repo = getDeploymentRepository();
- if (lib.getMarkerFileFor( artifact, repo ).exists()){
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-152-002: artifact " + artifact.getId() + " has yet been deployed to " + repo.getUrl()
- );
- }
- return;
- }
-
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-152-001: deploying artifact " + artifact.getId() + " to " + repo.getUrl()
- );
- }
-
-
- deploy( artifact.getFile(), artifact, repo );
-
- markDeployed( lib, artifact, repo );
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.deploy;
+
+import npanday.plugin.libraryimporter.model.NugetPackageLibrary;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * Mojo for deploying the resolved libraries to the local repository.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @goal deploy-libraries
+ */
+public class DeployLibraries
+ extends AbstractDeployMojo
+{
+ @Override
+ protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException, MojoFailureException
+ {
+ ArtifactRepository repo = getDeploymentRepository();
+ if (lib.getMarkerFileFor( artifact, repo ).exists()){
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-152-002: artifact " + artifact.getId() + " has yet been deployed to " + repo.getUrl()
+ );
+ }
+ return;
+ }
+
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-152-001: deploying artifact " + artifact.getId() + " to " + repo.getUrl()
+ );
+ }
+
+
+ deploy( artifact.getFile(), artifact, repo );
+
+ markDeployed( lib, artifact, repo );
+ }
+
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java
index d322da0..61356b4 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/generate/GeneratePackageArtifactsMojo.java
@@ -1,212 +1,212 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.generate;
-
-import com.google.common.base.Splitter;
-import com.google.common.base.Strings;
-import com.google.common.collect.Lists;
-import npanday.plugin.libraryimporter.NuspecMetadata;
-import npanday.plugin.libraryimporter.model.NugetPackage;
-import npanday.plugin.libraryimporter.model.NugetPackageLibrary;
-import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
-import org.apache.maven.model.Build;
-import org.apache.maven.model.Dependency;
-import org.apache.maven.model.Developer;
-import org.apache.maven.model.License;
-import org.apache.maven.model.Model;
-import org.apache.maven.model.Plugin;
-import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.FileUtils;
-import org.codehaus.plexus.util.IOUtil;
-import org.codehaus.plexus.util.WriterFactory;
-
-import java.io.File;
-import java.io.IOException;
-import java.io.Writer;
-import java.util.List;
-
-/**
- * Generates the poms and copies the libs to corresponding temp folders.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal generate-package-artifacts
- */
-public class GeneratePackageArtifactsMojo
- extends AbstractLibraryImportsProvidingMojo
-{
- /**
- * @parameter default-value="${project.build.directory}/generated-projects"
- */
- protected File generatedProjectsDirectory;
-
- @Override
- protected void innerExecute() throws MojoExecutionException, MojoFailureException
- {
- super.innerExecute();
-
- List<NugetPackageLibrary> imports = Lists.newArrayList();
-
- List<NugetPackage> nugetImports = Lists.newArrayList( getNugetImports() );
-
- for ( NugetPackage nuget : nugetImports )
- {
- try
- {
- nuget.resolveDependencies( nugetImports );
- }
- catch (MojoExecutionException e)
- {
- throw new MojoExecutionException(
- "NPANDAY-141-004: Could not satisfy dependency for " + nuget + ".", e
- );
- }
- }
-
- for ( NugetPackage nuget : nugetImports )
- {
- for ( NugetPackageLibrary lib : nuget.getLibraries(getLog(), mavenProjectsCacheDirectory) )
- {
- imports.add( lib );
- }
- }
-
- for( NugetPackageLibrary lib : imports){
-
- lib.resolveDependenciesFrom(imports);
-
- Model model = generateModel(lib.getNugetPackage().getNuspec(), lib);
-
- storePomFile( model, lib.getMavenPomFile() );
-
- File target = lib.getMavenProjectFolder();
-
- try
- {
- FileUtils.copyFileToDirectory( lib.getFile(), target );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-141-002: Error on copy file " + lib.getFile() + " to " + target, e
- );
- }
- }
-
- }
-
- Splitter AUTHORS_SPLITTER = Splitter.on( "," ).omitEmptyStrings().trimResults();
-
- private Model generateModel( NuspecMetadata nugetPackage, NugetPackageLibrary lib ) throws
- MojoExecutionException
- {
- Model model = new Model();
-
- model.setModelVersion( "4.0.0" );
-
- model.setGroupId( lib.getMavenGroupId() );
- model.setArtifactId( lib.getMavenArtifactId() );
- model.setVersion( lib.getMavenVersion() );
-
- model.setBuild( new Build() );
- model.getBuild().setFinalName( model.getArtifactId() );
-
- if ( !Strings.isNullOrEmpty( nugetPackage.getTitle() ) )
- {
- model.setName( nugetPackage.getTitle());
- }
- else
- {
- model.setName( nugetPackage.getId() );
- }
-
- model.setName( model.getName() + " :: " + model.getArtifactId() );
-
- if ( !Strings.isNullOrEmpty( nugetPackage.getProjectUrl() ) )
- {
- model.setUrl( nugetPackage.getProjectUrl() );
- }
-
-
- if ( !Strings.isNullOrEmpty( nugetPackage.getSummary() ) )
- {
- model.setDescription( nugetPackage.getSummary() );
- }
- else if ( !Strings.isNullOrEmpty( nugetPackage.getDescription() ) )
- {
- model.setDescription( nugetPackage.getDescription() );
- }
-
- if ( !Strings.isNullOrEmpty( nugetPackage.getLicenseUrl() ) )
- {
- License lic = new License();
- lic.setUrl( nugetPackage.getLicenseUrl() );
- model.getLicenses().add( lic );
- }
-
- if ( !Strings.isNullOrEmpty( nugetPackage.getAuthors() ) )
- {
- for ( String author : AUTHORS_SPLITTER.split( nugetPackage.getAuthors() ) )
- {
- Developer dev = new Developer();
- dev.setName( author );
- model.addDeveloper( dev );
- }
- }
-
- model.setPackaging( lib.getMavenPackaging() );
-
- for( NugetPackageLibrary libDep : lib.getDependencies()){
-
- Dependency dep = new Dependency();
- dep.setGroupId( libDep.getMavenGroupId() );
- dep.setArtifactId( libDep.getMavenArtifactId() );
- dep.setType( libDep.getMavenPackaging() );
-
- // TODO: should this actually be a range?
- dep.setVersion( libDep.getMavenVersion() );
-
- model.getDependencies().add( dep );
- }
-
- return model;
- }
-
- private void storePomFile( Model model, File pomFile ) throws MojoExecutionException
- {
- pomFile.getParentFile().mkdirs();
-
- Writer writer = null;
- try
- {
- writer = WriterFactory.newXmlWriter( pomFile );
- new MavenXpp3Writer().write( writer, model );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException( "NPANDAY-141-003: Error writing POM file: " + e.getMessage(), e );
- }
- finally
- {
- IOUtil.close( writer );
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.generate;
+
+import com.google.common.base.Splitter;
+import com.google.common.base.Strings;
+import com.google.common.collect.Lists;
+import npanday.plugin.libraryimporter.NuspecMetadata;
+import npanday.plugin.libraryimporter.model.NugetPackage;
+import npanday.plugin.libraryimporter.model.NugetPackageLibrary;
+import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
+import org.apache.maven.model.Build;
+import org.apache.maven.model.Dependency;
+import org.apache.maven.model.Developer;
+import org.apache.maven.model.License;
+import org.apache.maven.model.Model;
+import org.apache.maven.model.Plugin;
+import org.apache.maven.model.io.xpp3.MavenXpp3Writer;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.codehaus.plexus.util.FileUtils;
+import org.codehaus.plexus.util.IOUtil;
+import org.codehaus.plexus.util.WriterFactory;
+
+import java.io.File;
+import java.io.IOException;
+import java.io.Writer;
+import java.util.List;
+
+/**
+ * Generates the poms and copies the libs to corresponding temp folders.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @goal generate-package-artifacts
+ */
+public class GeneratePackageArtifactsMojo
+ extends AbstractLibraryImportsProvidingMojo
+{
+ /**
+ * @parameter default-value="${project.build.directory}/generated-projects"
+ */
+ protected File generatedProjectsDirectory;
+
+ @Override
+ protected void innerExecute() throws MojoExecutionException, MojoFailureException
+ {
+ super.innerExecute();
+
+ List<NugetPackageLibrary> imports = Lists.newArrayList();
+
+ List<NugetPackage> nugetImports = Lists.newArrayList( getNugetImports() );
+
+ for ( NugetPackage nuget : nugetImports )
+ {
+ try
+ {
+ nuget.resolveDependencies( nugetImports );
+ }
+ catch (MojoExecutionException e)
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-141-004: Could not satisfy dependency for " + nuget + ".", e
+ );
+ }
+ }
+
+ for ( NugetPackage nuget : nugetImports )
+ {
+ for ( NugetPackageLibrary lib : nuget.getLibraries(getLog(), mavenProjectsCacheDirectory) )
+ {
+ imports.add( lib );
+ }
+ }
+
+ for( NugetPackageLibrary lib : imports){
+
+ lib.resolveDependenciesFrom(imports);
+
+ Model model = generateModel(lib.getNugetPackage().getNuspec(), lib);
+
+ storePomFile( model, lib.getMavenPomFile() );
+
+ File target = lib.getMavenProjectFolder();
+
+ try
+ {
+ FileUtils.copyFileToDirectory( lib.getFile(), target );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-141-002: Error on copy file " + lib.getFile() + " to " + target, e
+ );
+ }
+ }
+
+ }
+
+ Splitter AUTHORS_SPLITTER = Splitter.on( "," ).omitEmptyStrings().trimResults();
+
+ private Model generateModel( NuspecMetadata nugetPackage, NugetPackageLibrary lib ) throws
+ MojoExecutionException
+ {
+ Model model = new Model();
+
+ model.setModelVersion( "4.0.0" );
+
+ model.setGroupId( lib.getMavenGroupId() );
+ model.setArtifactId( lib.getMavenArtifactId() );
+ model.setVersion( lib.getMavenVersion() );
+
+ model.setBuild( new Build() );
+ model.getBuild().setFinalName( model.getArtifactId() );
+
+ if ( !Strings.isNullOrEmpty( nugetPackage.getTitle() ) )
+ {
+ model.setName( nugetPackage.getTitle());
+ }
+ else
+ {
+ model.setName( nugetPackage.getId() );
+ }
+
+ model.setName( model.getName() + " :: " + model.getArtifactId() );
+
+ if ( !Strings.isNullOrEmpty( nugetPackage.getProjectUrl() ) )
+ {
+ model.setUrl( nugetPackage.getProjectUrl() );
+ }
+
+
+ if ( !Strings.isNullOrEmpty( nugetPackage.getSummary() ) )
+ {
+ model.setDescription( nugetPackage.getSummary() );
+ }
+ else if ( !Strings.isNullOrEmpty( nugetPackage.getDescription() ) )
+ {
+ model.setDescription( nugetPackage.getDescription() );
+ }
+
+ if ( !Strings.isNullOrEmpty( nugetPackage.getLicenseUrl() ) )
+ {
+ License lic = new License();
+ lic.setUrl( nugetPackage.getLicenseUrl() );
+ model.getLicenses().add( lic );
+ }
+
+ if ( !Strings.isNullOrEmpty( nugetPackage.getAuthors() ) )
+ {
+ for ( String author : AUTHORS_SPLITTER.split( nugetPackage.getAuthors() ) )
+ {
+ Developer dev = new Developer();
+ dev.setName( author );
+ model.addDeveloper( dev );
+ }
+ }
+
+ model.setPackaging( lib.getMavenPackaging() );
+
+ for( NugetPackageLibrary libDep : lib.getDependencies()){
+
+ Dependency dep = new Dependency();
+ dep.setGroupId( libDep.getMavenGroupId() );
+ dep.setArtifactId( libDep.getMavenArtifactId() );
+ dep.setType( libDep.getMavenPackaging() );
+
+ // TODO: should this actually be a range?
+ dep.setVersion( libDep.getMavenVersion() );
+
+ model.getDependencies().add( dep );
+ }
+
+ return model;
+ }
+
+ private void storePomFile( Model model, File pomFile ) throws MojoExecutionException
+ {
+ pomFile.getParentFile().mkdirs();
+
+ Writer writer = null;
+ try
+ {
+ writer = WriterFactory.newXmlWriter( pomFile );
+ new MavenXpp3Writer().write( writer, model );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException( "NPANDAY-141-003: Error writing POM file: " + e.getMessage(), e );
+ }
+ finally
+ {
+ IOUtil.close( writer );
+ }
+ }
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java
index 54489a9..fd46f56 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/install/InstallLibraries.java
@@ -1,73 +1,73 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.install;
-
-import npanday.plugin.libraryimporter.model.NugetPackageLibrary;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.installer.ArtifactInstallationException;
-import org.apache.maven.artifact.repository.ArtifactRepository;
-import org.apache.maven.plugin.MojoExecutionException;
-
-/**
- * Mojo for installing the resolved libraries to the local repository.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal install-libraries
- */
-public class InstallLibraries
- extends AbstractInstallMojo
-{
- @Override
- protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException
- {
- ArtifactRepository repo = getLocalArtifactRepository();
-
- if (lib.getMarkerFileFor( artifact, repo ).exists()){
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-146-002: artifact has yet been installed to local repository: " + artifact.getId()
- );
- }
- return;
- }
-
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-146-001: installing artifact to local repository: " + artifact.getId()
- );
- }
-
- try
- {
- install( lib, artifact, repo );
-
- markDeployed( lib, artifact, repo);
- }
- catch ( ArtifactInstallationException e )
- {
- throw new MojoExecutionException( "NPANDAY-146-000: Error on installing artifact: " + artifact.getId(), e );
- }
- if ( createChecksums ) {
- installChecksums( artifact );
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.install;
+
+import npanday.plugin.libraryimporter.model.NugetPackageLibrary;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.installer.ArtifactInstallationException;
+import org.apache.maven.artifact.repository.ArtifactRepository;
+import org.apache.maven.plugin.MojoExecutionException;
+
+/**
+ * Mojo for installing the resolved libraries to the local repository.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @goal install-libraries
+ */
+public class InstallLibraries
+ extends AbstractInstallMojo
+{
+ @Override
+ protected void handleGeneratedArtifacts( NugetPackageLibrary lib, Artifact artifact ) throws MojoExecutionException
+ {
+ ArtifactRepository repo = getLocalArtifactRepository();
+
+ if (lib.getMarkerFileFor( artifact, repo ).exists()){
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-146-002: artifact has yet been installed to local repository: " + artifact.getId()
+ );
+ }
+ return;
+ }
+
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-146-001: installing artifact to local repository: " + artifact.getId()
+ );
+ }
+
+ try
+ {
+ install( lib, artifact, repo );
+
+ markDeployed( lib, artifact, repo);
+ }
+ catch ( ArtifactInstallationException e )
+ {
+ throw new MojoExecutionException( "NPANDAY-146-000: Error on installing artifact: " + artifact.getId(), e );
+ }
+ if ( createChecksums ) {
+ installChecksums( artifact );
+ }
+ }
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java
index 489428a..4aa0647 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractManifestInfoMojo.java
@@ -1,41 +1,41 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.resolve;
-
-import npanday.executable.ExecutableRequirement;
-import npanday.nuget.NugetInvoker;
-import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
-
-
-/**
- * Abstract Mojo for interaction with CSPack
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public abstract class AbstractManifestInfoMojo
- extends AbstractLibraryImportsProvidingMojo
-{
- /**
- * @component
- */
- protected NugetInvoker nugetInvoker;
-
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.resolve;
+
+import npanday.executable.ExecutableRequirement;
+import npanday.nuget.NugetInvoker;
+import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
+
+
+/**
+ * Abstract Mojo for interaction with CSPack
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractManifestInfoMojo
+ extends AbstractLibraryImportsProvidingMojo
+{
+ /**
+ * @component
+ */
+ protected NugetInvoker nugetInvoker;
+
+
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java
index 0b0a184..14fc89a 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/AbstractNugetMojo.java
@@ -1,64 +1,64 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.resolve;
-
-import npanday.executable.ExecutableRequirement;
-import npanday.nuget.NugetInvoker;
-import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
-
-
-/**
- * Abstract Mojo for interaction with CSPack
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public abstract class AbstractNugetMojo
- extends AbstractLibraryImportsProvidingMojo
-{
- /**
- * @component
- */
- protected NugetInvoker nugetInvoker;
-
- /**
- * The executable identifier used to locate the right configurations from executable-plugins.xml. Can't be changed.
- */
- private String executableIdentifier = "NUGET";
-
- /**
- * The nuget version to be used.
- *
- * @parameter expression="${nuget.version}" default-value="1.7"
- */
- private String executableVersion;
-
- /**
- * The profile to be used for retrieving the nuget exectuable.
- *
- * @parameter expression="${nuget.profile}"
- */
- private String executableProfile;
-
- protected ExecutableRequirement getExecutableRequirement()
- {
- // TODO: profile is actually an identifier; the real profile has yet to be supported
- return new ExecutableRequirement( getVendorRequirement(), executableIdentifier, executableVersion );
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.resolve;
+
+import npanday.executable.ExecutableRequirement;
+import npanday.nuget.NugetInvoker;
+import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
+
+
+/**
+ * Abstract Mojo for interaction with CSPack
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractNugetMojo
+ extends AbstractLibraryImportsProvidingMojo
+{
+ /**
+ * @component
+ */
+ protected NugetInvoker nugetInvoker;
+
+ /**
+ * The executable identifier used to locate the right configurations from executable-plugins.xml. Can't be changed.
+ */
+ private String executableIdentifier = "NUGET";
+
+ /**
+ * The nuget version to be used.
+ *
+ * @parameter expression="${nuget.version}" default-value="1.7"
+ */
+ private String executableVersion;
+
+ /**
+ * The profile to be used for retrieving the nuget exectuable.
+ *
+ * @parameter expression="${nuget.profile}"
+ */
+ private String executableProfile;
+
+ protected ExecutableRequirement getExecutableRequirement()
+ {
+ // TODO: profile is actually an identifier; the real profile has yet to be supported
+ return new ExecutableRequirement( getVendorRequirement(), executableIdentifier, executableVersion );
+ }
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ExtractNuspecFromPackagesMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ExtractNuspecFromPackagesMojo.java
index 4bfa598..8b42bd4 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ExtractNuspecFromPackagesMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ExtractNuspecFromPackagesMojo.java
@@ -1,119 +1,119 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.resolve;
-
-import npanday.plugin.libraryimporter.model.NugetPackage;
-import npanday.plugin.libraryimporter.skeletons.AbstractHandleEachImportMojo;
-import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.codehaus.plexus.util.IOUtil;
-
-import java.io.FileInputStream;
-import java.io.FileNotFoundException;
-import java.io.FileOutputStream;
-import java.io.IOException;
-import java.util.zip.ZipEntry;
-import java.util.zip.ZipInputStream;
-
-/**
- * Extract nuspec files from resolved Nuget packages.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal extract-nuspec
- */
-public class ExtractNuspecFromPackagesMojo
- extends AbstractHandleEachImportMojo
-{
- @Override
- protected void handleNugetPackage( NugetPackage nuget ) throws MojoExecutionException, MojoFailureException
- {
- FileInputStream zipFile = null;
- try
- {
- zipFile = new FileInputStream( nuget.getPackageFile().getAbsolutePath() );
- ZipInputStream zip = new ZipInputStream( zipFile );
- ZipEntry ze;
-
- String foundSpec = null;
-
- while ( ( ze = zip.getNextEntry() ) != null )
- {
- if ( ze.getName().endsWith( ".nuspec" ) )
- {
- foundSpec = ze.getName();
-
- byte[] buf = new byte[1024];
-
- FileOutputStream fileoutputstream = null;
- try
- {
- fileoutputstream = new FileOutputStream( nuget.getNuspecFile().getAbsolutePath() );
-
- int n;
- while ( ( n = zip.read( buf, 0, 1024 ) ) > -1 )
- {
- fileoutputstream.write( buf, 0, n );
- }
- }
- finally
- {
- IOUtil.close( fileoutputstream );
- }
-
- break;
- }
- }
-
- if ( foundSpec == null )
- {
- throw new MojoExecutionException(
- "NPANDAY-139-004: Could not find nuspec in package file " + nuget.getPackageFile()
- );
- }
- else
- {
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-139-005: found nuspec " + foundSpec + " and extracted to " + nuget.getNuspecFile()
- );
- }
- }
- }
- catch ( FileNotFoundException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-139-001: Could not find package file " + nuget.getPackageFile().getAbsolutePath()
- );
- }
- catch ( IOException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-139-003: Error on reading or extracting zip contents of " + nuget.getPackageFile()
- );
- }
- finally
- {
- IOUtil.close( zipFile );
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.resolve;
+
+import npanday.plugin.libraryimporter.model.NugetPackage;
+import npanday.plugin.libraryimporter.skeletons.AbstractHandleEachImportMojo;
+import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.codehaus.plexus.util.IOUtil;
+
+import java.io.FileInputStream;
+import java.io.FileNotFoundException;
+import java.io.FileOutputStream;
+import java.io.IOException;
+import java.util.zip.ZipEntry;
+import java.util.zip.ZipInputStream;
+
+/**
+ * Extract nuspec files from resolved Nuget packages.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @goal extract-nuspec
+ */
+public class ExtractNuspecFromPackagesMojo
+ extends AbstractHandleEachImportMojo
+{
+ @Override
+ protected void handleNugetPackage( NugetPackage nuget ) throws MojoExecutionException, MojoFailureException
+ {
+ FileInputStream zipFile = null;
+ try
+ {
+ zipFile = new FileInputStream( nuget.getPackageFile().getAbsolutePath() );
+ ZipInputStream zip = new ZipInputStream( zipFile );
+ ZipEntry ze;
+
+ String foundSpec = null;
+
+ while ( ( ze = zip.getNextEntry() ) != null )
+ {
+ if ( ze.getName().endsWith( ".nuspec" ) )
+ {
+ foundSpec = ze.getName();
+
+ byte[] buf = new byte[1024];
+
+ FileOutputStream fileoutputstream = null;
+ try
+ {
+ fileoutputstream = new FileOutputStream( nuget.getNuspecFile().getAbsolutePath() );
+
+ int n;
+ while ( ( n = zip.read( buf, 0, 1024 ) ) > -1 )
+ {
+ fileoutputstream.write( buf, 0, n );
+ }
+ }
+ finally
+ {
+ IOUtil.close( fileoutputstream );
+ }
+
+ break;
+ }
+ }
+
+ if ( foundSpec == null )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-139-004: Could not find nuspec in package file " + nuget.getPackageFile()
+ );
+ }
+ else
+ {
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-139-005: found nuspec " + foundSpec + " and extracted to " + nuget.getNuspecFile()
+ );
+ }
+ }
+ }
+ catch ( FileNotFoundException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-139-001: Could not find package file " + nuget.getPackageFile().getAbsolutePath()
+ );
+ }
+ catch ( IOException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-139-003: Error on reading or extracting zip contents of " + nuget.getPackageFile()
+ );
+ }
+ finally
+ {
+ IOUtil.close( zipFile );
+ }
+ }
+
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/GeneratePackageManifestInfosMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/GeneratePackageManifestInfosMojo.java
index ae9ee31..388d72b 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/GeneratePackageManifestInfosMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/GeneratePackageManifestInfosMojo.java
@@ -1,121 +1,121 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.resolve;
-
-import com.google.common.collect.Lists;
-import npanday.PlatformUnsupportedException;
-import npanday.executable.ExecutableRequirement;
-import npanday.executable.ExecutionException;
-import npanday.executable.NetExecutable;
-import npanday.plugin.libraryimporter.model.NugetPackage;
-import npanday.plugin.libraryimporter.skeletons.AbstractHandleEachImportMojo;
-import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-import java.io.File;
-
-/**
- * Generate manifest-info for each.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal generate-package-manifestinfos
- */
-public class GeneratePackageManifestInfosMojo
- extends AbstractHandleEachImportMojo
-{
- /**
- * The executable identifier used to locate the right configurations from executable-plugins.xml. Can't be changed.
- */
- private String executableIdentifier = "MANIFESTINFO";
-
- /**
- * The configured executable version, from executable-plugins.xml, to be used. Should align to a installed
- * Azure SDK version.
- *
- * @parameter expression="${nuget.version}" default-value="1.0"
- */
- private String executableVersion;
-
- /**
- * The configured executable profile, from executable-plugins.xml, to be used.
- *
- * @parameter expression="${nuget.profile}"
- */
- private String executableProfile;
-
- protected ExecutableRequirement getExecutableRequirement()
- {
- // TODO: profile is actually an identifier; the real profile has yet to be supported
- return new ExecutableRequirement( getVendorRequirement(), executableIdentifier, executableVersion );
- }
-
- @Override
- protected void handleNugetPackage( NugetPackage nuget ) throws MojoExecutionException, MojoFailureException
- {
- for ( File libDir : nuget.getLibraryDirectories() )
- {
- File manifestInfoFile = new File( libDir, "manifestinfo.xml" );
-
- if ( manifestInfoFile.exists() )
- {
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-140-002: skipping; manifest info does already exist for " + libDir
- );
- }
- continue;
- }
-
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug(
- "NPANDAY-140-002: running manifestinfo for " + libDir
- );
- }
-
- final NetExecutable executable;
- try
- {
-
- executable = netExecutableFactory.getExecutable(
- getExecutableRequirement(), Lists.newArrayList(
- libDir.getAbsolutePath(), "-x", "-r", "-q", "-o", manifestInfoFile.getAbsolutePath()
- ), null
- );
-
- executable.execute();
- }
- catch ( ExecutionException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-140-000: Error occured when running manifestinfo for " + libDir, e
- );
- }
- catch ( PlatformUnsupportedException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-140-001: Error occured when running manifestinfo for " + libDir, e
- );
- }
- }
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.resolve;
+
+import com.google.common.collect.Lists;
+import npanday.PlatformUnsupportedException;
+import npanday.executable.ExecutableRequirement;
+import npanday.executable.ExecutionException;
+import npanday.executable.NetExecutable;
+import npanday.plugin.libraryimporter.model.NugetPackage;
+import npanday.plugin.libraryimporter.skeletons.AbstractHandleEachImportMojo;
+import npanday.plugin.libraryimporter.skeletons.AbstractLibraryImportsProvidingMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+import java.io.File;
+
+/**
+ * Generate manifest-info for each.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @goal generate-package-manifestinfos
+ */
+public class GeneratePackageManifestInfosMojo
+ extends AbstractHandleEachImportMojo
+{
+ /**
+ * The executable identifier used to locate the right configurations from executable-plugins.xml. Can't be changed.
+ */
+ private String executableIdentifier = "MANIFESTINFO";
+
+ /**
+ * The configured executable version, from executable-plugins.xml, to be used. Should align to a installed
+ * Azure SDK version.
+ *
+ * @parameter expression="${nuget.version}" default-value="1.0"
+ */
+ private String executableVersion;
+
+ /**
+ * The configured executable profile, from executable-plugins.xml, to be used.
+ *
+ * @parameter expression="${nuget.profile}"
+ */
+ private String executableProfile;
+
+ protected ExecutableRequirement getExecutableRequirement()
+ {
+ // TODO: profile is actually an identifier; the real profile has yet to be supported
+ return new ExecutableRequirement( getVendorRequirement(), executableIdentifier, executableVersion );
+ }
+
+ @Override
+ protected void handleNugetPackage( NugetPackage nuget ) throws MojoExecutionException, MojoFailureException
+ {
+ for ( File libDir : nuget.getLibraryDirectories() )
+ {
+ File manifestInfoFile = new File( libDir, "manifestinfo.xml" );
+
+ if ( manifestInfoFile.exists() )
+ {
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-140-002: skipping; manifest info does already exist for " + libDir
+ );
+ }
+ continue;
+ }
+
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug(
+ "NPANDAY-140-002: running manifestinfo for " + libDir
+ );
+ }
+
+ final NetExecutable executable;
+ try
+ {
+
+ executable = netExecutableFactory.getExecutable(
+ getExecutableRequirement(), Lists.newArrayList(
+ libDir.getAbsolutePath(), "-x", "-r", "-q", "-o", manifestInfoFile.getAbsolutePath()
+ ), null
+ );
+
+ executable.execute();
+ }
+ catch ( ExecutionException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-140-000: Error occured when running manifestinfo for " + libDir, e
+ );
+ }
+ catch ( PlatformUnsupportedException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-140-001: Error occured when running manifestinfo for " + libDir, e
+ );
+ }
+ }
+ }
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ResolvePackagesMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ResolvePackagesMojo.java
index a782244..4a1e43c 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ResolvePackagesMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/resolve/ResolvePackagesMojo.java
@@ -1,99 +1,99 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.resolve;
-
-import npanday.PlatformUnsupportedException;
-import npanday.nuget.NugetException;
-import npanday.nuget.NugetInstallParameters;
-import npanday.plugin.libraryimporter.model.NugetPackage;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-import java.util.List;
-
-/**
- * Resolve configured Nuget packages and install them to a cache directory.
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @goal resolve-packages
- */
-public class ResolvePackagesMojo
- extends AbstractNugetMojo
-{
- @Override
- protected void innerExecute() throws MojoExecutionException, MojoFailureException
- {
- super.innerExecute();
-
- for ( NugetPackage nuget : getNugetImports() )
- {
- if ( nuget.getDirectory().exists() )
- {
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug( "NPANDAY-138-004: package " + nuget + " is already installed." );
- }
- continue;
- }
-
- NugetInstallParameters params = new NugetInstallParameters( nuget.getName() );
- params.setVersion( nuget.getVersion().toString() );
- params.setOutputDirectory( packageCacheDirectory );
-
- // NOTE: since we only have explicit versions, it is ok, if they are pre-released
- params.setPrerelease( true );
-
- List<String> sources = nuget.getSources();
- if (sources != null){
- params.setSources( sources );
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug( "NPANDAY-138-005: package " + nuget + " has custom sources configured: " + sources );
- }
- }
- else {
- if ( getLog().isDebugEnabled() )
- {
- getLog().debug( "NPANDAY-138-006: package " + nuget + " will be retrieved from default sources" );
- }
- }
-
- try
- {
- nugetInvoker.install(
- getExecutableRequirement(), params
- );
- }
- catch ( PlatformUnsupportedException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-138-002: An error occurred while trying to install package " + nuget, e
- );
- }
- catch ( NugetException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-138-003: An error occurred while trying to install package " + nuget, e
- );
- }
- }
- }
-}
-
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.resolve;
+
+import npanday.PlatformUnsupportedException;
+import npanday.nuget.NugetException;
+import npanday.nuget.NugetInstallParameters;
+import npanday.plugin.libraryimporter.model.NugetPackage;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+import java.util.List;
+
+/**
+ * Resolve configured Nuget packages and install them to a cache directory.
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @goal resolve-packages
+ */
+public class ResolvePackagesMojo
+ extends AbstractNugetMojo
+{
+ @Override
+ protected void innerExecute() throws MojoExecutionException, MojoFailureException
+ {
+ super.innerExecute();
+
+ for ( NugetPackage nuget : getNugetImports() )
+ {
+ if ( nuget.getDirectory().exists() )
+ {
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug( "NPANDAY-138-004: package " + nuget + " is already installed." );
+ }
+ continue;
+ }
+
+ NugetInstallParameters params = new NugetInstallParameters( nuget.getName() );
+ params.setVersion( nuget.getVersion().toString() );
+ params.setOutputDirectory( packageCacheDirectory );
+
+ // NOTE: since we only have explicit versions, it is ok, if they are pre-released
+ params.setPrerelease( true );
+
+ List<String> sources = nuget.getSources();
+ if (sources != null){
+ params.setSources( sources );
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug( "NPANDAY-138-005: package " + nuget + " has custom sources configured: " + sources );
+ }
+ }
+ else {
+ if ( getLog().isDebugEnabled() )
+ {
+ getLog().debug( "NPANDAY-138-006: package " + nuget + " will be retrieved from default sources" );
+ }
+ }
+
+ try
+ {
+ nugetInvoker.install(
+ getExecutableRequirement(), params
+ );
+ }
+ catch ( PlatformUnsupportedException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-138-002: An error occurred while trying to install package " + nuget, e
+ );
+ }
+ catch ( NugetException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-138-003: An error occurred while trying to install package " + nuget, e
+ );
+ }
+ }
+ }
+}
+
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java
index 45f6352..765787a 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandayMojo.java
@@ -1,103 +1,103 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.skeletons;
-
-import com.google.common.base.Splitter;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.apache.maven.project.MavenProjectHelper;
-
-import static com.google.common.collect.Iterables.toArray;
-
-/**
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public abstract class AbstractNPandayMojo
- extends AbstractMojo
-{
- public Splitter SPLIT_ON_SEMICOLON = Splitter.on( ';' ).omitEmptyStrings().trimResults();
-
- /**
- * If the execution of this goal is to be skipped.
- *
- * @parameter
- */
- protected boolean skip;
-
- /**
- * The maven project.
- *
- * @parameter expression="${project}"
- * @required
- */
- protected MavenProject project;
-
- /**
- * The maven project helper.
- *
- * @component
- */
- protected MavenProjectHelper projectHelper;
-
- public final void execute() throws MojoExecutionException, MojoFailureException
- {
- if ( skip )
- {
- getLog().info(
- "NPANDAY-126-000: Execution of '" + getClass().getSimpleName() + "' was skipped by configuration."
- );
- return;
- }
-
- setupParameters();
-
- innerExecute();
- }
-
- protected void setupParameters()
- {
-
- }
-
- protected String[] firstNonNull( String commandlineValues, String[] configurationValues )
- {
- return firstNonNull( commandlineValues, configurationValues, new String[0] );
- }
-
- protected String[] firstNonNull( String commandlineValues, String[] configurationValues, String[] defaultValue )
- {
- if ( commandlineValues != null )
- {
- return toArray(
- SPLIT_ON_SEMICOLON.split( commandlineValues ), String.class
- );
- }
-
- if (configurationValues != null){
- return configurationValues;
- }
-
- return defaultValue;
- }
-
- protected abstract void innerExecute() throws MojoExecutionException, MojoFailureException;
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.skeletons;
+
+import com.google.common.base.Splitter;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.apache.maven.project.MavenProjectHelper;
+
+import static com.google.common.collect.Iterables.toArray;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractNPandayMojo
+ extends AbstractMojo
+{
+ public Splitter SPLIT_ON_SEMICOLON = Splitter.on( ';' ).omitEmptyStrings().trimResults();
+
+ /**
+ * If the execution of this goal is to be skipped.
+ *
+ * @parameter
+ */
+ protected boolean skip;
+
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ */
+ protected MavenProject project;
+
+ /**
+ * The maven project helper.
+ *
+ * @component
+ */
+ protected MavenProjectHelper projectHelper;
+
+ public final void execute() throws MojoExecutionException, MojoFailureException
+ {
+ if ( skip )
+ {
+ getLog().info(
+ "NPANDAY-126-000: Execution of '" + getClass().getSimpleName() + "' was skipped by configuration."
+ );
+ return;
+ }
+
+ setupParameters();
+
+ innerExecute();
+ }
+
+ protected void setupParameters()
+ {
+
+ }
+
+ protected String[] firstNonNull( String commandlineValues, String[] configurationValues )
+ {
+ return firstNonNull( commandlineValues, configurationValues, new String[0] );
+ }
+
+ protected String[] firstNonNull( String commandlineValues, String[] configurationValues, String[] defaultValue )
+ {
+ if ( commandlineValues != null )
+ {
+ return toArray(
+ SPLIT_ON_SEMICOLON.split( commandlineValues ), String.class
+ );
+ }
+
+ if (configurationValues != null){
+ return configurationValues;
+ }
+
+ return defaultValue;
+ }
+
+ protected abstract void innerExecute() throws MojoExecutionException, MojoFailureException;
+}
diff --git a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java
index 31babc9..4170b57 100644
--- a/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java
+++ b/plugins/library-importer-maven-plugin/src/main/java/npanday/plugin/libraryimporter/skeletons/AbstractNPandaySettingsAwareMojo.java
@@ -1,80 +1,80 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.libraryimporter.skeletons;
-
-import npanday.registry.RepositoryRegistry;
-import npanday.vendor.SettingsUtil;
-import npanday.vendor.VendorRequirement;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-
-/**
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- */
-public abstract class AbstractNPandaySettingsAwareMojo
- extends AbstractNPandayMojo
-{
-
- /**
- * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
- */
- protected String settingsPath;
-
- /**
- * The vendor of the framework, the executable is provided by or compatible with.
- *
- * @parameter expression="${vendor}"
- */
- protected String vendor;
-
- /**
- * The version of the framework vendor, the executable is provided by or compatible with.
- *
- * @parameter expression="${vendorVersion}"
- */
- protected String vendorVersion;
-
- /**
- * The framework version, the executable is compatible with.
- *
- * @parameter expression = "${frameworkVersion}"
- */
- protected String frameworkVersion;
-
- /**
- * @component
- */
- protected RepositoryRegistry repositoryRegistry;
-
- /**
- * @component
- */
- protected npanday.executable.NetExecutableFactory netExecutableFactory;
-
- @Override
- protected void innerExecute() throws MojoExecutionException, MojoFailureException
- {
- SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
- }
-
- protected VendorRequirement getVendorRequirement(){
- return new VendorRequirement( vendor, vendorVersion, frameworkVersion);
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.libraryimporter.skeletons;
+
+import npanday.registry.RepositoryRegistry;
+import npanday.vendor.SettingsUtil;
+import npanday.vendor.VendorRequirement;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+
+/**
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ */
+public abstract class AbstractNPandaySettingsAwareMojo
+ extends AbstractNPandayMojo
+{
+
+ /**
+ * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
+ */
+ protected String settingsPath;
+
+ /**
+ * The vendor of the framework, the executable is provided by or compatible with.
+ *
+ * @parameter expression="${vendor}"
+ */
+ protected String vendor;
+
+ /**
+ * The version of the framework vendor, the executable is provided by or compatible with.
+ *
+ * @parameter expression="${vendorVersion}"
+ */
+ protected String vendorVersion;
+
+ /**
+ * The framework version, the executable is compatible with.
+ *
+ * @parameter expression = "${frameworkVersion}"
+ */
+ protected String frameworkVersion;
+
+ /**
+ * @component
+ */
+ protected RepositoryRegistry repositoryRegistry;
+
+ /**
+ * @component
+ */
+ protected npanday.executable.NetExecutableFactory netExecutableFactory;
+
+ @Override
+ protected void innerExecute() throws MojoExecutionException, MojoFailureException
+ {
+ SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
+ }
+
+ protected VendorRequirement getVendorRequirement(){
+ return new VendorRequirement( vendor, vendorVersion, frameworkVersion);
+ }
+}
diff --git a/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/CopyDependenciesMojo.java b/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/CopyDependenciesMojo.java
index 78cc655..3df445b 100644
--- a/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/CopyDependenciesMojo.java
+++ b/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/CopyDependenciesMojo.java
@@ -1,245 +1,245 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.resolver;
-
-import com.google.common.base.Strings;
-import npanday.ArtifactType;
-import npanday.LocalRepositoryUtil;
-import npanday.PathUtil;
-import npanday.registry.RepositoryRegistry;
-import npanday.resolver.NPandayDependencyResolution;
-import npanday.resolver.filter.DotnetSymbolsArtifactFilter;
-import npanday.resolver.filter.DotnetExecutableArtifactFilter;
-import npanday.resolver.filter.DotnetLibraryArtifactFilter;
-import npanday.resolver.filter.OrArtifactFilter;
-import npanday.vendor.SettingsUtil;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.InversionArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-import org.codehaus.plexus.util.FileUtils;
-
-import java.io.File;
-import java.io.IOException;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Resolves and copies .NET assemblies.
- *
- * @author <a href="me@lcorneliussen.de">Lars Corneliussen, Faktum Software</a>
- * @goal copy-dependencies
- */
-public class CopyDependenciesMojo
- extends AbstractMojo
-{
- /**
- * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
- */
- private String settingsPath;
-
- /**
- * @component
- */
- private RepositoryRegistry repositoryRegistry;
-
- /**
- * The maven project.
- *
- * @parameter expression="${project}"
- * @required
- */
- private MavenProject project;
-
- /**
- * The local Maven repository.
- *
- * @parameter expression="${settings.localRepository}"
- */
- private File localRepository;
-
- /**
- * @parameter default-value="compile" expression="${includeScope}"
- */
- private String includeScope;
-
- /**
- * @parameter expression="${excludeScope}"
- */
- private String excludeScope;
-
- /**
- * Specifies, if pdbs should be copied, too.
- *
- * @parameter default-value="true" expression="${includePdbs}"
- */
- private Boolean includePdbs;
-
- /**
- * @component
- */
- private NPandayDependencyResolution dependencyResolution;
-
- /**
- * @parameter default-value="${project.build.directory}\.references"
- */
- private File outputDirectory;
-
- /**
- * @parameter default-value="false"
- */
- private boolean skip;
-
- /**
- * The reactor projects.
- *
- * @parameter expression="${reactorProjects}"
- */
- protected List<MavenProject> reactorProjects;
-
- /**
- * If specified, Artifacts that are part of the same reactor will not be copied.
- * Transitive dependencies of these artifacts will still get copied, though.
- *
- * @parameter default-value="false"
- */
- private boolean skipReactorArtifacts;
-
- public void execute() throws MojoExecutionException, MojoFailureException
- {
- String skipReason = "";
- if ( !skip )
- {
- ArtifactType knownType = ArtifactType.getArtifactTypeForPackagingName(
- project.getPackaging()
- );
-
- if ( knownType.equals( ArtifactType.NULL ))
- {
- skip = true;
- skipReason =
- ", because the current project (type:" + project.getPackaging() + ") is not built with NPanday";
- }
- }
-
- if ( skip )
- {
- getLog().info( "NPANDAY-158-001: Mojo for copying dependencies was intentionally skipped" + skipReason );
- return;
- }
-
- SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
-
- AndArtifactFilter includeFilter = new AndArtifactFilter();
-
- OrArtifactFilter typeIncludes = new OrArtifactFilter();
- typeIncludes.add( new DotnetExecutableArtifactFilter() );
- typeIncludes.add( new DotnetLibraryArtifactFilter() );
-
- if (includePdbs){
- typeIncludes.add( new DotnetSymbolsArtifactFilter() );
- }
-
- includeFilter.add( typeIncludes );
-
- if ( !Strings.isNullOrEmpty( includeScope ) )
- {
- includeFilter.add( new ScopeArtifactFilter( includeScope ) );
- }
-
- Set<Artifact> artifacts;
- try
- {
- artifacts = dependencyResolution.require(
- project, LocalRepositoryUtil.create( localRepository ), includeFilter
- );
- }
- catch ( ArtifactResolutionException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-158-003: dependency resolution for scope " + includeScope + " failed!", e
- );
- }
-
- /**
- * Should be resolved, but then not copied
- */
- if ( !Strings.isNullOrEmpty( excludeScope ) )
- {
- includeFilter.add( new InversionArtifactFilter( new ScopeArtifactFilter( excludeScope ) ) );
- }
-
- if ( skipReactorArtifacts ){
- getLog().info( "NPANDAY-158-008: " + reactorProjects );
-
- includeFilter.add( new InversionArtifactFilter( new ArtifactFilter()
- {
- public boolean include( Artifact artifact )
- {
- for (MavenProject project : reactorProjects){
- // we don't care about the type and the classifier here
- if (project.getGroupId().equals(artifact.getGroupId())
- && project.getArtifactId().equals(artifact.getArtifactId())
- && project.getVersion().equals(artifact.getVersion())){
- return true;
- }
- }
- return false;
- }
- } ));
- }
-
- for ( Artifact dependency : artifacts )
- {
- if ( !includeFilter.include( dependency ) )
- {
- getLog().debug( "NPANDAY-158-006: dependency " + dependency + " was excluded" );
-
- continue;
- }
-
- try
- {
- File targetFile = new File( outputDirectory, PathUtil.getPlainArtifactFileName( dependency ) );
- if ( !targetFile.exists()
- || targetFile.lastModified() != dependency.getFile().lastModified()
- || targetFile.length() != dependency.getFile().length() )
- {
- getLog().info( "NPANDAY-158-004: copy " + dependency.getFile() + " to " + targetFile );
- FileUtils.copyFile( dependency.getFile(), targetFile );
- }
- else{
- getLog().debug( "NPANDAY-158-007: dependency " + dependency + " is yet up to date" );
- }
- }
- catch ( IOException ioe )
- {
- throw new MojoExecutionException( "NPANDAY-158-005: Error copying dependency " + dependency, ioe );
- }
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.resolver;
+
+import com.google.common.base.Strings;
+import npanday.ArtifactType;
+import npanday.LocalRepositoryUtil;
+import npanday.PathUtil;
+import npanday.registry.RepositoryRegistry;
+import npanday.resolver.NPandayDependencyResolution;
+import npanday.resolver.filter.DotnetSymbolsArtifactFilter;
+import npanday.resolver.filter.DotnetExecutableArtifactFilter;
+import npanday.resolver.filter.DotnetLibraryArtifactFilter;
+import npanday.resolver.filter.OrArtifactFilter;
+import npanday.vendor.SettingsUtil;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.InversionArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+import org.codehaus.plexus.util.FileUtils;
+
+import java.io.File;
+import java.io.IOException;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Resolves and copies .NET assemblies.
+ *
+ * @author <a href="me@lcorneliussen.de">Lars Corneliussen, Faktum Software</a>
+ * @goal copy-dependencies
+ */
+public class CopyDependenciesMojo
+ extends AbstractMojo
+{
+ /**
+ * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
+ */
+ private String settingsPath;
+
+ /**
+ * @component
+ */
+ private RepositoryRegistry repositoryRegistry;
+
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ */
+ private MavenProject project;
+
+ /**
+ * The local Maven repository.
+ *
+ * @parameter expression="${settings.localRepository}"
+ */
+ private File localRepository;
+
+ /**
+ * @parameter default-value="compile" expression="${includeScope}"
+ */
+ private String includeScope;
+
+ /**
+ * @parameter expression="${excludeScope}"
+ */
+ private String excludeScope;
+
+ /**
+ * Specifies, if pdbs should be copied, too.
+ *
+ * @parameter default-value="true" expression="${includePdbs}"
+ */
+ private Boolean includePdbs;
+
+ /**
+ * @component
+ */
+ private NPandayDependencyResolution dependencyResolution;
+
+ /**
+ * @parameter default-value="${project.build.directory}\.references"
+ */
+ private File outputDirectory;
+
+ /**
+ * @parameter default-value="false"
+ */
+ private boolean skip;
+
+ /**
+ * The reactor projects.
+ *
+ * @parameter expression="${reactorProjects}"
+ */
+ protected List<MavenProject> reactorProjects;
+
+ /**
+ * If specified, Artifacts that are part of the same reactor will not be copied.
+ * Transitive dependencies of these artifacts will still get copied, though.
+ *
+ * @parameter default-value="false"
+ */
+ private boolean skipReactorArtifacts;
+
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ String skipReason = "";
+ if ( !skip )
+ {
+ ArtifactType knownType = ArtifactType.getArtifactTypeForPackagingName(
+ project.getPackaging()
+ );
+
+ if ( knownType.equals( ArtifactType.NULL ))
+ {
+ skip = true;
+ skipReason =
+ ", because the current project (type:" + project.getPackaging() + ") is not built with NPanday";
+ }
+ }
+
+ if ( skip )
+ {
+ getLog().info( "NPANDAY-158-001: Mojo for copying dependencies was intentionally skipped" + skipReason );
+ return;
+ }
+
+ SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
+
+ AndArtifactFilter includeFilter = new AndArtifactFilter();
+
+ OrArtifactFilter typeIncludes = new OrArtifactFilter();
+ typeIncludes.add( new DotnetExecutableArtifactFilter() );
+ typeIncludes.add( new DotnetLibraryArtifactFilter() );
+
+ if (includePdbs){
+ typeIncludes.add( new DotnetSymbolsArtifactFilter() );
+ }
+
+ includeFilter.add( typeIncludes );
+
+ if ( !Strings.isNullOrEmpty( includeScope ) )
+ {
+ includeFilter.add( new ScopeArtifactFilter( includeScope ) );
+ }
+
+ Set<Artifact> artifacts;
+ try
+ {
+ artifacts = dependencyResolution.require(
+ project, LocalRepositoryUtil.create( localRepository ), includeFilter
+ );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-158-003: dependency resolution for scope " + includeScope + " failed!", e
+ );
+ }
+
+ /**
+ * Should be resolved, but then not copied
+ */
+ if ( !Strings.isNullOrEmpty( excludeScope ) )
+ {
+ includeFilter.add( new InversionArtifactFilter( new ScopeArtifactFilter( excludeScope ) ) );
+ }
+
+ if ( skipReactorArtifacts ){
+ getLog().info( "NPANDAY-158-008: " + reactorProjects );
+
+ includeFilter.add( new InversionArtifactFilter( new ArtifactFilter()
+ {
+ public boolean include( Artifact artifact )
+ {
+ for (MavenProject project : reactorProjects){
+ // we don't care about the type and the classifier here
+ if (project.getGroupId().equals(artifact.getGroupId())
+ && project.getArtifactId().equals(artifact.getArtifactId())
+ && project.getVersion().equals(artifact.getVersion())){
+ return true;
+ }
+ }
+ return false;
+ }
+ } ));
+ }
+
+ for ( Artifact dependency : artifacts )
+ {
+ if ( !includeFilter.include( dependency ) )
+ {
+ getLog().debug( "NPANDAY-158-006: dependency " + dependency + " was excluded" );
+
+ continue;
+ }
+
+ try
+ {
+ File targetFile = new File( outputDirectory, PathUtil.getPlainArtifactFileName( dependency ) );
+ if ( !targetFile.exists()
+ || targetFile.lastModified() != dependency.getFile().lastModified()
+ || targetFile.length() != dependency.getFile().length() )
+ {
+ getLog().info( "NPANDAY-158-004: copy " + dependency.getFile() + " to " + targetFile );
+ FileUtils.copyFile( dependency.getFile(), targetFile );
+ }
+ else{
+ getLog().debug( "NPANDAY-158-007: dependency " + dependency + " is yet up to date" );
+ }
+ }
+ catch ( IOException ioe )
+ {
+ throw new MojoExecutionException( "NPANDAY-158-005: Error copying dependency " + dependency, ioe );
+ }
+ }
+ }
+
+}
diff --git a/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/ListDependenciesMojo.java b/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/ListDependenciesMojo.java
index b3e8e42..f5f1262 100644
--- a/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/ListDependenciesMojo.java
+++ b/plugins/maven-resolver-plugin/src/main/java/npanday/plugin/resolver/ListDependenciesMojo.java
@@ -1,197 +1,197 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.resolver;
-
-import com.google.common.base.Strings;
-import npanday.LocalRepositoryUtil;
-import npanday.registry.RepositoryRegistry;
-import npanday.resolver.NPandayDependencyResolution;
-import npanday.vendor.SettingsUtil;
-import org.apache.maven.artifact.Artifact;
-import org.apache.maven.artifact.resolver.ArtifactResolutionException;
-import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.InversionArtifactFilter;
-import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
-import org.apache.maven.plugin.AbstractMojo;
-import org.apache.maven.plugin.MojoExecutionException;
-import org.apache.maven.plugin.MojoFailureException;
-import org.apache.maven.project.MavenProject;
-
-import java.io.File;
-import java.util.List;
-import java.util.Set;
-
-/**
- * Resolves and copies .NET assemblies.
- *
- * @author <a href="me@lcorneliussen.de">Lars Corneliussen, Faktum Software</a>
- * @goal list-dependencies
- */
-public class ListDependenciesMojo
- extends AbstractMojo
-{
- /**
- * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
- */
- private String settingsPath;
-
- /**
- * @component
- */
- private RepositoryRegistry repositoryRegistry;
-
- /**
- * The maven project.
- *
- * @parameter expression="${project}"
- * @required
- */
- private MavenProject project;
-
- /**
- * The local Maven repository.
- *
- * @parameter expression="${settings.localRepository}"
- */
- private File localRepository;
-
- /**
- * @parameter default-value="compile" expression="${includeScope}"
- */
- private String includeScope;
-
- /**
- * @parameter expression="${excludeScope}"
- */
- private String excludeScope;
-
- /**
- * @component
- */
- private NPandayDependencyResolution dependencyResolution;
-
- /**
- * @parameter default-value="${project.build.directory}\.references"
- */
- private File outputDirectory;
-
- /**
- * @parameter default-value="false"
- */
- private boolean skip;
-
- /**
- * The reactor projects.
- *
- * @parameter expression="${reactorProjects}"
- */
- protected List<MavenProject> reactorProjects;
-
- /**
- * If specified, Artifacts that are part of the same reactor will not be copied.
- * Transitive dependencies of these artifacts will still get copied, though.
- *
- * @parameter default-value="false"
- */
- private boolean skipReactorArtifacts;
-
- public void execute() throws MojoExecutionException, MojoFailureException
- {
- String skipReason = "";
- if ( skip )
- {
- getLog().info( "NPANDAY-161-001: Mojo for listing dependencies was intentionally skipped" + skipReason );
- return;
- }
-
- SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
-
- AndArtifactFilter includeFilter = new AndArtifactFilter();
-
- if ( !Strings.isNullOrEmpty( includeScope ) )
- {
- includeFilter.add( new ScopeArtifactFilter( includeScope ) );
- }
-
- Set<Artifact> artifacts;
- try
- {
- // TODO: Workarround. Somehow in the first run, PDBs wont be part of the result!
- dependencyResolution.require(
- project, LocalRepositoryUtil.create( localRepository ), includeFilter
- );
- artifacts = dependencyResolution.require(
- project, LocalRepositoryUtil.create( localRepository ), includeFilter
- );
- }
- catch ( ArtifactResolutionException e )
- {
- throw new MojoExecutionException(
- "NPANDAY-161-003: dependency resolution for scope " + includeScope + " failed!", e
- );
- }
-
- /**
- * Should be resolved, but then not shown
- */
- if ( !Strings.isNullOrEmpty( excludeScope ) )
- {
- includeFilter.add( new InversionArtifactFilter( new ScopeArtifactFilter( excludeScope ) ) );
- }
-
- if ( skipReactorArtifacts ){
- getLog().info( "NPANDAY-161-008: " + reactorProjects );
-
- includeFilter.add( new InversionArtifactFilter( new ArtifactFilter()
- {
- public boolean include( Artifact artifact )
- {
- for (MavenProject project : reactorProjects){
- // we don't care about the type and the classifier here
- if (project.getGroupId().equals(artifact.getGroupId())
- && project.getArtifactId().equals(artifact.getArtifactId())
- && project.getVersion().equals(artifact.getVersion())){
- return true;
- }
- }
- return false;
- }
- } ));
- }
-
- getLog().info(
- "The following files have been resolved:"
- );
- for ( Artifact dependency : artifacts )
- {
- if ( !includeFilter.include( dependency ) )
- {
- getLog().debug( "NPANDAY-161-006: dependency " + dependency + " was excluded" );
- continue;
- }
-
- getLog().info(
- " " + dependency.getId() + ":" + dependency.getScope() + " -> " + dependency.getFile()
- );
- }
- }
-
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.resolver;
+
+import com.google.common.base.Strings;
+import npanday.LocalRepositoryUtil;
+import npanday.registry.RepositoryRegistry;
+import npanday.resolver.NPandayDependencyResolution;
+import npanday.vendor.SettingsUtil;
+import org.apache.maven.artifact.Artifact;
+import org.apache.maven.artifact.resolver.ArtifactResolutionException;
+import org.apache.maven.artifact.resolver.filter.AndArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.InversionArtifactFilter;
+import org.apache.maven.artifact.resolver.filter.ScopeArtifactFilter;
+import org.apache.maven.plugin.AbstractMojo;
+import org.apache.maven.plugin.MojoExecutionException;
+import org.apache.maven.plugin.MojoFailureException;
+import org.apache.maven.project.MavenProject;
+
+import java.io.File;
+import java.util.List;
+import java.util.Set;
+
+/**
+ * Resolves and copies .NET assemblies.
+ *
+ * @author <a href="me@lcorneliussen.de">Lars Corneliussen, Faktum Software</a>
+ * @goal list-dependencies
+ */
+public class ListDependenciesMojo
+ extends AbstractMojo
+{
+ /**
+ * @parameter expression="${npanday.settings}" default-value="${user.home}/.m2"
+ */
+ private String settingsPath;
+
+ /**
+ * @component
+ */
+ private RepositoryRegistry repositoryRegistry;
+
+ /**
+ * The maven project.
+ *
+ * @parameter expression="${project}"
+ * @required
+ */
+ private MavenProject project;
+
+ /**
+ * The local Maven repository.
+ *
+ * @parameter expression="${settings.localRepository}"
+ */
+ private File localRepository;
+
+ /**
+ * @parameter default-value="compile" expression="${includeScope}"
+ */
+ private String includeScope;
+
+ /**
+ * @parameter expression="${excludeScope}"
+ */
+ private String excludeScope;
+
+ /**
+ * @component
+ */
+ private NPandayDependencyResolution dependencyResolution;
+
+ /**
+ * @parameter default-value="${project.build.directory}\.references"
+ */
+ private File outputDirectory;
+
+ /**
+ * @parameter default-value="false"
+ */
+ private boolean skip;
+
+ /**
+ * The reactor projects.
+ *
+ * @parameter expression="${reactorProjects}"
+ */
+ protected List<MavenProject> reactorProjects;
+
+ /**
+ * If specified, Artifacts that are part of the same reactor will not be copied.
+ * Transitive dependencies of these artifacts will still get copied, though.
+ *
+ * @parameter default-value="false"
+ */
+ private boolean skipReactorArtifacts;
+
+ public void execute() throws MojoExecutionException, MojoFailureException
+ {
+ String skipReason = "";
+ if ( skip )
+ {
+ getLog().info( "NPANDAY-161-001: Mojo for listing dependencies was intentionally skipped" + skipReason );
+ return;
+ }
+
+ SettingsUtil.applyCustomSettings( getLog(), repositoryRegistry, settingsPath );
+
+ AndArtifactFilter includeFilter = new AndArtifactFilter();
+
+ if ( !Strings.isNullOrEmpty( includeScope ) )
+ {
+ includeFilter.add( new ScopeArtifactFilter( includeScope ) );
+ }
+
+ Set<Artifact> artifacts;
+ try
+ {
+ // TODO: Workarround. Somehow in the first run, PDBs wont be part of the result!
+ dependencyResolution.require(
+ project, LocalRepositoryUtil.create( localRepository ), includeFilter
+ );
+ artifacts = dependencyResolution.require(
+ project, LocalRepositoryUtil.create( localRepository ), includeFilter
+ );
+ }
+ catch ( ArtifactResolutionException e )
+ {
+ throw new MojoExecutionException(
+ "NPANDAY-161-003: dependency resolution for scope " + includeScope + " failed!", e
+ );
+ }
+
+ /**
+ * Should be resolved, but then not shown
+ */
+ if ( !Strings.isNullOrEmpty( excludeScope ) )
+ {
+ includeFilter.add( new InversionArtifactFilter( new ScopeArtifactFilter( excludeScope ) ) );
+ }
+
+ if ( skipReactorArtifacts ){
+ getLog().info( "NPANDAY-161-008: " + reactorProjects );
+
+ includeFilter.add( new InversionArtifactFilter( new ArtifactFilter()
+ {
+ public boolean include( Artifact artifact )
+ {
+ for (MavenProject project : reactorProjects){
+ // we don't care about the type and the classifier here
+ if (project.getGroupId().equals(artifact.getGroupId())
+ && project.getArtifactId().equals(artifact.getArtifactId())
+ && project.getVersion().equals(artifact.getVersion())){
+ return true;
+ }
+ }
+ return false;
+ }
+ } ));
+ }
+
+ getLog().info(
+ "The following files have been resolved:"
+ );
+ for ( Artifact dependency : artifacts )
+ {
+ if ( !includeFilter.include( dependency ) )
+ {
+ getLog().debug( "NPANDAY-161-006: dependency " + dependency + " was excluded" );
+ continue;
+ }
+
+ getLog().info(
+ " " + dependency.getId() + ":" + dependency.getScope() + " -> " + dependency.getFile()
+ );
+ }
+ }
+
+}
diff --git a/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/create/CreateIisAppPackageMojo.java b/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/create/CreateIisAppPackageMojo.java
index 1712bee..35c6f44 100644
--- a/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/create/CreateIisAppPackageMojo.java
+++ b/plugins/msdeploy-maven-plugin/src/main/java/npanday/plugin/msdeploy/create/CreateIisAppPackageMojo.java
@@ -1,47 +1,47 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one
- * or more contributor license agreements. See the NOTICE file
- * distributed with this work for additional information
- * regarding copyright ownership. The ASF licenses this file
- * to you under the Apache License, Version 2.0 (the
- * "License"); you may not use this file except in compliance
- * with the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing,
- * software distributed under the License is distributed on an
- * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
- * KIND, either express or implied. See the License for the
- * specific language governing permissions and limitations
- * under the License.
- */
-
-package npanday.plugin.msdeploy.create;
-
-import java.util.List;
-
-/**
- * Picks up a prepared package folder and packages it using the MSDeploy command line tool
- * and the <a href="http://technet.microsoft.com/en-us/library/dd569054(v=ws.10).aspx">Web Deploy iisApp Provider</a>
- *
- * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
- * @phase package
- * @goal create-iisApp-package
- */
-public class CreateIisAppPackageMojo
- extends AbstractCreatePackageMojo
-{
- @Override
- protected List<Package> prepareIterationItems()
- {
- List<Package> packages = super.prepareIterationItems();
-
- for ( Package pkg : packages )
- {
- pkg.setSourceProvider( "iisApp" );
- }
-
- return packages;
- }
-}
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+package npanday.plugin.msdeploy.create;
+
+import java.util.List;
+
+/**
+ * Picks up a prepared package folder and packages it using the MSDeploy command line tool
+ * and the <a href="http://technet.microsoft.com/en-us/library/dd569054(v=ws.10).aspx">Web Deploy iisApp Provider</a>
+ *
+ * @author <a href="mailto:lcorneliussen@apache.org">Lars Corneliussen</a>
+ * @phase package
+ * @goal create-iisApp-package
+ */
+public class CreateIisAppPackageMojo
+ extends AbstractCreatePackageMojo
+{
+ @Override
+ protected List<Package> prepareIterationItems()
+ {
+ List<Package> packages = super.prepareIterationItems();
+
+ for ( Package pkg : packages )
+ {
+ pkg.setSourceProvider( "iisApp" );
+ }
+
+ return packages;
+ }
+}