You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@maven.apache.org by andre999 <an...@hotmail.com> on 2014/01/08 05:29:45 UTC

Maven install phase - Access is denied

Hi all,

I have a project which maven generates the following output in the target
folder;
<drive>\projects\mywork\trunk\target\<projectname>.jar
<drive>\projects\mywork\trunk\target\<projectname>-sources.jar
<drive>\projects\mywork\trunk\target\installer\folder

The above installer\folder is basically an empty folder which contains
subfolders to be part of installer.


I have a Build Error that displays "/Error installing artifact:
<drive>\projects\mywork\trunk\target\installer\folder (Access is denied)/"
when executing *mvn clean install*.
 
The maven copies the <drive>\projects\mywork\trunk\target\<projectname>.jar,  
<drive>\projects\mywork\trunk\target\<projectname>-sources.jar into local
repository with success. However the maven attempts to copy the 
<drive>\projects\mywork\trunk\target\installer\folder into the local
repository which is not I want to. This cause maven to throw the Build
Error.

How do I prevent maven copying the empty folder into local/remote repository
as an artifact?

Thanks,
Andrew





--
View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven install phase - Access is denied

Posted by Thomas Broyer <t....@gmail.com>.
I'd rather say the question is why does it even tries to install it? There
must be some plugin that attaches it.
Le 8 janv. 2014 22:34, "andre999" <an...@hotmail.com> a écrit :

> That's the problem. I do not know how to order maven install NOT to read
> the
> directory and not to create repository. Maven install reads the
> "install4j\certImport" folder and this is where it fails. How can I make
> maven not to read (skip) this "install4j\certImport" folder?
>
> Thanks
>
>
>
> --
> View this message in context:
> http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920p5780969.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
>
>

Re: Maven install phase - Access is denied

Posted by Russell Gold <ru...@gold-family.us>.
I suspect it has to do with your customization of the install goal:

> 			<plugin>
> 				<groupId>org.apache.maven.plugins</groupId>
>          		<artifactId>maven-install-plugin</artifactId>
>          		<version>2.5.1</version>
>          		<configuration>
>          			<file>certloader-custom-action.jar</file>
>          			<file>certloader-custom-action-sources.jar</file>
>          		</configuration>
> 			</plugin>

It looks as though your customization is telling it to install something that would not be installed by default.

On Jan 8, 2014, at 4:33 PM, andre999 <an...@hotmail.com> wrote:

> That's the problem. I do not know how to order maven install NOT to read the
> directory and not to create repository. Maven install reads the
> "install4j\certImport" folder and this is where it fails. How can I make
> maven not to read (skip) this "install4j\certImport" folder?
> 
> Thanks
> 
> 
> 
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920p5780969.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-----------------
Author, Getting Started with Apache Maven <http://www.packtpub.com/getting-started-with-apache-maven/video>

Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.fuzzyfacetheater.com/misfile/>!








Re: Maven install phase - Access is denied

Posted by andre999 <an...@hotmail.com>.
That's the problem. I do not know how to order maven install NOT to read the
directory and not to create repository. Maven install reads the
"install4j\certImport" folder and this is where it fails. How can I make
maven not to read (skip) this "install4j\certImport" folder?

Thanks



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920p5780969.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven install phase - Access is denied

Posted by Thomas Broyer <t....@gmail.com>.
Le 8 janv. 2014 20:39, "andre999" <an...@hotmail.com> a écrit :
>
> Caused by: java.io.FileNotFoundException:
>
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
> (Access is denied)
>         at java.io.FileInputStream.open(Native Method)

Isn't the problem that you're trying to install a directory rather than a
file? I don't think that's possible, a folder is not an artifact, it has to
be archived somehow first.

Re: Maven install phase - Access is denied

Posted by andre999 <an...@hotmail.com>.
Thanks for the input. Apologies for the goose chase. I have found that there
is an element <attach>true</attach> property in the
<artifactId>maven-install4j-plugin<artifactId>, which I did not include in
this thread.

