All,

On second glance, I don't believe this issue is "fixable" in the old SVN 
archive (now at http://svn.duraspace.org/dspace/).  In other words, I 
think that running 'mvn install' against an old SVN checkout will always 
throw errors, unfortunately.

The underlying issue seems to be that the 'maven-license-plugin' (which 
we use to verify license headers) doesn't seem to obey any HTTP redirects.

So, that plugin thinks the License Header that it should check against 
*must* be located at: http://scm.dspace.org/svn/repo/licenses/LICENSE_HEADER

However, that URL now auto-redirects to the new location of:
https://svn.duraspace.org/dspace/licenses/LICENSE_HEADER

Unfortunately, the 'maven-license-plugin' doesn't seem to follow the 
redirect, so all License Header checks fail (for all source code files). 
This is why I don't believe we can fix this issue. It seems to be an 
issue in the 'maven-license-plugin' itself (which is a third-party 
plugin which we don't control).

There are several possible workarounds though. They include:

1) Always run 'mvn package' (as we recommend anyways) instead of 'mvn 
install' to build DSpace.

OR

2) If you need to run 'mvn install', always running 'mvn install' with 
the '-Dlicense.skip=true' flag (this will skip any license checks):
e.g. mvn install -Dlicense.skip=true

OR

3) If you are a developer, you can use the latest code from our GitHub 
repository (https://github.com/DSpace/DSpace) as it doesn't have this issue.

More specifically to NetBeans, if you went with workaround #1 or #2 
above, you'd want to customize the "Build" command settings (similar to 
how I described in my previous email -- included below).  But, if you 
were doing development off the latest and greatest DSpace code in 
GitHub, then you would not need to change the NetBeans default settings.

- Tim