With the <attach> set to false, the maven install has stopped reading any
resources from the "install4j/certImport" folder, and copying resource into
repository. 

Thanks again.



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920p5781054.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven install phase - Access is denied

Posted by Barrie Treloar <ba...@gmail.com>.
On 9 January 2014 06:56, andre999 <an...@hotmail.com> wrote:
> <build>
[del]
>                         <plugin>
>                                 <groupId>org.apache.maven.plugins</groupId>
>                         <artifactId>maven-install-plugin</artifactId>
>                         <version>2.5.1</version>
>                         <configuration>
>                                 <file>certloader-custom-action.jar</file>
>                                 <file>certloader-custom-action-sources.jar</file>

What do you expect this section to do?
http://maven.apache.org/plugins/maven-install-plugin/install-mojo.html
does not have a file property.
And file implies a single entry, specifying it a second time would
mean you overwrite the previous value.
Lists are normally plural. (something like
<files><file>A</file><file>B</file></files>

If you want the sources to also be installed use the source plugin
http://maven.apache.org/plugins/maven-source-plugin/

You shouldn't need this section on install at all.

I can't see anything in that pom that would mean a directory is being
installed into your local m2 cache.

The assembly plugin can have these types of issues when you specify
"dir" as a distribution format on deploy.
But deploy is after install so this is not the problem.

The problem I have is that it is trying to install
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
to
P:\.m2\repository\net\healthlink\certloader\hlk-certloader\1.0.2-SNAPSHOT\lk-certloader-1.0.2-SNAPSHOT-certImport

Why is maven attaching \target\install4j\certImport as a build
artifact that it thinks it needs to install.

Try running mvn -X and redirect the output to a file.
Then search for target\install4j\certImport and see which plugin is
being configured with this value.
That might give you a hint as to where to look to turn that off.
I'd almost suspect the parent pom.
Using resources:copy-resource does not attach anything to be installed
and it is the only thing that is using target\install4j\certImport
from your supplied output.

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


Re: Maven install phase - Access is denied

Posted by andre999 <an...@hotmail.com>.
I have run the cmd and there is no issue with right to create or delete
folders. 

Here are the build in pom.xml

<build>
		<finalName>certloader-custom-action</finalName>
		<resources>
			<resource>
				<directory>${basedir}/src/main/resources</directory>
				<excludes>
					<exclude>**/*.png</exclude>
					<exclude>*images*</exclude>
				</excludes>
			</resource>
		</resources>	
		<plugins>
			<plugin>
				<artifactId>maven-resources-plugin</artifactId>
				<version>2.6</version>
				<configuration>
					<includeEmptyDirs>true</includeEmptyDirs>
					<outputDirectory>${basedir}/target/install4j</outputDirectory>					
				</configuration>
				<executions>
					<execution>
						<id>copy-resources</id>
						<phase>validate</phase>
						<goals>
							<goal>copy-resources</goal>
						</goals>
						<configuration>							
						
<outputDirectory>${basedir}/target/install4j/certImport</outputDirectory>
							<resources>
								<resource>
									<directory>${basedir}/src/main/resources/certImport</directory>									
								</resource>								
							</resources>
							<includeEmptyDirs>true</includeEmptyDirs>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
          		<artifactId>maven-install-plugin</artifactId>
          		<version>2.5.1</version>
          		<configuration>
          			<file>certloader-custom-action.jar</file>
          			<file>certloader-custom-action-sources.jar</file>
          		</configuration>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-dependency-plugin</artifactId>
				<version>2.5.1</version>
				<executions>
					<execution>
						<id>properties</id>
						<goals>
							<goal>properties</goal>
						</goals>
					</execution>
					<execution>
						<id>validate-exe</id>
						<phase>validate</phase>
						<goals>
							<goal>unpack</goal>
						</goals>
						<configuration>
							<outputAbsoluteArtifactFilename>true</outputAbsoluteArtifactFilename>
							<artifactItems>
								<artifactItem>
									<groupId>net.install4j</groupId>
									<artifactId>install4j</artifactId>
									<version>5.0.10</version>
									<type>zip</type>
								</artifactItem>
							</artifactItems>
							<outputDirectory>${install4j_path}</outputDirectory>
							<overWriteReleases>false</overWriteReleases>
							<overWriteSnapshots>true</overWriteSnapshots>
						</configuration>
					</execution>
					<execution>
						<phase>process-sources</phase>
						<goals>
							<goal>copy-dependencies</goal>
						</goals>
						<configuration>
							<outputDirectory>${basedir}/target/dependency</outputDirectory>
							<stripVersion>true</stripVersion>
							<overWriteIfNewer>true</overWriteIfNewer>
						</configuration>
					</execution>
				</executions>
			</plugin>
			<plugin>
				<groupId>org.apache.maven.plugins</groupId>
				<artifactId>maven-assembly-plugin</artifactId>
				<version>2.4</version>
				<executions>
					<execution>
						<id>make-assembly</id>
						<phase>package</phase>
						<goals>
							<goal>single</goal>
						</goals>
						<configuration>
							<finalName>Loader-${project.version}</finalName>
							<descriptors>
								<descriptor>src/main/assembly/assembly.xml</descriptor>
							</descriptors>
						</configuration>
					</execution>
				</executions>
			</plugin>
		</plugins>
</build>		








--
View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920p5780962.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven install phase - Access is denied

Posted by Wayne Fay <wa...@gmail.com>.
> [INFO] Error installing artifact:
> P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
> (Access is denied)

I hate to point out the obvious, but did you confirm that the user
executing Maven has write/create directory privileges in this
location? Assuming you are running from the Windows command line, can
you go there (as the same user) and "mkdir" etc?

Wayne

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


Re: Maven install phase - Access is denied

Posted by andre999 <an...@hotmail.com>.
I have included the result with the actual filenames and folders in use.
Here are the result;

[DEBUG] -- end configuration --
[INFO] [install:install {execution: default-install}]
[INFO] Installing
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\certloader-custom-action.jar
to P:\.m2\repository\net\healthlink\certloader\hlk-certloader\1.0.2-S
APSHOT\hlk-certloader-1.0.2-SNAPSHOT.jar
[INFO] Installing
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\certloader-custom-action-sources.jar
to P:\.m2\repository\net\healthlink\certloader\hlk-certloader
1.0.2-SNAPSHOT\hlk-certloader-1.0.2-SNAPSHOT-sources.jar
[INFO] Installing
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
to
P:\.m2\repository\net\healthlink\certloader\hlk-certloader\1.0.2-SNAPSHOT\
lk-certloader-1.0.2-SNAPSHOT-certImport
[INFO]
------------------------------------------------------------------------
[ERROR] BUILD ERROR
[INFO]
------------------------------------------------------------------------
[INFO] Error installing artifact:
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
(Access is denied)

[INFO]
------------------------------------------------------------------------
[DEBUG] Trace
org.apache.maven.lifecycle.LifecycleExecutionException: Error installing
artifact:
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
(Access is d
nied)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:719)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalWithLifecycle(DefaultLifecycleExecutor.java:556)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoal(DefaultLifecycleExecutor.java:535)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoalAndHandleFailures(DefaultLifecycleExecutor.java:387)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeTaskSegments(DefaultLifecycleExecutor.java:348)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.execute(DefaultLifecycleExecutor.java:180)
        at org.apache.maven.DefaultMaven.doExecute(DefaultMaven.java:328)
        at org.apache.maven.DefaultMaven.execute(DefaultMaven.java:138)
        at org.apache.maven.cli.MavenCli.main(MavenCli.java:362)
        at
org.apache.maven.cli.compat.CompatibleMain.main(CompatibleMain.java:60)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at
sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
        at
sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
        at java.lang.reflect.Method.invoke(Method.java:597)
        at
org.codehaus.classworlds.Launcher.launchEnhanced(Launcher.java:315)
        at org.codehaus.classworlds.Launcher.launch(Launcher.java:255)
        at
org.codehaus.classworlds.Launcher.mainWithExitCode(Launcher.java:430)
        at org.codehaus.classworlds.Launcher.main(Launcher.java:375)
Caused by: org.apache.maven.plugin.MojoExecutionException: Error installing
artifact:
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
(Access i
 denied)
        at
org.apache.maven.plugin.install.InstallMojo.installProject(InstallMojo.java:239)
        at
org.apache.maven.plugin.install.InstallMojo.execute(InstallMojo.java:129)
        at
org.apache.maven.plugin.DefaultPluginManager.executeMojo(DefaultPluginManager.java:490)
        at
org.apache.maven.lifecycle.DefaultLifecycleExecutor.executeGoals(DefaultLifecycleExecutor.java:694)
        ... 17 more
Caused by:
org.apache.maven.artifact.installer.ArtifactInstallationException: Error
installing artifact:
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\c
rtImport (Access is denied)
        at
org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(DefaultArtifactInstaller.java:119)
        at
org.apache.maven.plugin.install.InstallMojo.installProject(InstallMojo.java:230)
        ... 20 more
Caused by: java.io.FileNotFoundException:
P:\Projects\HlkProjects\CertLoader\hlk-certloader\trunk\target\install4j\certImport
(Access is denied)
        at java.io.FileInputStream.open(Native Method)
        at java.io.FileInputStream.<init>(FileInputStream.java:120)
        at
hidden.org.codehaus.plexus.util.io.FileInputStreamFacade.getInputStream(FileInputStreamFacade.java:39)
        at
hidden.org.codehaus.plexus.util.FileUtils.copyStreamToFile(FileUtils.java:1106)
        at
hidden.org.codehaus.plexus.util.FileUtils.copyFile(FileUtils.java:1013)
        at
org.apache.maven.artifact.installer.DefaultArtifactInstaller.install(DefaultArtifactInstaller.java:98)
        ... 21 more
[INFO]
------------------------------------------------------------------------



--
View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920p5780950.html
Sent from the Maven - Users mailing list archive at Nabble.com.

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


Re: Maven install phase - Access is denied

Posted by Russell Gold <ru...@gold-family.us>.
Hi Andrew, can you show us the result of doing this when you run the -X switch? It is likely to provide more information about what is going on; a copy of your pom.xml would also be very helpful.

Thanks,
Russ

On Jan 7, 2014, at 11:29 PM, andre999 <an...@hotmail.com> wrote:

> Hi all,
> 
> I have a project which maven generates the following output in the target
> folder;
> <drive>\projects\mywork\trunk\target\<projectname>.jar
> <drive>\projects\mywork\trunk\target\<projectname>-sources.jar
> <drive>\projects\mywork\trunk\target\installer\folder
> 
> The above installer\folder is basically an empty folder which contains
> subfolders to be part of installer.
> 
> 
> I have a Build Error that displays "/Error installing artifact:
> <drive>\projects\mywork\trunk\target\installer\folder (Access is denied)/"
> when executing *mvn clean install*.
> 
> The maven copies the <drive>\projects\mywork\trunk\target\<projectname>.jar,  
> <drive>\projects\mywork\trunk\target\<projectname>-sources.jar into local
> repository with success. However the maven attempts to copy the 
> <drive>\projects\mywork\trunk\target\installer\folder into the local
> repository which is not I want to. This cause maven to throw the Build
> Error.
> 
> How do I prevent maven copying the empty folder into local/remote repository
> as an artifact?
> 
> Thanks,
> Andrew
> 
> 
> 
> 
> 
> --
> View this message in context: http://maven.40175.n5.nabble.com/Maven-install-phase-Access-is-denied-tp5780920.html
> Sent from the Maven - Users mailing list archive at Nabble.com.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@maven.apache.org
> For additional commands, e-mail: users-help@maven.apache.org
> 

-----------------
Author, Getting Started with Apache Maven <http://www.packtpub.com/getting-started-with-apache-maven/video>

Come read my webnovel, Take a Lemon <http://www.takealemon.com>, 
and listen to the Misfile radio play <http://www.fuzzyfacetheater.com/misfile/>!