On 5/9/2012 9:22 AM, Tim Donohue wrote:
>
> Masha,
>
> Ok, this is starting to make more sense now. :) NetBeans by default runs
> a 'mvn install' whenever you do a Maven build (it's just how it works).
> With DSpace, a 'mvn install' also runs a license check.
>
> I believe the reason why this isn't working is that we moved our SVN
> repository last week from 'http://scm.dspace.org' to
> 'http://svn.duraspace.org'. I suspect this means the License Header file
> (which is being checked against) is not being found properly (despite
> the redirects that I've put in place for the new SVN location).
>
> I'll have to look into this, to see how we can fix it.
>
> However, it is worth noting that DSpace has now migrated to using GitHub
> for all development work (as of April). We are no longer updating that
> old SVN repository and all old releases have been migrated to GitHub as
> well . So, you could switch over to using GitHub
> (https://github.com/DSpace/DSpace) instead of that old SVN repo.
> The NetBeans instructions are already updated to describe how you can
> checkout the code from GitHub:
> https://wiki.duraspace.org/display/DSPACE/IDE+Integration+-+DSpace+and+NetBeans
>
>
> We also have some GitHub/Git development tips at:
> https://wiki.duraspace.org/display/DSPACE/Development+with+Git (These
> are still a work in progress).
>
> If you still want to use the old SVN repository, the other immediate
> option would be to customize your NetBeans settings so that it runs 'mvn
> package' instead of 'mvn install'. Here's how you'd do that.
> 1. Right click on the project in NetBeans that you want to customize
> 2. Select "Properties"
> 3. In the pop-up window, go to the "Actions" page.
> 4. Select the "Build project" action. Change the 'Execute Goal' to be
> 'package' (instead of 'install').
> 5. You also may want to select the "Clean and Build project" action.
> Change the 'Execute Goal' to be 'clean package' (instead of 'clean
> install')
> 6. Click 'OK' to save those settings.
> 7. Finally, rebuild that Maven project. This time it should run 'mvn
> package' (and skip over any header checks).
>
> Again, I'll look into actually fixing this issue in the old SVN archive
> as well.
>
> - Tim
>
> On 5/8/2012 10:33 PM, Masha Watts wrote:
>> Dear Mark and Tim,
>>
>> I'm using Netbeans for the maven build and also I'm using default maven
>> goals. It worked fine till last Friday. Is there any effect from the SVN
>> repository change which held on last weekend?
>>
>> Tim,
>> It shows almost all the java files in the project.
>>
>> Thanks,
>> Masha.
>>
>> On Wed, May 9, 2012 at 4:41 AM, Mark Diggory <mdigg...@atmire.com
>> <mailto:mdigg...@atmire.com>> wrote:
>>
>> Masha and Tim,
>>
>> Another thought. The license goal shouldn't be getting executed
>> during the package phase of our regular build process. Are you
>> executing some other mvn goal or phase such as install or deploy?
>>
>> Mark
>>
>>
>> On Tue, May 8, 2012 at 7:12 AM, Tim Donohue <tdono...@duraspace.org
>> <mailto:tdono...@duraspace.org>> wrote:
>>
>> Hi Masha,
>>
>> Maven usually will also report the exact files which it found to not
>> have a proper header. Was there any additional information
>> provided when
>> you ran Maven?
>>
>> If you scroll up in your Maven response, you should find some
>> information similar to this reported:
>>
>> [INFO] --- maven-license-plugin:1.9.0:check (check-headers) @
>> dspace-api ---
>> [INFO] Checking licenses...
>> [INFO] Missing header in:
>> C:\DSpace-src\dspace-api\src\main\java\org\dspace\administer\DCType.java
>>
>> Note the last line which should tell you the exact class that is
>> missing
>> the header. So, search your Maven results to find a line that starts
>> with "Missing header in:" to determine which file it's reporting
>> issues
>> with.
>>
>> Finally, I should note that DSpace should only check headers
>> when you
>> run a "mvn install". If you instead run "mvn package" then the
>> 'check
>> headers' step should be skipped over.
>>
>> - Tim
>>
>> On 5/8/2012 4:34 AM, Masha Watts wrote:
>> > Dear All,
>> >
>> > I'm getting following error during the maven build. It says
>> *[Missing
>> > header]*. But when I go to individual java files, those
>> contains the
>> > default license text.
>> >
>> > Failed to execute goal
>> > com.mycila.maven-license-plugin:maven-license-plugin:1.9.0:check
>> > (check-headers) on project dspace-jspui-api: Some files do
>> not have the
>> > expected license header -> [Help 1]
>> >
>> > To see the full stack trace of the errors, re-run Maven with
>> the -e switch.
>> > Re-run Maven using the -X switch to enable full debug logging.
>> >
>> > For more information about the errors and possible solutions,
>> please
>> > read the following articles:
>> > [Help 1]
>> >
>> http://cwiki.apache.org/confluence/display/MAVEN/MojoExecutionException
>> >
>> >
>> > Can somebody help me on this.
>> >
>> > Masha.
>> >
>> >
>> >
>> >
>> >
>> ------------------------------------------------------------------------------
>>
>> > Live Security Virtual Conference
>> > Exclusive live event will cover all the ways today's security and
>> > threat landscape has changed and how IT managers can respond.
>> Discussions
>> > will include endpoint security, mobile security and the
>> latest in malware
>> > threats.
>> http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> >
>> >
>> >
>> > _______________________________________________
>> > DSpace-tech mailing list
>> > DSpace-tech@lists.sourceforge.net
>> <mailto:DSpace-tech@lists.sourceforge.net>
>> > https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>
>> ------------------------------------------------------------------------------
>>
>> Live Security Virtual Conference
>> Exclusive live event will cover all the ways today's security and
>> threat landscape has changed and how IT managers can respond.
>> Discussions
>> will include endpoint security, mobile security and the latest
>> in malware
>> threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
>> _______________________________________________
>> DSpace-tech mailing list
>> DSpace-tech@lists.sourceforge.net
>> <mailto:DSpace-tech@lists.sourceforge.net>
>> https://lists.sourceforge.net/lists/listinfo/dspace-tech
>>
>>
>>
>>
>> --
>> @mire Inc.
>> *Mark Diggory *(Schedule a Meeting <https://tungle.me/markdiggory>)
>> /2888 Loker Avenue East, Suite 305, Carlsbad, CA. 92010/
>> /Esperantolaan 4, Heverlee 3001, Belgium/
>> http://www.atmire.com <http://www.atmire.com/>
>>
>>
>>

------------------------------------------------------------------------------
Live Security Virtual Conference
Exclusive live event will cover all the ways today's security and 
threat landscape has changed and how IT managers can respond. Discussions 
will include endpoint security, mobile security and the latest in malware 
threats. http://www.accelacomm.com/jaw/sfrnl04242012/114/50122263/
_______________________________________________
DSpace-tech mailing list
DSpace-tech@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/dspace-tech

Reply via email to